[FFmpeg-user] Why are these different?

Mark Filipak markfilipak.imdb at gmail.com
Thu Feb 8 00:19:01 EET 2024

On 07/02/2024 16.53, Paul B Mahol wrote:
> On Wed, Feb 7, 2024 at 10:28 PM Mark Filipak <markfilipak.imdb at gmail.com>
> wrote:
>> Hi Carl,
>> On 07/02/2024 13.56, Carl Zwanzig wrote:
>>> On 2/7/2024 10:34 AM, Mark Filipak wrote:
>>>> Okay. Why are they different?
>>> Because the containers are different? An mp4 container is not the same
>> as an mkv (or avi or mpeg),
>>> they must have different demuxers.
>> They are the same source, same container. The only difference is command.
>> ffmpeg -ss 20.061708333 -copyts -i %SOURCE% -map 0 -c copy -sn -dn
>> -muxdelay 0 %TARGET%
>> ffmpeg -copyts -i %SOURCE% -map 0 -ss 20.061708333 -c copy -sn -dn
>> -muxdelay 0 %TARGET%
>> Why do the results differ? They're not a little different. They're very
>> different. The DTSs differ.
>> The PTSs differ. The cutting points differ by a couple hundred frames.
>> Even some of the packet
>> lengths differ! This is serious.
>> I can't tell if the GOPs differ -- DTS-sorted v PTS-sorted -- because it's
>> impossible to correlate
>> 'framecrc' results and 'showinfo' results.
> use -v debug
> One of them IIRC uses trim filters for seeking....

I will try. Thank you.

They are both trimming, just at differing points.
They are both cutting off hundreds of leading audio packets but they are both leaving leading audio 
packets, 52 for one and 54 for the other, that should be cut off.
In the first, the cut-point I-frame immediately follows the not-cut-off audio packets, but in the 
other, the correct cut-point I-frame is hundreds of video frames later.
They both are leaving other audio packets that come after the cut point but have lower PTSs.
They both leave the 'next' B-frame (which should be cut off) as though they're working on DTS-order 
instead of PTS-order.

I think there are bugs in the frame reordering _and_ in video v audio packet handling when cutting 
_and_ in the '-ss' handling.

I moved the location of '-ss' on a lark just to see if putting it after '-i' would produce better 
results; the results were worse.

More information about the ffmpeg-user mailing list