Opened 2 years ago

Last modified 13 months ago

#5236 new defect

concat demuxer isn't working

Reported by: ib Owned by:
Priority: normal Component: avformat
Version: git-master Keywords: concat
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no


I have a file 1.mp4 (video: h264, audio: mp3) that has a duration of 100 mins and a file second.mp4 (same video and audio). Both files play fine.

I'm trying to cut a piece from second.mp4 by

ffmpeg -ss 0:10:41.75 -i second.mp4 -filter:v scale=704x352 -c:v libx264 -c:a libmp3lame -b:a 128k -ac 2 2.mp4

(which adjusts video and audio to the 1.mp4 file as well) and then to concatenate both with

ffmpeg -f concat -i <(printf "file '$PWD/%s'\n" ./{1,2}.mp4) -c copy new.mp4

(The log for this is at

The problem is that new.mp4 only plays until the end of former 1.mp4. The following 2.mp4-part is either still picture or kinda slow motion. I think it's because of wrong timestamps because ffmpeg tells about DTS being non-monotonous or out of order.

I've figured out that splitting up everything into video and audio and rejoining it did the trick, but I doubt that is how it is supposed to work:

ffmpeg -i 1.mp4 -vn -c:a copy a1.mp3
ffmpeg -i 1.mp4 -an -c:v copy v1.mp4
ffmpeg -i 2.mp4 -vn -c:a copy a2.mp3
ffmpeg -i 2.mp4 -an -c:v copy v2.mp4
ffmpeg -f concat -i <(printf "file '$PWD/%s'\n" ./a{1,2}.mp3) -c copy a12.mp3
ffmpeg -f concat -i <(printf "file '$PWD/%s'\n" ./v{1,2}.mp4) -c copy v12.mp4
ffmpeg -i a12.mp3 -i v12.mp4 -codec copy new.mp4

I was expecting the concat filter to achive the same result.

Change History (4)

comment:1 Changed 2 years ago by ib

  • Cc added

comment:2 Changed 2 years ago by cehoyos

  • Keywords concat added

Do you want to report an issue with the concat filter or the concat demuxer?
Please provide an actual command line (without shell magic) together with the complete, uncut console output and input files that allow to reproduce the issue to make this a valid ticket.

comment:3 Changed 2 years ago by ib

  • Summary changed from concat filter isn't working to concat demuxer isn't working

Sorry, I've mixed up 'filter' and 'demuxer'. I'm talking about the demuxer.

The shell magic just creates

file '/tmp/./1.mp4'
file '/tmp/./2.mp4'

comment:4 Changed 13 months ago by richardpl

  • Component changed from undetermined to avformat
Note: See TracTickets for help on using tickets.