Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have an image sequence of 5,664 .tga images which are to be played at 24fps (so 236 seconds) and an audio ac3 file which I edited to be exactly 236 seconds (plus minus 0.01s) in length.

I used the following ffmpeg command to mix them into a .mpg file:

ffmpeg -i music.ac3 -i o%04d.tga -r 24 -sameq a.mpg

The audio played for the full 236 seconds; however the video finished at only 226 seconds, holding the final frame for the last 10s of audio.

Why is ffmpeg shortening my image sequence playback by 10s, and how can I get it to run for the full time?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

The console output (you should always include this) probably shows that the input is being read at 25 fps. This is the default behavior unless you tell it otherwise. Your -r 24 is being applied to the output and I'm guessing this may be causing your problem. Move -r 24 as an input option so it's before -i o%04d.tga. The output will then inherit this frame rate. Another option to consider is -shortest and will finish encoding within the shortest input (either the audio or video).

Also, -sameq is not a recommended option. It does not mean "same quality". Use -qscale instead. The full range is 1-31, but try values between 2-5. Generally you use the highest value that still looks good to you. See this FFmpeg tutorial for more information and examples.

share|improve this answer

Your Answer

 
discard

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.