[FFmpeg-user] Why are these different?

Paul B Mahol onemda at gmail.com
Mon Feb 12 00:39:03 EET 2024


On Sun, Feb 11, 2024 at 11:08 PM Mark Filipak <markfilipak.imdb at gmail.com>
wrote:

> On 11/02/2024 16.42, Paul B Mahol wrote:
> > Codec copy with -ss before -i and after -i is not documented that it
> gives
> > different results
>
> Does that make sense? I think it's not documented because no one knows how
> to explain the results.
>

It is self explanatory.


>
> > because once you do not decode everything from start you basically can
> not
> > expect to get
> > always (for any container and for any input) frame-accurate results in
> both
> > cases.
>
> I don't think decoding is being done. The cutting/trimming can be by
> dropping packets & remuxing.
> The packets have to be 'opened' to read the PTSs, but I don't think
> there's actual decoding.
>

Packets here are just demuxed, not decoded. So -c copy will demux, so
sample accurate audio seeking is not possible.



>
> '-ss'-before-'-i' is cutting at the right point.
>

That one actually seeks without demuxing each packet from start.


> '-i'-before-'-ss' is cutting at the wrong point.
>

This one does not seek at all, it just demux from start and drops packets
up to certain point.

For -c copy, that one demuxes from start (without any seeking, but just
skipping packets processing) but gives output only after timeline point.
Which is kind of logical because it does not decode at all. And for complex
codec that have different forward/backward frame predictions it will give
incorrect results because PTS may not match DTS - presentation timestamp vs
demux timestamp.

So for '-c copy'  -ss after -i is mostly not useful, exp. for complex
video/audio codecs with complex interframe coding.


> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".
>


More information about the ffmpeg-user mailing list