

The only attributes you have to specify are the input filenames, the output codecs, and the output filename (which eo ipso includes the output container, ). ffmpeg -i still.png -i narrate.wav -acodec libvo_aacenc -vcodec libx264 final.flv FFmpeg is a lot smarter than you give it credit for-it knows you want the video to be the same length as your audio track. You're making it way harder than it has to be. Also I set the resolution to 720p here, which means you should get HD audio on YouTube :-)

If you do this correctly, there should only be one frame per second of video, which means it encodes relatively fast. If you change the order of these parameters, the results are dramatically different.įfmpeg -r 1 -loop 1 -i ep1.jpg -i ep1.wav -acodec copy -r 1 -shortest -vf scale=1280:720 ep1.flvĪlso notice that I set the frame rate twice, that's not an accident-the first frame rate is for the input, second is for the output.

(It stops at the end of the shortest stream, which is the audio, because the image loop is infinite.) The order of your options is very important for speed, as filters (and such) are processed in the order you specify. Also, I added -acodec copy to preserve the audio quality. The solution I found to make YouTube happy: add more frames. Update: I noticed YouTube has difficulty processing the video (gets stuck at 95%) I think because there's only one frame. I've googled around and found a dozen of proposed solutions (supposedly to this very same question) none of which works.Ĭan anybody suggest a working command and explain the rationale behind it?įFmpeg will try to pick the best codec automatically, depending on the extension of your output file.

I tried: ffmpeg -i image8.jpg -i sound11.amr -acodec copy test.aviĪnd tried a lot of combinations with and without -s 640x360, -loop_input, -shortest, -t xxx, -r 0.1 (artificially low frame rate in the hope that the video would be longer) and -f image2Įither I get errors or I get a video file of the duration of one frame. What is the right command line that would do that? copy the audio stream without transcoding it). I don't care very much about what video codec is used for output, but it is vital that I can use "copy" as the audio codec (i.e. I want FFmpeg to take one JPEG image and an audio file as input and generate a video file of the same duration as the audio file (by stretching the still image for the whole duration). This should be pretty trivial, but I can't find a way to get it to work.
