Creating a video from a single image and an audio file

If you try to upload to youtube an audio file you recorded using your smartphone it will not accept because it is not a video. Then the solution is “converting” this audio in video, you can do it using a still image file as backgroung.

I used this command to do that:

$ ffmpeg -loop 1 -shortest -y -i imade.jpg -i audio.3gp -acodec copy -vcodec mjpeg result_video.avi

UPDATE: I was getting this error: Option shortest (finish encoding within shortest input) cannot be applied to input file audio.3gp — you are trying to apply an input option to an output file or vice versa. Move this option before the file it belongs to. Error parsing options for input file audio.3gpp.
I fixed it moving “-shortest” the right, just before result_video.avi.
UPDATE 2: mjpeg generate big files, use “libx264” instead and the fps was higher (more than 150 fps) using “-r 1” fixed the issue, now the complete command is:

$ ffmpeg -loop 1 -y -i meeting.jpg -i audio.3gp -acodec copy -vcodec libx264 -r 1 -shortest result_video.avi

You can find more information about similar commands here:

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s