Last active
May 21, 2019 09:11
-
-
Save DecentMakeover/e4a87089dcc9be29dbbe6bf36d9c26ae to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
frames =5 | |
video_folder = '/media/ryan/shakira/3d-cnn-action-recognition/some_folder' | |
for file in os.listdir(video_folder): | |
if file.endswith('.webm'): | |
os.mkdir(os.path.join(video_folder,file.split('.')[0])) | |
folder_name = file.split('.')[0] | |
os.system('ffmpeg -t 4 -i {} -vf fps={} {}/%05d.jpg -t 10'.format(os.path.join(video_folder,file), frames,os.path.join(video_folder,folder_name ))) | |
elif file.endswith('.mp4'): | |
os.mkdir(os.path.join(video_folder,file.split('.')[0])) | |
folder_name = file.split('.')[0] | |
os.system('ffmpeg -t 4 -i {} -vf fps={} {}/%05d.jpg -t 10'.format(os.path.join(video_folder,file), frames,os.path.join(video_folder,folder_name ))) | |
elif file.endswith('.blob'): | |
os.mkdir(os.path.join(video_folder,file.split('.')[0])) | |
folder_name = file.split('.')[0] | |
os.system('ffmpeg -i {} -vf fps={} {}/%05d.jpg'.format(os.path.join(video_folder,file), frames,os.path.join(video_folder,folder_name ))) | |
else: | |
print('*********************************************************', file) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment