Skip to content

Instantly share code, notes, and snippets.

@wpyoga
Last active May 25, 2021 09:46
Show Gist options
  • Save wpyoga/cbe7b20d1bc6e16491075c1d3168501d to your computer and use it in GitHub Desktop.
Save wpyoga/cbe7b20d1bc6e16491075c1d3168501d to your computer and use it in GitHub Desktop.
ffmpeg create video from single image
# image.png: image file
# video.mp4: video file
# -t 5: video duration in seconds
# -crf 20: (optional) compression, higher value higher compression rate and lower video quality
# using -crf 0 (lossless) sometimes leads to glitches, use -crf 1 for best results
# note: the order of the arguments matter
ffmpeg -loop 1 -i image.png -t 5 -crf 20 -vcodec libx264 -pix_fmt yuv420p video.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment