Spaces:
Runtime error
Runtime error
File size: 693 Bytes
6a0dd6d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
import os
from glob import glob
from pathlib import Path
new_fr = 2
dir_path = "poses_skeleton_gifs"
new_dir_path = "poses_skeleton_gifs_2fps"
Path(new_dir_path).mkdir(parents=True, exist_ok=True)
for full_filename in glob(dir_path+"/*.mp4"):
filename = full_filename.split("/")[-1].split(".")[0]
new_full_filename_h264 = new_dir_path + "/" + filename + ".h264"
new_full_filename_mp4 = new_dir_path + "/" + filename + ".mp4"
os.system("ffmpeg -y -i {0} -c copy -f h264 {1}".format(full_filename, new_full_filename_h264))
os.system("ffmpeg -y -r {0} -i {1} -c copy {2}".format(new_fr, new_full_filename_h264, new_full_filename_mp4))
os.remove(new_full_filename_h264)
|