Skip to content

Instantly share code, notes, and snippets.

@TonyChangho
Last active June 26, 2020 05:24
Show Gist options
  • Save TonyChangho/f316b1271bd69aa79dfc3734aef3cb8e to your computer and use it in GitHub Desktop.
Save TonyChangho/f316b1271bd69aa79dfc3734aef3cb8e to your computer and use it in GitHub Desktop.
ffmpeg cheat sheet
# Encode a video in H.264 with a constant rate factor of 0 (visually non-lossy), run it through a filter for deinterlacing (Weston
# Three-Field), and do not re-encode the audio
ffmpeg -i input.mkv -c:v libx264 -crf 0 -filter:v w3fdif -c:a copy output_edit-x264-crf0-w3fdif.mkv
# H.264 video at an average bitrate of 25MB/s, and just copy the audio
# - `-an` disables audio on first pass
# - `-y` automatically overwrites an existing output file, but don't worry since it's /dev/null on the first pass
ffmpeg -y -i input.mkv -c:v libx264 -b:v 25000k -pass 1 -an -f mp4 /dev/null && \
ffmpeg -i input.mkv -c:v libx264 -b:v 25000k -pass 2 -c:a copy output_edit-x264-abr25000.mkv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment