The order of options in the command line matters. The following works for my case:
ffmpeg -loop 1 -shortest -y -i image8.jpg -i sound11.amr -acodec copy \
-vcodec mjpeg result.avi
In a more general case, where image.jpg
and audio.wav
are your input, you can use the following command, adapted from the FFmpeg wiki:
ffmpeg -loop 1 -shortest -f image2 -i image.jpg -i audio.wav \
-c:v libx264 -tune stillimage -c:a aac -strict experimental -b:a 192k out.mp4
This would use the libx264
encoder and provide you with better compression than the MJPEG codec used above. The audio is AAC, with the built-in ffmpeg
AAC encoder.