[FFmpeg-user] Questions about `-to` parameter

Vincent Deconinck vdeconinck at gmail.com
Fri Nov 15 11:55:39 EET 2024


>
> I look up the ffmpeg document


You have probably missed the part of https://trac.ffmpeg.org/wiki/Seeking that
says 'Note when "-ss" used before "-i" only: ("-ss" as input option) the
timestamps will be reset according to 0.͏ So "-t" and "-to" shall be the
same.' :-)

[Q1] Is this really intentional? If it is, can anyone share the thought of
> this design?
>

There is a logic, at least.
Think "-ss before -i" as two separate ffmpeg operations:
1 : create a new file without the start
2 : truncate the new file at a certain time
Operation 2 has no idea what the original file was, as an "input seeking"
(step1) was applied before, so it doesn't know how much was removed.


> [Q2] Is there a way to make the second command works like the first
> command?
>

Not that I know of.
You should just compute the desired duration (as end-start) before calling
ffmpeg, and I suggest you use -t instead of -to in that case. They behave
the same and that removes any ambiguity for the reader.

Vincent


More information about the ffmpeg-user mailing list