really struggling with ffmpeg at the moment, after a few days of messing about with it i have managed to get it to almost do what i want!

I have an audio track and a series of images that are to be converted into a slideshow displaying each image for 5 seconds.

-r 1/5 -i C:\ffmpeg\image-%02d.bmp -i C:\ffmpeg\music.mp3 -qscale:v 2 -shortest -codec:a copy C:\ffmpeg\output.flv

I can get this to work as a flv but not as any other format. I need to have it in either an mp4, avi, wmv, or mov format.

I can convert this to a wmv but the file size is HUGE (about 100meg/min)!

 -i C:\ffmpeg\output.flv -vcodec wmv1 -acodec adpcm_ima_wav  C:\ffmpeg\output.wmv

Can anyone please help me either:

  • output the original code to mp4,wmv,mov,or avi (with a reasonable file size ideally less than 10 meg per min)
  • convert the flv to either an mp4,wmv,mov, or avi with again a reasonable file size)



This will create an mp4 file containing H.264 video and AAC-LC audio:

ffmpeg -r 1/5 -i C:\ffmpeg\image-%02d.bmp -i C:\ffmpeg\music.mp3 -shortest -pix_fmt yuv420p -codec:v libx264 -b:v 1200k -codec:a libfdk_aac C:\ffmpeg\output.mp4

This requires that your ffmpeg was configured to support the libx264 H.264 encoder and the libfdk_aac AAC-LC encoder.

A video bitrate of 1200 kb/s (-b:v 1200k), when combined with the audio, should be about 10 MB/min. See the ffmpeg x264 encoding guide for some other ways to control the video bitrate.

If you don't have the libfdk_aac encoder you could instead use the built-in experimental AAC encoder (replace -codec:a libfdk_aac with -codec:a aac -strict experimental) or another AAC encoder. Or you could use the original mp3 audio (-codec:a copy), although mp3 audio is not as common in an mp4 container so your player may not support that.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.