Batch converting videos to play on the Nexus 7 using FFMPEG
How to batch convert videos to play on the Nexus 7 using FFMPEG in Python.
mypath = r'path_to_video_files' from os import listdir from os.path import isfile, join onlyfiles = [ f for f in listdir(mypath) if isfile(join(mypath,f)) ] for file in onlyfiles: infile = '"' + mypath + file + '"' outfile = '"' + mypath + file + '.mp4' + '"' ffmpegpath = r'ffmpeg.exe' cmd = r' -i ' + infile + ' -acodec libmp3lame -vcodec libx264 -aspect 16:9 -s 800x480 -ab 128k -b 512k -f mp4 -strict experimental ' + outfile import os os.system(ffmpegpath + cmd)
Leave a Reply