Skip to content

Instantly share code, notes, and snippets.

@artze
Created September 4, 2021 06:27
Show Gist options
  • Save artze/61ba477fbee512421847c9a14d5c3bec to your computer and use it in GitHub Desktop.
Save artze/61ba477fbee512421847c9a14d5c3bec to your computer and use it in GitHub Desktop.
Frequently used ffmpeg cmd
// Uses baseline mode of h264 encoding, and ensures that dimensions are divisible by 2
ffmpeg -r 30 -f image2 -i "%04d.png" -c:v libx264 -profile:v baseline -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" -an -crf 17 output.mp4
// with 2x speed
ffmpeg -r 30 -f image2 -i "%04d.png" -c:v libx264 -profile:v baseline -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" -an -crf 17 -filter:v "setpts=0.5*PTS" ./mp4/output-2.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment