Skip to content

Instantly share code, notes, and snippets.

@sdrwtf
Last active September 8, 2021 12:36
Show Gist options
  • Save sdrwtf/f9c0cda4a0a0e9e7e3c6a9c9f79320a6 to your computer and use it in GitHub Desktop.
Save sdrwtf/f9c0cda4a0a0e9e7e3c6a9c9f79320a6 to your computer and use it in GitHub Desktop.
ffmpeg hmtl5 video conversion note
# ffmpeg hmtl5 video conversion
# MP4
# Adjust quality by changing the CRF or PRESET value, see https://trac.ffmpeg.org/wiki/Encode/H.265 for details
ffmpeg -i [IN-FILENAME] -acodec aac -strict experimental -ac 2 -ab 128k -vcodec libx264 -f mp4 -crf 25 -preset slow -s 1920x1080 [OUT-FILENAME].mp4
# OGV
# Adjust quality with -q:v (video) and -q:a (audio) values, lower means better quality but bigger file size. Range is 0 to 10.
ffmpeg -i [IN-FILENAME] -c:v libtheora -q:v 7 -c:a libvorbis -q:a 4 [OUT-FILENAME].ogv
# WEBM
# Adjust quality by changing the CRF value, lower means better quality but bigger file size
ffmpeg -i [IN-FILENAME] -c:v libvpx-vp9 -crf 30 -b:v 0 -b:a 128k -c:a libopus -s 1920x1080 [OUT-FILENAME].webm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment