1

I am using the concat demuxer in ffmpeg. I use the following command:

ffmpeg -f concat -i concat.txt -c copy out.mkv

and it works, except that it adds short gaps of black frames in between the concatenated files (there are three of them). How do I make it stop? If it helps, the audio is cut at those points, too.

I know that a parameter for this exists, but I can't find the original question anywhere.

Thanks in advance.

  • 1
    Share the results of ffprobe input for all three files and also the content of concat.txt – Gyan Apr 4 '18 at 5:19
1

This can happen if the "streams do not have exactly the same length". You have to specify the range to include for the items in concat.txt. Try specifying the duration or outpoint or in point:

https://ffmpeg.org/ffmpeg-formats.html#concat

The duration of each file is used to adjust the timestamps of the next file: if the duration is incorrect (because it was computed using the bit-rate or because the file is truncated, for example), it can cause artifacts. The duration directive can be used to override the duration stored in each file.

  • From the Q - in between the concatenated files - so not within the files. – Gyan Apr 4 '18 at 5:18
  • Don't use duration - it is meant to override the value the concat demuxer uses for calculation, not for trimming -use. outpoint for that. – Gyan Apr 4 '18 at 11:22

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.