Last active
May 25, 2021 09:46
-
-
Save wpyoga/cbe7b20d1bc6e16491075c1d3168501d to your computer and use it in GitHub Desktop.
ffmpeg create video from single image
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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