Merge one audio file and one image file to create a video with ffmpeg

Stack Overflow Asked by Jerry Xiong on January 1, 2022

I first tried:

ffmpeg -y -i image.jpg -i audio.mp3 -c:a copy output.mp4

but when I uploaded to video sharing websites (, it says "no video track", so I tried:

ffmpeg -r 1 -loop 1 -i image.jpg -i audio.mp3 -acodec copy -r 1 -shortest output.mp4

The file was successfully uploaded, but when I watched it on the website, the image disappeared and it turned grey. I merged 6 videos and only one of them can be normally played back. (This is the URL to the video: click here, if you can visit the website you’ll see what I mean.)

What should I do?

One Answer

Problems with your command #2:

  • Frame rate is too low. Most players are unable to play 1 fps. Use 10 fps or higher for output, or set input -framerate to 10 fps or higher.
  • Chroma subsampling. Most players can only play 4:2:0, so use the format filter to force it to 4:2:0.
  • MP3 in MP4. Some players are unable to play MP3 in MP4. For highest compatibility use AAC. ffmpeg will choose AAC by default for MP4.
  • Faststart (optional). Add -movflags +faststart so MP4 can begin playback faster.


ffmpeg -framerate 1 -loop 1 -i image.jpg -i audio.mp3 -vf format=yuv420p -r 10 -shortest -movflags +faststart output.mp4

Answered by llogan on January 1, 2022

Add your own answers!

Related Questions

How do I debug SwiftUI AttributeGraph cycle warnings?

5  Asked on December 30, 2021 by sindre-sorhus


RTD client in Python

1  Asked on December 30, 2021 by hunk


How to remove mongo specific fields from result (NodeJS, Mongoose)

5  Asked on December 30, 2021 by ararat-harutyunyan


Problem with ionic framework How can I solve?

0  Asked on December 30, 2021 by scar-fuentes


Random Forest Output

0  Asked on December 30, 2021 by charles-biwer


How to shift range of cells to unify values in rows

2  Asked on December 30, 2021 by jozef


Ask a Question

Get help from others!

© 2023 All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP