Skip to content

Instantly share code, notes, and snippets.

@Om4ar
Forked from dvlden/ffmpeg.md
Created February 15, 2018 23:04
Show Gist options
  • Save Om4ar/908097db26c43a894fd4e1d5d88c135f to your computer and use it in GitHub Desktop.
Save Om4ar/908097db26c43a894fd4e1d5d88c135f to your computer and use it in GitHub Desktop.
Convert video files to MP4 through FFMPEG

This is my personal list of functions that I wrote for converting mov files to mp4, but they can be used to convert from any video file format into any other I guess... (not tested)

Explanations

-codec:a (audio codec) : libfaac, libfdk_aac, libvorbis -quality : best, good, realtime -b:a (audio bitrate) : 128k, 192k, 256k, 320k -codec:v (video codec) : mpeg4, libx264, libvpx-vp9 -b:v (video bitrate) : 1000, 2500, 5000, 8000 -vf scale (resize video) : -1:X (where X is height) -qmin 10 -qmax 42 : I don't really know what is this for, help related to this is welcome...

MP4 - 1080p

ffmpeg -i input.mov -preset slow -codec:a libfdk_aac -b:a 128k -codec:v libx264 -pix_fmt yuv420p -b:v 4500k -minrate 4500k -maxrate 9000k -bufsize 9000k -vf scale=-1:1080 intro-1080p.mp4

MP4 - 720p

ffmpeg -i input.mov -preset slow -codec:a libfdk_aac -b:a 128k -codec:v libx264 -pix_fmt yuv420p -b:v 2500k -minrate 1500k -maxrate 4000k -bufsize 5000k -vf scale=-1:720 intro-720p.mp4

MP4 - 480p

ffmpeg -i input.mov -preset slow -codec:a libfdk_aac -b:a 128k -codec:v libx264 -pix_fmt yuv420p -b:v 1000k -minrate 500k -maxrate 2000k -bufsize 2000k -vf scale=854:480 intro-480p.mp4

MP4 - 360p

ffmpeg -i input.mov -preset slow -codec:a libfdk_aac -b:a 128k -codec:v libx264 -pix_fmt yuv420p -b:v 750k -minrate 400k -maxrate 1000k -bufsize 1500k -vf scale=-1:360 intro-360p.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment