yaotungyu

ffmpeg webm

Jun 9th, 2021
780
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import subprocess
  2. ffmpegExe = 'G:/Pipeline/pipeline/ffmpeg/ffmpeg-20161004-be1d324-win64-shared/bin/ffmpeg.exe'
  3.  
  4. vid_dir = "G:/Tech_Animation/tutorials/Welcome  Tutorials/ABC_TOOL/"
  5. for a in os.listdir( vid_dir ):
  6.     vid_path = vid_dir + a
  7.     file_n = a.split('.')[0]
  8.     print 'converting ',file_n
  9.     flags = '-i "{}" -c:v libvpx -quality good -cpu-used 0 -b:v 500K -crf 12 -pix_fmt yuv420p -movflags faststart -s 1920x1080 "C:/Temp/{}.webm"'.format(vid_path,file_n)
  10.     subprocess.call(ffmpegExe+' ' +flags)
  11.  
  12. ffmpegExe
  13.  
  14.  
  15.  
  16.  
RAW Paste Data