diff --git a/data/videos_cam/2022-02-15-153646.webm b/data/videos_cam/2022-02-15-153646.webm new file mode 100644 index 0000000000000000000000000000000000000000..3630c4d2cff6051f4fda54e434d5f05b4828f4a3 Binary files /dev/null and b/data/videos_cam/2022-02-15-153646.webm differ diff --git a/data/videos_cam/2022-02-15-153851.webm b/data/videos_cam/2022-02-15-153851.webm new file mode 100644 index 0000000000000000000000000000000000000000..2ef661f0fcc4be4f690eac28e75a82edf2abb85a Binary files /dev/null and b/data/videos_cam/2022-02-15-153851.webm differ diff --git a/data/videos_cam/2022-02-15-154017.webm b/data/videos_cam/2022-02-15-154017.webm new file mode 100644 index 0000000000000000000000000000000000000000..50326f13b7e4a2b44ca26ef5cb058ae7e6ffa127 Binary files /dev/null and b/data/videos_cam/2022-02-15-154017.webm differ diff --git a/data/videos_cam/2022-02-15-154638.webm b/data/videos_cam/2022-02-15-154638.webm new file mode 100644 index 0000000000000000000000000000000000000000..559bfd2208a1e9e98d35587f86c1ae97d535e1e8 Binary files /dev/null and b/data/videos_cam/2022-02-15-154638.webm differ diff --git a/data/videos_cam/2022-02-15-154943.webm b/data/videos_cam/2022-02-15-154943.webm new file mode 100644 index 0000000000000000000000000000000000000000..cd76e319a33c04ed3bb7db9a7a3aa0853c6ea7eb Binary files /dev/null and b/data/videos_cam/2022-02-15-154943.webm differ diff --git a/data/VID_20220208_150059.mp4 b/data/videos_cam/VID_20220208_150059.mp4 similarity index 100% rename from data/VID_20220208_150059.mp4 rename to data/videos_cam/VID_20220208_150059.mp4 diff --git a/src/video_to_img.py b/src/video_to_img.py new file mode 100644 index 0000000000000000000000000000000000000000..d84af8ab06bd9b6bcbd77c46ebe4f82902f42d61 --- /dev/null +++ b/src/video_to_img.py @@ -0,0 +1,48 @@ +# Importing all necessary libraries +import cv2 +import os + +# Read the video from specified path +vid_path = "./data/videos_cam/" +vid = "2022-02-15-15364" +vid_ext = ".webm" +cam = cv2.VideoCapture(vid_path + vid + vid_ext) + +# Output +output_path = "./data/img/" + vid + "/" + +try: + # creating a folder named data + if not os.path.exists(output_path): + os.makedirs(output_path) + +# if not created then raise error +except OSError: + print('Error: Creating directory of data') + +# frame +currentframe = 0 + +while (True): + + # reading from frame + ret, frame = cam.read() + print("ok", frame) + + if ret: + # if video is still left continue creating images + name = str(currentframe) + '.jpg' + print('Creating...' + name) + + # writing the extracted images + cv2.imwrite(output_path + name, frame) + + # increasing counter so that it will + # show how many frames are created + currentframe += 1 + else: + break + +# Release all space and windows once done +cam.release() +cv2.destroyAllWindows()