Reputation: 55
I need to generate a video containing a single image throughout the duration of the audio comming from an audio file. This video should be compatible with the parameters supported by YouTube.
I'm using ffmpeg.
I was trying various configurations explained right here and in other forums but not all have worked well.
I'm currently using these settings:
ffmpeg -i a.mp3 -loop 1 -i a.jpg -vcodec libx264 -preset slow -crf 20 -threads 0 -acodec copy -shortest a.mkv
Where a.mp3 containing audio, a.jpg contains the image and a.mkv is the name of the resulting video.
Using these parameters a.mkv works well on YouTube and can be played with Media Player Classic; but KMPlayer only recognizes the audio, showing a blank image as background.
My questions are two: 1 - There is something wrong that causes KMPlayer to fail? 2 - Is there any configuration that can deliver the video faster, of course losing some compression?
Muchas gracias!
Upvotes: 2
Views: 820
Reputation: 311
Try this:
ffmpeg -i a.mp3 -loop 1 -r 1 -i a.jpg -vcodec libx264 -preset ultrafast -crf 20 -threads 0 -acodec copy -shortest -r 2 a.mkv
Notable changes:
added -r 1
changed -preset slow
to -preset ultrafast
added -r 2
Upvotes: 3