Closed EricWui closed 2 years ago
You can try this script:
import os
video_root = 'clips320H'
frame_root = 'frames'
video_list = os.listdir(video_root)
total_videos = len(video_list)
for idx, video_name in enumerate(video_list):
video_path = os.path.join(frame_root, video_name[:-4])
if not os.path.exists(video_path):
os.mkdir(video_path)
is_success = os.system('ffmpeg -i {} -f image2 {}/%05d.jpg'.format(os.path.join(video_root, video_name),
video_path))
print(idx, '/', total_videos, video_name, is_success)
Thank you very much!
---- Replied Message ---- | From | Zihan @.> | | Date | 09/21/2022 22:49 | | To | @.> | | Cc | @.**@.> | | Subject | Re: [dzh19990407/LBDT] Download this dataset from here. Extract frames and masks from clips320H/ and Annotations/col? (Issue #4) |
You can try this script:
importosvideo_root='clips320H'frame_root='frames'video_list=os.listdir(video_root) total_videos=len(video_list) foridx, video_nameinenumerate(video_list): video_path=os.path.join(frame_root, video_name[:-4]) ifnotos.path.exists(video_path): os.mkdir(video_path) is_success=os.system('ffmpeg -i {} -f image2 {}/%05d.jpg'.format(os.path.join(video_root, video_name), video_path)) print(idx, '/', total_videos, video_name, is_success)
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
Can you give some shell scripts to extract frames from clips320H? Thanks!