[FFmpeg-user] Force target DTS == source DTS -- How?

Mark Filipak markfilipak.imdb at gmail.com
Fri Jan 12 04:18:18 EET 2024


On 1/10/24 16:50, Devin Heitmueller wrote:
> On Wed, Jan 10, 2024 at 4:26 PM Mark Filipak <markfilipak.imdb at gmail.com> wrote:
>> The change from 1048560 to 1174560 has to be happening inside the muxer, wouldn't you say? We now
>> know that what's going into the muxer is right. Here is what went to the target file in the last run:
>>
>> 0,    1170806,    1174560,     3753,   640646, 0x900a1a7a, S=1,        1
> 
> Try setting -muxdelay 0 on the output options.  If not specified it
> defaults to 0.7, and the delta between 1174560 and 1048560 is exactly
> 1.4 seconds.  I don't know why you're getting exactly 2x the mux delay
> rather than just being off by 0.7s, but I suspect it's the muxdelay
> that is causing you to get PTS values which are not what you would
> expect.
> 
> Devin
> 

When I wrote "That did it", I 'spoke' too soon. I'm still being driven nuts.
There are 4 questions at the end.
-- Mark.

set TRIM=-ss 20.061708333 -to 40.123416666
set SOURCE=h:\BDMV\STREAM\00305.m2ts
set CODE=-c copy -sn -dn
set TARGET=c:\FANNY AND ALEXANDER [1982(1983)] 1of4.mp4
ffmpeg -report %TRIM% -copyts -i %SOURCE% -map 0 %CODE% -muxdelay 0 "%TARGET%"
(The report is attached.)

___ THE INPUT M2TS (the cut is PTS=2854113)
:
0,    2839098,    2839098,     3753,    25719, 0x6f77b9b6
1,    2839920,    2839920,      960,     1084, 0xe54d2b6f
1,    2840880,    2840880,      960,     1084, 0xe54d2b6f
1,    2841840,    2841840,      960,     1084, 0xe54d2b6f
1,    2842800,    2842800,      960,     1084, 0xe54d2b6f
0,    2842852,    2842852,     3753,    22455, 0xaa9655b8
1,    2843760,    2843760,      960,     1084, 0xe54d2b6f
1,    2844720,    2844720,      960,     1084, 0xe54d2b6f
1,    2845680,    2845680,      960,     1084, 0xe54d2b6f
-cut-           +---------+
0,    2846606,  ¦ 2854113 ¦    3753,   640646, 0x3a5a0c45
1,    2846640,  +---------+     960,     1084, 0xe54d2b6f
1,    2847600,    2847600,      960,     1084, 0xe54d2b6f
1,    2848560,    2848560,      960,     1084, 0xe54d2b6f
1,    2849520,  +---------+     960,     1084, 0xe54d2b6f
0,    2850360,  ¦ 2850360 ¦    3753,   640646, 0xfed1d09a <= TO BE CUT
1,    2850480,  +---------+     960,     1084, 0xe54d2b6f
1,    2851440,    2851440,      960,     1084, 0xe54d2b6f
1,    2852400,    2852400,      960,     1084, 0xe54d2b6f
1,    2853360,    2853360,      960,     1084, 0xe54d2b6f
0,    2854113,    2861621,     3753,   640646, 0x02208727
:

___ THE OUTPUT MP4 (the cut is PTS=2854080)
1,    1492608,    1492608,      512,       60, 0xec16103f
: 50 audio packets, total
1,    1517696,    1517696,      512,     1084, 0xe54d2b6f
-cut-           +---------+
0,    2846573,  ¦ 2854080 ¦    3753,   640654, 0xb9811068
1,    1518208,  +---------+     512,     1084, 0xe54d2b6f
1,    1518720,    1518720,      512,     1084, 0xe54d2b6f
1,    1519232,    1519232,      512,     1084, 0xe54d2b6f
1,    1519744,  +---------+     512,     1084, 0xe54d2b6f
0,    2850327,  ¦ 2850327 ¦    3753,   640652, 0xbf9ad2d1 <= NOT CUT
1,    1520256,  +---------+     512,     1084, 0xe54d2b6f
1,    1520768,    1520768,      512,     1084, 0xe54d2b6f
1,    1521280,    1521280,      512,     1084, 0xe54d2b6f
1,    1521792,    1521792,      512,     1084, 0xe54d2b6f
0,    2854080,    2861588,     3753,   640652, 0x8f98895e
:

Q1: How can I force the mp4 muxer to use the existing PTSs?
Q2: Why are there 50 audio packets ahead of the -cut-?
Q3: How can I force the mp4 audio time_base to 1/90000?
Q4: Why wasn't INPUT PTS=2850360 cut off?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: FANNY AND ALEXANDER [1982(1983)] 1of4.log
Type: text/x-log
Size: 44064 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-user/attachments/20240111/1d1c941f/attachment.bin>


More information about the ffmpeg-user mailing list