import cv2 import os import ffmpeg def save_img(): folders=os.listdir(r\'/hom1/zhangzheyuan/video_raw\'); folders.sort(); for i in folders: if i==".DS_Store": continue video_path=r\'/hom1/zhangzheyuan/video_raw/%s\' %i; videos = os.listdir(video_path) for video_name in videos: file_name = video_name.split(\'.\')[0] if(1==len(video_name.split(\'.\'))): continue folder_name = video_path + \'/\' + file_name if os.path.exists(folder_name)==False: os.makedirs(folder_name) instruction="ffmpeg -i %s -vf select=\'eq(pict_type\,I)\' -vsync 2 -s 1920*1080 -f image2 %s/core-%%02d.jpeg" % (video_path+\'/\'+video_name,folder_name) os.system(instruction) print(instruction) print(\'save_success\') print(video_name) save_img();
Mac远程连接Linux服务器 (2)
内容版权声明:除非注明,否则皆为本站原创文章。