Opened 4 years ago
Last modified 3 years ago
#7939 new defect
The concat demuxer changes a constant frame rate into variable one
|Reported by:||RigacciOrg||Owned by:|
|Blocking:||Reproduced by developer:||no|
|Analyzed by developer:||no|
The file "clip_mpeg2.ts" is an MPEG-2 transport stream in constant frame rate (as reported by ffprobe -show_format -show_streams):
codec_time_base=1001/60000 r_frame_rate=30000/1001 avg_frame_rate=30000/1001
If I concatenate it twice, to produce an mp4 file, I get a variable frame rate file! The concat command is:
ffmpeg -f concat -safe 0 -i clip-list.txt -c copy clip-concat.mp4
where the clip-list.txt contains just two lines with file 'clip_mpeg2.ts
In the resulting file, the codec_time_base is changed, r_frame_rate and avg_frame_rate are not exact:
codec_time_base=607/36000 r_frame_rate=179/6 avg_frame_rate=18000/607
I suspect that the source file has some bits which triggers this bug, because I was used to concatenate clips, but I never encountered this problem.
May be it is related to ticket #5380, because the input file is produced using -bsf:v h264_mp4toannexb.
If instead I use an mkv container as destination, the problem does not exist.
Change History (6)
by , 4 years ago
comment:1 by , 4 years ago
|Keywords:||h264_mp4toannexb codec_time_base avg_frame_rate removed|
Please provide the command line you tested together with the complete, uncut console output to make this a valid ticket.
by , 4 years ago
The -report produced by ffmpeg execution
comment:2 by , 3 years ago
Yeah, this does definitely happen for me too. I end up re-muxing the concatenated output with mp4box. This produces a clean CFR output.
I'm actually currently trying to find a solution for ProRes in MOV. I have the same problem with that, and mp4box doesn't like it :(
by , 3 years ago
example of concatenating 3 ProRes MOV files
comment:3 by , 3 years ago
In case anyone is struggling, I found a workaround with the shiny new version of mp4box which understands prores!
First, demux to an elementary prores stream like this
mp4box -raw 1 input.mov
(you'll get a file with an apch extension etc
Then, remux to your target frame rate like this (23.976 in my case):
mp4box -add demuxed.apch:fps=24000/1001 remux.mov
MPEG-2 transport stream causing frame rate problem with concat demuxer