[FFmpeg-user] '-bsf setts=dts' has problems

Mark Filipak markfilipak.imdb at gmail.com
Sat Jun 8 09:36:03 EEST 2024


'-bsf setts=pts' seems to always work, but '-bsf setts=dts' has problems. Look:

C:\Windows\System32>ffmpeg -copyts -i "g:\FANNY AND ALEXANDER [1982(1983)]\00305.m2ts" -map 0
-bsf noise=drop='lt(pts\,2854113)'
-c copy -sn -dn -muxdelay 0 "g:\FANNY AND ALEXANDER [1982(1983)]\foo.m2ts"
0,    2846606,    2854113,     3753,   640646, 0x3a5a0c45, S=1,        1
0,    2854113,    2861621,     3753,   640646, 0x02208727, F=0x0, S=1,        1

C:\Windows\System32>ffmpeg -copyts -i "g:\FANNY AND ALEXANDER [1982(1983)]\00305.m2ts" -map 0
-bsf noise=drop='lt(pts\,2854113)',setts=dts='if(eq(DTS\,2846606)\,2850360\,DTS)'
-c copy -sn -dn -muxdelay 0 "g:\FANNY AND ALEXANDER [1982(1983)]\foo.m2ts"
The command provokes this: "Invalid DTS: 2850360 PTS: 2846606, replacing by guess"
0,    2846606,    2846606,     3753,   640646, 0x3a5a0c45, S=1,        1
0,    2854113,    2854113,     3753,   640646, 0x02208727, F=0x0, S=1,        1
There is nothing invalid with DTS: 2850360 if PTS is 2854113, but FFmpeg appears to change PTS on 
it's own, without a command to do it.

The second command should not change PTSes, but it does. In fact, all frame PTSes are being set to 
their DTSes.

I have documented a litany of DTS problems now. Are they being taken seriously?

This is unrelated to my investigation of splices and my search for a workaround because of FFmpeg's 
inability to set MPEG tag 'closed_gop' to '1'. Or maybe it is related, I have no way to know.

Will someone please work with me so I can share the source with them so they can verify what I'm 
seeing? I cannot continue to work alone on this. It's just too nerve wracking.

--Mark.


More information about the ffmpeg-user mailing list