Skip to content

Instantly share code, notes, and snippets.

@gin1314
Created July 30, 2015 11:47
Show Gist options
  • Save gin1314/a7d78fb318264c109137 to your computer and use it in GitHub Desktop.
Save gin1314/a7d78fb318264c109137 to your computer and use it in GitHub Desktop.
ffmpeg recipe for mobile video
“Standard” web video (480p at 500kbit/s):
ffmpeg -i input_file.avi -vcodec libx264 -vprofile high -preset slow -b:v 500k -maxrate 500k -bufsize 1000k -vf scale=-1:480 -threads 0 -acodec libvo_aacenc -b:a 128k output_file.mp4
360p video for older mobile phones (360p at 250kbit/s in baseline profile):
ffmpeg -i inputfile.avi -vcodec libx264 -vprofile baseline -preset slow -b:v 250k -maxrate 250k -bufsize 500k -vf scale=-1:360 -threads 0
-acodec libvo_aacenc -ab 96k output.mp4
480p video for iPads and tablets (480p at 400kbit/s in main profile):
ffmpeg -i inputfile.avi -vcodec libx264 -vprofile main -preset slow -b:v 400k -maxrate 400k -bufsize 800k -vf scale=-1:480 -threads 0 -acodec libvo_aacenc -ab 128k output.mp4
High-quality SD video for archive/storage (PAL at 1Mbit/s in high profile):
ffmpeg -i inputfile.avi -vcodec libx264 -vprofile high -preset slower -b:v 1000k -vf scale=-1:576 -threads 0 -acodec libvo_aacenc -ab
196k output.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment