Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to create a video from an image sequence and add audio with FFMPEG

The frame sequence is only 25 frames long but the audio is several minutes. I want FFMPEG to clip the audio to the length of the frame sequence.

This is the command I have tried:

ffmpeg -i input_images%04d.jpg -pix_fmt yuv420p -vcodec mjpeg -qmin 1 -qmax 1 -r 25 -i audio_file.mp3 -ar 22050 -ab 192k -aframes 25

This results in a video with the first image sequence but the full length audio. -aframes is ignored. Any ideas?

share|improve this question
up vote 4 down vote accepted

From FFmpeg doc

ffmpeg -i in%04d.jpg -i in.mp3 -shortest

Finish encoding when the shortest input stream ends.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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