[FFmpeg-user] '-t' versus '-to'

DEF shaker.doc at gmail.com
Sun Jan 14 05:37:35 EET 2024


On Sat, 13 Jan 2024 at 22:34, Jim DeLaHunt <list+ffmpeg-user at jdlh.com> wrote:
>
> Mark:
>
> On 2024-01-13 12:50, Mark Filipak wrote:
> > What's the difference?
> >
> > -t duration (input/output)
> >     When used as an input option (before -i), limit the duration of
> > data read from the input file.
> >     When used as an output option (before an output url),
> >     stop writing the output after its duration reaches duration.
> >     duration must be a time duration specification, see
> >     (ffmpeg-utils)the Time duration section in the ffmpeg-utils(1)
> > manual.
> >     -to and -t are mutually exclusive and -t has priority.
> >
> > -to position (input/output)
> >     Stop writing the output or reading the input at position.
> >     position must be a time duration specification, see
> >     (ffmpeg-utils)the Time duration section in the ffmpeg-utils(1)
> > manual.
> >     -to and -t are mutually exclusive and -t has priority.
> To be clear, I believe that the above two paragraphs are direct quotes
> from the FFMpeg documentation, 5.4 Main options
> <https://ffmpeg.org/ffmpeg-all.html#Main-options>.
> > 'duration' and 'position' seem to both be duration. What's the
> > difference?
>
> That is a great question. The FFMpeg documentation should be clear about
> the meanings of these parameters, and the difference between the
> meanings of the terms "duration" and "position". It is not.

I think the documentation is clear there.

Many at times one knows the duration for which they  intend to trim.
if that be the case and you are starting from 0, then -t is used. and
the _duration_ of the output video specified.

other times you want to trim, you know your start time and end time
but perhaps you are lazy to calculate the duration.
the you use -to to denote your _position_ in the video  as in

-ss 00:12:03 -to 15:04:08 for example.

DEF


>
> I do not see these terms defined outside of section 5.4. I see 95
> occurrences of the word 'position' in
> <https://ffmpeg.org/ffmpeg-all.html>. I count at least four meanings for
> this term: a moment in the timeline of a media file's events; the x,y
> coordinates of a pixel (more rigorously, the cartesian coordinates of a
> point in the two-dimensional display space); the byte offset of a piece
> of data in the data stream; and the index within a character string of a
> data field.  There are several parameters of various options and
> filters, documented by the word "position", with no explanation of the
> meaning FFMpeg assigns to the word.
>
>  > …'duration' and 'position' seem to both be duration.…
>
> You use the word 'be'. Now technical writing is difficult, and I am not
> an expert at it. But my non-expert opinion is that the English verb 'to
> be' is often a poor choice for use in technical statements. The English
> language makes 'to be' carry a wide range of meanings, so statements
> using 'to be' might be unclear.
>
> I would say, 'duration' and 'position' both take parameters having a
> syntactical format of 'time duration' as specified in the
> ffmpeg-utils(1) manual.
>
> I am also not an FFmpeg expert. The true answer to your question
> probably lies in reading the code. And the code itself may have
> multiple, conflicting answers. But I will guess that 'duration' refers
> to a portion of a media file timeline, and 'position' refers to a moment
> in the media file timeline. They are perhaps analogous to 'line segment'
> and 'point' in geometry. 'position' is perhaps that moment in the
> timeline which occurs at the given timespan after the beginning of the
> timeline, though it could be the moment which has the given time value
> relative to time zero in the timeline.
>
> Those are just my non-expert guesses. I will be interested to hear the
> correct answer(s). And I wish we could look up those answer(s) in the
> FFMpeg documentation.
>
> Good question!
>       —Jim DeLaHunt
> _______________________________________________
> 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