How to create a video from still images using FFmpeg?

I have an audio file in mp3 format and image and I want to create a video file that plays the audio and shows the still image as video. Is there any option in FFmpeg which can help me to create the video?

1 Like

Lvan!
What’s the format of the image?

Oh! I forgot to mention that in the question, but it’s a png image.

Hey Lvan!

Creating video files from still-image and audio files is very easy. You just have to use -loop option and -tune still image options provided by FFmpeg with your input image and audio file and provide codec details with which you want your video to be encoded.

Consider the following FFmpeg for example.

ffmpeg -loop 1 -i image.jpg -i audio.mp3 -c:v libx264 -tune -c:a aac -b:a 192k -pix_fmt yuv420p -shortest output.mp4

Thanks, Karan!

But, this command does not work for me any other option?
I noticed that something was missing!

Yes, this command is incomplete, here is the correct one:
Try:
ffmpeg -loop 1 -i image.jpg -i audio.mp3 -c:v libx264 -tune stillimage -c:a aac -b:a 192k -pix_fmt yuv420p -shortest output.mp4