I have tried a number of different options found on StackExchange for converting still images into an mp4. I have yet to be entirely successful. Any help would be appreciated.
ffmpeg -i ../*.jpg -c:v libx264 -crf 0 -y output.mp4The resulting mp4 contains the first image with 00:00 for the length of the video. It looks like it is working. The stream mapping shows all 17 images (0-16) in the Stream mapping. I see in the output text that it determined the image resolution to be 1280x800, which is correct.
I'm not sure if it is relevant, but the initial images are around 93KB. The mp4 is 504KB.
These 17 images are part of a test set. Eventually, I hope to use this method to generate a 6-day time-lapse.
2 Answers
Problem
ffmpeg expands the * wildcard in your command to:
ffmpeg -i 001.jpg 002.jpg 003.jpg -c:v libx264 -crf 0 -y output.mp4This assumes your input files are named 001.jpg, 002.jpg, 003.jpg, etc.
So now 001.jpg is the only input and 002.jpg, 003.jpg, output.mp4 are the output files. Since you're using the dangerous -y option (automatically overwrite without asking) then 002.jpg and 003.jpg have been overwritten.
Solutions
Use the -pattern_type glob option:
ffmpeg -framerate 10 -pattern_type glob -i "*.jpg" -c:v libx264 -crf 0 output.mp4This may not work in Windows.
Or tell it the inputs are a sequence. For 001.jpg, etc:
ffmpeg -i %03d.jpg -c:v libx264 -crf 0 output.mp4For image-0001.jpg, etc:
ffmpeg -framerate 24 -i image-%04d.jpg -c:v libx264 -crf 0 output.mp4Or add a cat:
cat *.jpg | ffmpeg -framerate ntsc -i - -c:v libx264 -crf 0 output.mp4For more info see the image demuxer documentation.
1ffmpeg -r 1 -loop 1 -i image.jpg -i audio.mp3 -acodec copy -r 1 -shortest output.mp4You can also stretch resulting video/image
ffmpeg -r 1 -loop 1 -i image.jpg -i audio.mp3 -acodec copy -r 1 -shortest -vf scale=1280:720 output.mp4