Skip to content

Instantly share code, notes, and snippets.

@grodowski
Last active January 13, 2020 09:58
Show Gist options
  • Save grodowski/6ccb348df4ccdb482b92 to your computer and use it in GitHub Desktop.
Save grodowski/6ccb348df4ccdb482b92 to your computer and use it in GitHub Desktop.
Mobile optimized HTML5 video encoding using FFMPEG
# webm
ffmpeg -y -i snp-inst3.mp4 \
-filter:v scale=640:360,setsar=1/1 -pix_fmt yuv420p \
-vpre libvpx-720p -b:v 500k -r:v 25/1 -force_fps \
-c:a libvorbis -b:a 80k -pass 1 out_inst.webm
# mp4
ffmpeg -y -i snp-inst3.mp4 \
-filter:v scale=640:360,setsar=1/1 -pix_fmt yuv420p \
-c:v libx264 -preset:v slow -profile:v baseline \
-x264opts level=3.0:ref=1 -b:v 700k -r:v 25/1 -force_fps \
-movflags +faststart -c:a libfaac -b:a 80k -pass 1 out_inst.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment