Converting large number of MP3 files to videos for YouTube, each using same JPG
Looking for a way to convert large number of mp3 files to videos each using the same image. Efficient processing time is important.
ffmpeg -i image.jpg -i audio.mp3 -vcodec libx264 video.mp4
VLC played the resulting video file with the correct sound, but blank screen. Microsoft Media Player played the sound and showed the intended image. Uploaded the video to YouTube and received mesage "The video has failed to process. Please make sure you are uploading a supported file type."
Would appreciate advice on how to make this work.
ffmpeg -framerate 6 -loop 1 -i input.jpg -c:v libx264 -vf format=yuv420p -t 00:10:00 video.mp4
The duration (
-t) should be ≥ the MP3 with the longest duration.
Now stream copy the same video for each MP3:
ffmpeg -i video.mp4 -i audio.mp3 -map 0:v -map 1:a -c copy -movflags +faststart -shortest output.mp4
Some notes regarding compatibility:
- MP3 in MP4 does not have universal support, but will be fine in YouTube. If your target players do not like it then add
-c copyto output AAC audio.
- If your target player does not like it then increase the
-frameratevalue or add the
-routput option with an appropriate value, such as
-r 15. Again, YouTube should be able to handle it.