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. 'duration' and 'position' seem to both be duration. What's the difference? --Mark.
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 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
On Sat, 13 Jan 2024 at 22:34, Jim DeLaHunt <list+ffmpeg-user@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@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user
To unsubscribe, visit link above, or email ffmpeg-user-request@ffmpeg.org with subject "unsubscribe".
On 1/13/2024 7:37 PM, DEF wrote:
other times you want to trim, you know your start time and end time but perhaps you are lazy to calculate the duration.
Or don't see a need because you know the points :), AFAICT most human editors work that way.
the you use -to to denote your_position_ in the video as in
-ss 00:12:03 -to 15:04:08 for example.
Brings another question- if you want to select 15 seconds and no additional frames starting at 00:00:03.0 do you give the out point as 00:00:18.0 or :17.999 or :17.29 (for a frame count, not a fraction of a second)? I suspect .999 will do the job, but it's cumbersome and not as simple to calculate. (I prefer frame numbers, myself.) Later, z! in the land of 29.97
On 13/01/2024 22.57, Carl Zwanzig wrote:
On 1/13/2024 7:37 PM, DEF wrote:
...other times you want to trim,.. ...(I prefer frame numbers, myself.)
I wholeheartedly agree with you, Carl. For example: -ss 20.061708 -to 5570.815250 would be -frametrim 481..134046 meaning frame 481 thru frame 134046. Since it specifies the starting and ending frames, time is not an issue and duration is explicit. Trimming the audio, subtitles, and chapter list would be automatic and based on those frames. --Mark.
On 1/13/2024 10:26 PM, Mark Filipak wrote:
For example: -ss 20.061708 -to 5570.815250 would be -frametrim 481..134046 meaning frame 481 thru frame 134046.
Although IME it much more common to specify the frame number after a dot* but ffmpeg doesn't seem to do that. (There may be North American vs Europe vs Asiatic regional conventions on this.) *hh:mm:ss.ff, or occasionally hh:mm:ss:ff, but the latter is ambiguous if either hh or ff are omitted Perhaps some day I'll look at the command arg time parser to see what assumptions are made and where they're documented. z!
On 14 Jan 2024, at 21:22, Carl Zwanzig <cpz@tuunq.com> wrote:
On 1/13/2024 10:26 PM, Mark Filipak wrote:
For example: -ss 20.061708 -to 5570.815250 would be -frametrim 481..134046 meaning frame 481 thru frame 134046.
Although IME it much more common to specify the frame number after a dot* but ffmpeg doesn't seem to do that. (There may be North American vs Europe vs Asiatic regional conventions on this.)
*hh:mm:ss.ff, or occasionally hh:mm:ss:ff, but the latter is ambiguous if either hh or ff are omitted
Perhaps some day I'll look at the command arg time parser to see what assumptions are made and where they're documented.
Don’t feed the trolls. Bouke
PS: Actually, I think '-framespan' would be a better name for such a function. -framespan 481..134046 On 13/01/2024 22.57, Carl Zwanzig wrote:
On 1/13/2024 7:37 PM, DEF wrote:
...other times you want to trim,.. ...(I prefer frame numbers, myself.)
I wholeheartedly agree with you, Carl. For example: -ss 20.061708 -to 5570.815250 would be -frametrim 481..134046 meaning frame 481 thru frame 134046. Since it specifies the starting and ending frames, time is not an issue and duration is explicit. Trimming the audio, subtitles, and chapter list would be automatic and based on those frames. --Mark.
participants (5)
-
Bouke / edit 'B -
Carl Zwanzig -
DEF -
Jim DeLaHunt -
Mark Filipak