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

2024-01-13 Thread Mark Filipak

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.

___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


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

2024-01-13 Thread Mark Filipak

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.

___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] cutting mp4 with ffmpeg

2024-01-13 Thread Mark Filipak

This is not the way to do things, Andrew.

Please do not add your notice of a trac ticket submission to my reply. It has nothing to do with my 
reply.


Your ticket has justifiably been closed.

Trac is not a place to get extra help. It is for bug reporting. Instead to a trac ticket, post your 
concerns here and try to gain help/confirmation/clarification here.


--Mark.

On 13/01/2024 22.11, Andrew Randrianasulu wrote:

On Sat, Jan 13, 2024 at 10:27 PM Mark Filipak
 wrote:


On 13/01/2024 12.50, Andrew Randrianasulu wrote:

On Sat, Jan 13, 2024 at 8:57 PM Def Etienne  wrote:

-snip-

ffmpeg -i ~/6029.mp4  -copyts  c:v copy -c:acopy -t 64.600 dev/shm/6029_cut.mp4


According to Devon Heitmueller -- thanks again, Devon -- '-copyts' and 
'-muxdelay 0' are _both_ needed.

'-copyts' -- before the input -- bypasses a routine that apparently is named 
"tsfixup".

'-muxdelay 0' -- after the input -- bypasses another ts fixup that defaults to 
adding 0.7 seconds to
the timestamps.

Exactly why ffmpeg does those fixups is a mystery.

I can confirm that when cutting off the beginning:
ffmpeg -copyts -ss ... -i ... -c copy -muxdelay 0 ...
works. It preserves the timestamps (DTS, PTS).


Regarding cutting off the ending:
ffmpeg -to ... -i ... -c copy ...
I am trying to determine the behavior of '-to'. Is it PTS? Or is it ticks 
(i.e., duration in
timebase units)? And does ffmpeg do fixups for '-to' clauses, also? It appears 
there are such '-to'
fixups.


Also be aware that MPV rounds time, and rounds to milliseconds whereas ffmpeg 
truncates time and
truncates frame numbers, DTSs, and PTSs. So times from MPV may miss an I-frame 
in ffmpeg. What I do
is use MPV times to find approximate frame number. Then I use '-vf showinfo' to 
find exact frame
number. Then I compute exact DTS and exact PTS from exact frame number. Then I 
convert DTS and PTS
to nanoseconds in the '-ss' clause.


I added ticket about ffprobe/vf_showinfo displaying truncated duration:

https://trac.ffmpeg.org/ticket/10799#ticket




Why does 'ffmpeg -ss' use times instead of relative timebase ticks (i.e. 
durations) or absolute DTSs
and PTSs? Your guess is as good as mine, but it is a super PITA.

Why does ffmpeg apply ts fixups? Your guess is as good as mine, but it is a 
super PITA.


Also, be aware that in this listing:


[Parsed_showinfo_0 @ 0xee202580] n:1612 pts:5803200 ...


the reported PTS is _not_ PTS. It is ticks (i.e., duration in timebase units) that is 
marked "pts"
but isn't -- another super PITA.


Also, remuxing from M2TS to MP4 for example, applies more unknown fixups even 
when they have the
exact same timebase -- another super PITA -- so don't change packet type until 
the very end of your
timming and concatenating.

--Mark.



___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] cutting mp4 with ffmpeg

2024-01-13 Thread Mark Filipak

On 13/01/2024 22.58, Andrew Randrianasulu wrote:

вс, 14 янв. 2024 г., 06:51 Mark Filipak :


On 13/01/2024 22.11, Andrew Randrianasulu wrote:
-snip-

I added ticket about ffprobe/vf_showinfo displaying truncated duration:

https://trac.ffmpeg.org/ticket/10799#ticket


Andrew, please remove that ticket. It is too early.



This is ONLY about duration field in ffprobe/vf_showtime truncating time to
N.xx instead of N.xxx

hopefully just two printf arguments somewhere.

Actual cutting problems are not yet logged.


I would like everyone to know that this is not my thread and I'm not responsible for Andrew's trac 
ticket.


--Mark.

___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] cutting mp4 with ffmpeg

2024-01-13 Thread Andrew Randrianasulu
вс, 14 янв. 2024 г., 06:51 Mark Filipak :

> On 13/01/2024 22.11, Andrew Randrianasulu wrote:
> -snip-
> > I added ticket about ffprobe/vf_showinfo displaying truncated duration:
> >
> > https://trac.ffmpeg.org/ticket/10799#ticket
>
> Andrew, please remove that ticket. It is too early.
>

This is ONLY about duration field in ffprobe/vf_showtime truncating time to
N.xx instead of N.xxx

hopefully just two printf arguments somewhere.

Actual cutting problems are not yet logged.


> Your "How to reproduce" command line is incomplete and it doesn't include
> '-muxdelay 0'.
>

Does it magically enlarge ffprobe/vf_showtime output ? :)


> Your ticket cites other applications as though they are authoritative.
>

More as example of time format.


> The end result of your ticket will be to sour the milk for my work.
>

Do not panic! There are enough bugs for everyone :)


> --Mark.
>
>
> ___
> ffmpeg-user mailing list
> ffmpeg-user@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
>
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


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

2024-01-13 Thread Carl Zwanzig

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
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] cutting mp4 with ffmpeg

2024-01-13 Thread Mark Filipak

On 13/01/2024 22.11, Andrew Randrianasulu wrote:
-snip-

I added ticket about ffprobe/vf_showinfo displaying truncated duration:

https://trac.ffmpeg.org/ticket/10799#ticket


Andrew, please remove that ticket. It is too early.

Your "How to reproduce" command line is incomplete and it doesn't include 
'-muxdelay 0'.

Your ticket cites other applications as though they are authoritative.

The end result of your ticket will be to sour the milk for my work.

--Mark.


___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


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

2024-01-13 Thread DEF
On Sat, 13 Jan 2024 at 22:34, Jim DeLaHunt  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
> .
> > '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
> . 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-requ...@ffmpeg.org with subject "unsubscribe".
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] cutting mp4 with ffmpeg

2024-01-13 Thread Andrew Randrianasulu
On Sat, Jan 13, 2024 at 10:27 PM Mark Filipak
 wrote:
>
> On 13/01/2024 12.50, Andrew Randrianasulu wrote:
> > On Sat, Jan 13, 2024 at 8:57 PM Def Etienne  wrote:
> -snip-
> >> ffmpeg -i ~/6029.mp4  -copyts  c:v copy -c:acopy -t 64.600 
> >> dev/shm/6029_cut.mp4
>
> According to Devon Heitmueller -- thanks again, Devon -- '-copyts' and 
> '-muxdelay 0' are _both_ needed.
>
> '-copyts' -- before the input -- bypasses a routine that apparently is named 
> "tsfixup".
>
> '-muxdelay 0' -- after the input -- bypasses another ts fixup that defaults 
> to adding 0.7 seconds to
> the timestamps.
>
> Exactly why ffmpeg does those fixups is a mystery.
>
> I can confirm that when cutting off the beginning:
> ffmpeg -copyts -ss ... -i ... -c copy -muxdelay 0 ...
> works. It preserves the timestamps (DTS, PTS).
>
>
> Regarding cutting off the ending:
> ffmpeg -to ... -i ... -c copy ...
> I am trying to determine the behavior of '-to'. Is it PTS? Or is it ticks 
> (i.e., duration in
> timebase units)? And does ffmpeg do fixups for '-to' clauses, also? It 
> appears there are such '-to'
> fixups.
>
>
> Also be aware that MPV rounds time, and rounds to milliseconds whereas ffmpeg 
> truncates time and
> truncates frame numbers, DTSs, and PTSs. So times from MPV may miss an 
> I-frame in ffmpeg. What I do
> is use MPV times to find approximate frame number. Then I use '-vf showinfo' 
> to find exact frame
> number. Then I compute exact DTS and exact PTS from exact frame number. Then 
> I convert DTS and PTS
> to nanoseconds in the '-ss' clause.

I added ticket about ffprobe/vf_showinfo displaying truncated duration:

https://trac.ffmpeg.org/ticket/10799#ticket


>
> Why does 'ffmpeg -ss' use times instead of relative timebase ticks (i.e. 
> durations) or absolute DTSs
> and PTSs? Your guess is as good as mine, but it is a super PITA.
>
> Why does ffmpeg apply ts fixups? Your guess is as good as mine, but it is a 
> super PITA.
>
>
> Also, be aware that in this listing:
>
> > [Parsed_showinfo_0 @ 0xee202580] n:1612 pts:5803200 ...
>
> the reported PTS is _not_ PTS. It is ticks (i.e., duration in timebase units) 
> that is marked "pts"
> but isn't -- another super PITA.
>
>
> Also, remuxing from M2TS to MP4 for example, applies more unknown fixups even 
> when they have the
> exact same timebase -- another super PITA -- so don't change packet type 
> until the very end of your
> timming and concatenating.
>
> --Mark.
>
> ___
> ffmpeg-user mailing list
> ffmpeg-user@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


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

2024-01-13 Thread Jim DeLaHunt

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 
.
'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 
. 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-requ...@ffmpeg.org with subject "unsubscribe".


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

2024-01-13 Thread Mark Filipak

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.
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] cutting mp4 with ffmpeg

2024-01-13 Thread Mark Filipak

On 13/01/2024 13.22, DEF wrote:


As long as you are not encoding the video, ffmpeg will cut at the
nearest iframes.


That appears to be not true. ffmpeg appears to cut at the next frame, not the 
nearest frame.


If you are particular then you need to re-encode the video.


That is not true.


avoid using "-to" in the place of "-t" like i explained.


I missed that. Would you care to explain it again. I'd really like to know.


if you must not reencode and you want to use copyts then you must add
the option
"-avoid_negative_ts make_zero"  after your copyts.


I don't think that's a good idea.

--Mark.

___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] cutting mp4 with ffmpeg

2024-01-13 Thread Mark Filipak

On 13/01/2024 12.50, Andrew Randrianasulu wrote:

On Sat, Jan 13, 2024 at 8:57 PM Def Etienne  wrote:

-snip-

ffmpeg -i ~/6029.mp4  -copyts  c:v copy -c:acopy -t 64.600 dev/shm/6029_cut.mp4


According to Devon Heitmueller -- thanks again, Devon -- '-copyts' and 
'-muxdelay 0' are _both_ needed.

'-copyts' -- before the input -- bypasses a routine that apparently is named 
"tsfixup".

'-muxdelay 0' -- after the input -- bypasses another ts fixup that defaults to adding 0.7 seconds to 
the timestamps.


Exactly why ffmpeg does those fixups is a mystery.

I can confirm that when cutting off the beginning:
ffmpeg -copyts -ss ... -i ... -c copy -muxdelay 0 ...
works. It preserves the timestamps (DTS, PTS).


Regarding cutting off the ending:
ffmpeg -to ... -i ... -c copy ...
I am trying to determine the behavior of '-to'. Is it PTS? Or is it ticks (i.e., duration in 
timebase units)? And does ffmpeg do fixups for '-to' clauses, also? It appears there are such '-to' 
fixups.



Also be aware that MPV rounds time, and rounds to milliseconds whereas ffmpeg truncates time and 
truncates frame numbers, DTSs, and PTSs. So times from MPV may miss an I-frame in ffmpeg. What I do 
is use MPV times to find approximate frame number. Then I use '-vf showinfo' to find exact frame 
number. Then I compute exact DTS and exact PTS from exact frame number. Then I convert DTS and PTS 
to nanoseconds in the '-ss' clause.


Why does 'ffmpeg -ss' use times instead of relative timebase ticks (i.e. durations) or absolute DTSs 
and PTSs? Your guess is as good as mine, but it is a super PITA.


Why does ffmpeg apply ts fixups? Your guess is as good as mine, but it is a 
super PITA.


Also, be aware that in this listing:


[Parsed_showinfo_0 @ 0xee202580] n:1612 pts:5803200 ...


the reported PTS is _not_ PTS. It is ticks (i.e., duration in timebase units) that is marked "pts" 
but isn't -- another super PITA.



Also, remuxing from M2TS to MP4 for example, applies more unknown fixups even when they have the 
exact same timebase -- another super PITA -- so don't change packet type until the very end of your 
timming and concatenating.


--Mark.

___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] cutting mp4 with ffmpeg

2024-01-13 Thread Andrew Randrianasulu
On Sat, Jan 13, 2024 at 9:22 PM DEF  wrote:
>
> On Sat, 13 Jan 2024 at 19:09, Andrew Randrianasulu
>  wrote:
> >
>
> >
> > also
> >
> > /dev/shm/ffmpeg/ffmpeg -i /dev/shm/6029_cut_2.mp4 -vf showinfo -f null
> > /dev/null
> >
> > last lines were
> >
> > [Parsed_showinfo_0 @ 0xee202580] n:1612 pts:5803200 pts_time:64.48
> > duration:  0 duration_time:0   fmt:yuv420p cl:left sar:0/1
> > s:720x400 i:P iskey:0 type:B checksum:498D7D18
> > plane_checksum:[7C011A9A 72D078F0 1749E97F] mean:[84 158 80]
> > stdev:[10.1 3.4 8.2]
> > [Parsed_showinfo_0 @ 0xee202580] color_range:tv color_space:smpte170m
> > color_primaries:smpte170m color_trc:bt709
> > [Parsed_showinfo_0 @ 0xee202580] n:1613 pts:5806800 pts_time:64.52
> > duration:  0 duration_time:0   fmt:yuv420p cl:left sar:0/1
> > s:720x400 i:P iskey:0 type:B checksum:FB6C528A
> > plane_checksum:[BC0C2674 7A2A71F8 E2E7BA0F] mean:[84 158 80]
> > stdev:[10.1 3.3 8.1]
> > [Parsed_showinfo_0 @ 0xee202580] color_range:tv color_space:smpte170m
> > color_primaries:smpte170m color_trc:bt709
> > [Parsed_showinfo_0 @ 0xee202580] n:1614 pts:5810400 pts_time:64.56
> > duration:  0 duration_time:0   fmt:yuv420p cl:left sar:0/1
> > s:720x400 i:P iskey:0 type:P checksum:32E560F5
> > plane_checksum:[237A0A01 F76B8D20 1D72C9C5] mean:[84 158 80]
> > stdev:[10.1 3.2 8.0]
> > [Parsed_showinfo_0 @ 0xee202580] color_range:tv color_space:smpte170m
> > color_primaries:smpte170m color_trc:bt709
> > [Parsed_showinfo_0 @ 0xee202580] n:1615 pts:5814000 pts_time:64.6
> > duration:  0 duration_time:0   fmt:yuv420p cl:left sar:0/1
> > s:720x400 i:P iskey:1 type:I checksum:C9E56CD5
> > plane_checksum:[1254795B 75287B1F 720B784C] mean:[83 158 80]
> > stdev:[10.1 3.0 7.8]
> > [Parsed_showinfo_0 @ 0xee202580] color_range:tv color_space:smpte170m
> > color_primaries:smpte170m color_trc:bt709
> > [Parsed_showinfo_0 @ 0xee202580] n:1616 pts:5828400 pts_time:64.76
> > duration:  0 duration_time:0   fmt:yuv420p cl:left sar:0/1
> > s:720x400 i:P iskey:0 type:P checksum:07418607
> > plane_checksum:[A672B48D A7D7BD5B 3D4D1410] mean:[83 158 79]
> > stdev:[9.7 2.3 7.0]
> > [Parsed_showinfo_0 @ 0xee202580] color_range:tv color_space:smpte170m
> > color_primaries:smpte170m color_trc:bt709
> > [out#0/null @ 0xbf59800] video:543kB audio:12112kB subtitle:0kB other
> > streams:0kB global headers:0kB muxing overhead: unknown
> > frame= 1617 fps=493 q=-0.0 Lsize=N/A time=00:01:04.61 bitrate=N/A 
> > speed=19.7x
> >
> >
> > doesn't this mean ffmpeg cut one frame too much ?
>
> Yes it will and it could.
> As long as you are not encoding the video, ffmpeg will cut at the
> nearest iframes.
> If you are particular then you need to re-encode the video.
>
> /dev/shm/ffmpeg/ffmpeg -i ~/6029.mp4   -c:v libx264 -c:a pcm_s16le
> -t 64.600 /dev/shm/6029_cut_2.mp4
>
> avoid using "-to" in the place of "-t" like i explained.
>
> if you must not reencode and you want to use copyts then you must add
> the option
> "-avoid_negative_ts make_zero"  after your copyts.

bash-5.1$ /dev/shm/ffmpeg/ffmpeg -i ~/6029.mp4  -copyts
-avoid_negative_ts make_zero -c:v copy -c:a pcm_s16le -to 64.600
/dev/shm/6029_cut_2.mp4
ffmpeg version N-112149-ga87a52ed0b Copyright (c) 2000-2024 the FFmpeg
developers
  built with gcc 11.2.0 (GCC)
  configuration:
  libavutil  58. 36.101 / 58. 36.101
  libavcodec 60. 37.100 / 60. 37.100
  libavformat60. 20.100 / 60. 20.100
  libavdevice60.  4.100 / 60.  4.100
  libavfilter 9. 17.100 /  9. 17.100
  libswscale  7.  6.100 /  7.  6.100
  libswresample   4. 13.100 /  4. 13.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/home/guest/6029.mp4':
  Metadata:
major_brand : mp42
minor_version   : 0
compatible_brands: mp42isomavc1
creation_time   : 2011-06-24T09:52:37.00Z
encoder : HandBrake 0.9.5 2011043000
  Duration: 01:28:31.60, start: 0.00, bitrate: 789 kb/s
  Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661),
yuv420p(tv, smpte170m/smpte170m/bt709, progressive), 720x400, 657
kb/s, 25 fps, 25 tbr, 90k tbn (default)
  Metadata:
creation_time   : 2011-06-24T09:52:37.00Z
vendor_id   : [0][0][0][0]
encoder : JVT/AVC Coding
  Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 48000
Hz, stereo, fltp, 127 kb/s (default)
  Metadata:
creation_time   : 2011-06-24T09:52:37.00Z
vendor_id   : [0][0][0][0]
File '/dev/shm/6029_cut_2.mp4' already exists. Overwrite? [y/N] y
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (aac (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
Output #0, mp4, to '/dev/shm/6029_cut_2.mp4':
  Metadata:
major_brand : mp42
minor_version   : 0
compatible_brands: mp42isomavc1
encoder : Lavf60.20.100
  Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661),
yuv420p(tv, smpte170m/smpte170m/bt709, progressive), 720x400, q=2-31,
657 kb/s, 25 fps, 25 tbr, 90k tbn 

Re: [FFmpeg-user] cutting mp4 with ffmpeg

2024-01-13 Thread DEF
On Sat, 13 Jan 2024 at 19:09, Andrew Randrianasulu
 wrote:
>

>
> also
>
> /dev/shm/ffmpeg/ffmpeg -i /dev/shm/6029_cut_2.mp4 -vf showinfo -f null
> /dev/null
>
> last lines were
>
> [Parsed_showinfo_0 @ 0xee202580] n:1612 pts:5803200 pts_time:64.48
> duration:  0 duration_time:0   fmt:yuv420p cl:left sar:0/1
> s:720x400 i:P iskey:0 type:B checksum:498D7D18
> plane_checksum:[7C011A9A 72D078F0 1749E97F] mean:[84 158 80]
> stdev:[10.1 3.4 8.2]
> [Parsed_showinfo_0 @ 0xee202580] color_range:tv color_space:smpte170m
> color_primaries:smpte170m color_trc:bt709
> [Parsed_showinfo_0 @ 0xee202580] n:1613 pts:5806800 pts_time:64.52
> duration:  0 duration_time:0   fmt:yuv420p cl:left sar:0/1
> s:720x400 i:P iskey:0 type:B checksum:FB6C528A
> plane_checksum:[BC0C2674 7A2A71F8 E2E7BA0F] mean:[84 158 80]
> stdev:[10.1 3.3 8.1]
> [Parsed_showinfo_0 @ 0xee202580] color_range:tv color_space:smpte170m
> color_primaries:smpte170m color_trc:bt709
> [Parsed_showinfo_0 @ 0xee202580] n:1614 pts:5810400 pts_time:64.56
> duration:  0 duration_time:0   fmt:yuv420p cl:left sar:0/1
> s:720x400 i:P iskey:0 type:P checksum:32E560F5
> plane_checksum:[237A0A01 F76B8D20 1D72C9C5] mean:[84 158 80]
> stdev:[10.1 3.2 8.0]
> [Parsed_showinfo_0 @ 0xee202580] color_range:tv color_space:smpte170m
> color_primaries:smpte170m color_trc:bt709
> [Parsed_showinfo_0 @ 0xee202580] n:1615 pts:5814000 pts_time:64.6
> duration:  0 duration_time:0   fmt:yuv420p cl:left sar:0/1
> s:720x400 i:P iskey:1 type:I checksum:C9E56CD5
> plane_checksum:[1254795B 75287B1F 720B784C] mean:[83 158 80]
> stdev:[10.1 3.0 7.8]
> [Parsed_showinfo_0 @ 0xee202580] color_range:tv color_space:smpte170m
> color_primaries:smpte170m color_trc:bt709
> [Parsed_showinfo_0 @ 0xee202580] n:1616 pts:5828400 pts_time:64.76
> duration:  0 duration_time:0   fmt:yuv420p cl:left sar:0/1
> s:720x400 i:P iskey:0 type:P checksum:07418607
> plane_checksum:[A672B48D A7D7BD5B 3D4D1410] mean:[83 158 79]
> stdev:[9.7 2.3 7.0]
> [Parsed_showinfo_0 @ 0xee202580] color_range:tv color_space:smpte170m
> color_primaries:smpte170m color_trc:bt709
> [out#0/null @ 0xbf59800] video:543kB audio:12112kB subtitle:0kB other
> streams:0kB global headers:0kB muxing overhead: unknown
> frame= 1617 fps=493 q=-0.0 Lsize=N/A time=00:01:04.61 bitrate=N/A speed=19.7x
>
>
> doesn't this mean ffmpeg cut one frame too much ?

Yes it will and it could.
As long as you are not encoding the video, ffmpeg will cut at the
nearest iframes.
If you are particular then you need to re-encode the video.

/dev/shm/ffmpeg/ffmpeg -i ~/6029.mp4   -c:v libx264 -c:a pcm_s16le
-t 64.600 /dev/shm/6029_cut_2.mp4

avoid using "-to" in the place of "-t" like i explained.

if you must not reencode and you want to use copyts then you must add
the option
"-avoid_negative_ts make_zero"  after your copyts.

DEF
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] cutting mp4 with ffmpeg

2024-01-13 Thread Andrew Randrianasulu
On Sat, Jan 13, 2024 at 8:57 PM Def Etienne  wrote:
>
>
> Sent from my iPhone
>
> > On 13 Jan 2024, at 15:44, Andrew Randrianasulu  
> > wrote:
> >
> > I compiled new ffmpeg I tried to cut mp4
> >
> > -to parameter was coming from mpv:
> >
> > bash-5.1$ mpv ~/6029.mp4
> > (+) Video --vid=1 (*) (h264 720x400 25.000fps)
> > (+) Audio --aid=1 (*) (aac 2ch 48000Hz)
> > AO: [alsa] 48000Hz stereo 2ch float
> > VO: [gpu] 720x400 yuv420p
> > (Paused) AV: 00:01:04.600 / 01:28:31.600 (1%) A-V:  0.000
> >
> > 1 min + 4 seconds +0.600 milliseconds = 64.600 ?
> >
> > bash-5.1$ /dev/shm/ffmpeg/ffmpeg -i ~/6029.mp4  -copyts -c:v copy -c:a
> > copy -ss 0.0 -to 64.600 /dev/shm/6029_cut.mp4
>
> I think the command intends a logic in its use.
>
> If you intend to cut out the first 64.6 seconds then you do not need to use  
> the “-ss” parameter.
>
> Using -t 64.6  before the output file would have been good enough.
>
> If you had needed to start from another time which is not the 0th second then 
> an -ss parameter is needed which _must come_ before the input file on the 
> command line and the “-to” mist have followed the -ss command before the 
> input file.
>
> Try
>
> ffmpeg -i ~/6029.mp4  -copyts  c:v copy -c:acopy -t 64.600 
> dev/shm/6029_cut.mp4

I tried to see if audio encoded as aac was at fault, because now
ffmpeg can encode PCM in mp4 I used

/dev/shm/ffmpeg/ffmpeg -i ~/6029.mp4  -copyts -c:v copy -c:a pcm_s16le
-to 64.600 /dev/shm/6029_cut_2.mp4

bash-5.1$ MP4Box -info  /dev/shm/6029_cut_2.mp4
* Movie Info *
Timescale 1000 - 2 tracks
Computed Duration 00:01:04.800 - Indicated Duration 00:01:04.800
Fragmented File: no
File Brand isom - version 512
Compatible brands: isom iso2 avc1 mp41
Created: UNKNOWN DATE   Modified: UNKNOWN DATE
File has no MPEG4 IOD/OD

iTunes Info:
Encoder Software: Lavf60.20.100
1 UDTA types: meta (1)

Track # 1 Info - TrackID 1 - TimeScale 9
Media Duration 00:01:04.680 - Indicated Duration 00:01:04.800
Track has 1 edit lists: track duration is 00:01:04.800
Media Info: Language "Undetermined (und)" - Type "vide:avc1" - 1617 samples
Visual Sample Entry Info: width=720 height=400 (depth=24 bits)
Visual Track layout: x=0 y=0 width=720 height=400
MPEG-4 Config: Visual Stream - ObjectTypeIndication 0x21
AVC/H264 Video - Visual Size 720 x 400
AVC Info: 1 SPS - 1 PPS - Profile High @ Level 3
NAL Unit length bits: 32
Chroma format YUV 4:2:0 - Luma bit depth 8 - chroma bit depth 8
SPS#1 hash: E2ADECEA8531A9FC07EE08593AF65A2AD75A3533
PPS#1 hash: 6BBE60BFBE383CE9144FA78B782534A704912778
Self-synchronized
RFC6381 Codec Parameters: avc1.64001E
Average GOP length: 231 samples
Max sample duration: 3600 / 9

Track # 2 Info - TrackID 2 - TimeScale 48000
Media Duration 00:01:04.597 - Indicated Duration 00:01:04.597
Track has 2 edit lists: track duration is 00:01:04.619
Media Info: Language "Undetermined (und)" - Type "soun:ipcm" - 3100672 samples
Unknown track type
RFC6381 Codec Parameters: ipcm
Alternate Group ID 1
All samples are sync
Max sample duration: 1 / 48000

===

bash-5.1$ /dev/shm/ffmpeg/ffprobe  /dev/shm/6029_cut_2.mp4
ffprobe version N-112149-ga87a52ed0b Copyright (c) 2007-2024 the
FFmpeg developers
  built with gcc 11.2.0 (GCC)
  configuration:
  libavutil  58. 36.101 / 58. 36.101
  libavcodec 60. 37.100 / 60. 37.100
  libavformat60. 20.100 / 60. 20.100
  libavdevice60.  4.100 / 60.  4.100
  libavfilter 9. 17.100 /  9. 17.100
  libswscale  7.  6.100 /  7.  6.100
  libswresample   4. 13.100 /  4. 13.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/dev/shm/6029_cut_2.mp4':
  Metadata:
major_brand : isom
minor_version   : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf60.20.100
  Duration: 00:01:04.68, start: 0.00, bitrate: 2273 kb/s
  Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661),
yuv420p(tv, smpte170m/smpte170m/bt709, progressive), 720x400, 734
kb/s, 25 fps, 25 tbr, 90k tbn (default)
  Metadata:
handler_name: VideoHandler
vendor_id   : [0][0][0][0]
encoder : JVT/AVC Coding
  Stream #0:1[0x2](und): Audio: pcm_s16le (ipcm / 0x6D637069), 48000
Hz, stereo, s16, 1536 kb/s (default)
  Metadata:
handler_name: SoundHandler
vendor_id   : [0][0][0][0]
===

also

/dev/shm/ffmpeg/ffmpeg -i /dev/shm/6029_cut_2.mp4 -vf showinfo -f null
/dev/null

last lines were

[Parsed_showinfo_0 @ 0xee202580] n:1612 pts:5803200 pts_time:64.48
duration:  0 duration_time:0   fmt:yuv420p cl:left sar:0/1
s:720x400 i:P iskey:0 type:B checksum:498D7D18
plane_checksum:[7C011A9A 72D078F0 1749E97F] mean:[84 158 80]
stdev:[10.1 3.4 8.2]
[Parsed_showinfo_0 @ 0xee202580] color_range:tv color_space:smpte170m
color_primaries:smpte170m color_trc:bt709
[Parsed_showinfo_0 @ 0xee202580] n:1613 pts:5806800 pts_time:64.52

Re: [FFmpeg-user] cutting mp4 with ffmpeg

2024-01-13 Thread Def Etienne

Sent from my iPhone

> On 13 Jan 2024, at 15:44, Andrew Randrianasulu  
> wrote:
> 
> I compiled new ffmpeg I tried to cut mp4
> 
> -to parameter was coming from mpv:
> 
> bash-5.1$ mpv ~/6029.mp4
> (+) Video --vid=1 (*) (h264 720x400 25.000fps)
> (+) Audio --aid=1 (*) (aac 2ch 48000Hz)
> AO: [alsa] 48000Hz stereo 2ch float
> VO: [gpu] 720x400 yuv420p
> (Paused) AV: 00:01:04.600 / 01:28:31.600 (1%) A-V:  0.000
> 
> 1 min + 4 seconds +0.600 milliseconds = 64.600 ?
> 
> bash-5.1$ /dev/shm/ffmpeg/ffmpeg -i ~/6029.mp4  -copyts -c:v copy -c:a
> copy -ss 0.0 -to 64.600 /dev/shm/6029_cut.mp4

I think the command intends a logic in its use. 

If you intend to cut out the first 64.6 seconds then you do not need to use  
the “-ss” parameter. 

Using -t 64.6  before the output file would have been good enough. 

If you had needed to start from another time which is not the 0th second then 
an -ss parameter is needed which _must come_ before the input file on the 
command line and the “-to” mist have followed the -ss command before the input 
file. 

Try  

ffmpeg -i ~/6029.mp4  -copyts  c:v copy -c:acopy -t 64.600 dev/shm/6029_cut.mp4

Def

___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-user] cutting mp4 with ffmpeg

2024-01-13 Thread Andrew Randrianasulu
I compiled new ffmpeg I tried to cut mp4

-to parameter was coming from mpv:

bash-5.1$ mpv ~/6029.mp4
 (+) Video --vid=1 (*) (h264 720x400 25.000fps)
 (+) Audio --aid=1 (*) (aac 2ch 48000Hz)
AO: [alsa] 48000Hz stereo 2ch float
VO: [gpu] 720x400 yuv420p
(Paused) AV: 00:01:04.600 / 01:28:31.600 (1%) A-V:  0.000

1 min + 4 seconds +0.600 milliseconds = 64.600 ?

bash-5.1$ /dev/shm/ffmpeg/ffmpeg -i ~/6029.mp4  -copyts -c:v copy -c:a
copy -ss 0.0 -to 64.600 /dev/shm/6029_cut.mp4
ffmpeg version N-112149-ga87a52ed0b Copyright (c) 2000-2024 the FFmpeg
developers
  built with gcc 11.2.0 (GCC)
  configuration:
  libavutil  58. 36.101 / 58. 36.101
  libavcodec 60. 37.100 / 60. 37.100
  libavformat60. 20.100 / 60. 20.100
  libavdevice60.  4.100 / 60.  4.100
  libavfilter 9. 17.100 /  9. 17.100
  libswscale  7.  6.100 /  7.  6.100
  libswresample   4. 13.100 /  4. 13.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/home/guest/6029.mp4':
  Metadata:
major_brand : mp42
minor_version   : 0
compatible_brands: mp42isomavc1
creation_time   : 2011-06-24T09:52:37.00Z
encoder : HandBrake 0.9.5 2011043000
  Duration: 01:28:31.60, start: 0.00, bitrate: 789 kb/s
  Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661),
yuv420p(tv, smpte170m/smpte170m/bt709, progressive), 720x400, 657
kb/s, 25 fps, 25 tbr, 90k tbn (default)
  Metadata:
creation_time   : 2011-06-24T09:52:37.00Z
vendor_id   : [0][0][0][0]
encoder : JVT/AVC Coding
  Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 48000
Hz, stereo, fltp, 127 kb/s (default)
  Metadata:
creation_time   : 2011-06-24T09:52:37.00Z
vendor_id   : [0][0][0][0]
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Output #0, mp4, to '/dev/shm/6029_cut.mp4':
  Metadata:
major_brand : mp42
minor_version   : 0
compatible_brands: mp42isomavc1
encoder : Lavf60.20.100
  Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661),
yuv420p(tv, smpte170m/smpte170m/bt709, progressive), 720x400, q=2-31,
657 kb/s, 25 fps, 25 tbr, 90k tbn (default)
  Metadata:
creation_time   : 2011-06-24T09:52:37.00Z
vendor_id   : [0][0][0][0]
encoder : JVT/AVC Coding
  Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz,
stereo, fltp, 127 kb/s (default)
  Metadata:
creation_time   : 2011-06-24T09:52:37.00Z
vendor_id   : [0][0][0][0]
Press [q] to stop, [?] for help
[out#0/mp4 @ 0xb79c180] video:5397kB audio:1009kB subtitle:0kB other
streams:0kB global headers:0kB muxing overhead: 0.732907%
size=6453kB time=01:17:29.80 bitrate=  11.4kbits/s speed=1.21e+03x
bash-5.1$ MP4Box -info /dev/shm/6029_cut.mp4
* Movie Info *
Timescale 1000 - 2 tracks
Computed Duration 00:01:04.800 - Indicated Duration 00:01:04.800
Fragmented File: no
File Brand isom - version 512
Compatible brands: isom iso2 avc1 mp41
Created: UNKNOWN DATE   Modified: UNKNOWN DATE
File has no MPEG4 IOD/OD

iTunes Info:
Encoder Software: Lavf60.20.100
1 UDTA types: meta (1)

Track # 1 Info - TrackID 1 - TimeScale 9
Media Duration 00:01:00.040 - Indicated Duration 00:01:00.160
Track has 2 edit lists: track duration is 00:01:04.800
Media Info: Language "Undetermined (und)" - Type "vide:avc1" - 1501 samples
Visual Sample Entry Info: width=720 height=400 (depth=24 bits)
Visual Track layout: x=0 y=0 width=720 height=400
MPEG-4 Config: Visual Stream - ObjectTypeIndication 0x21
AVC/H264 Video - Visual Size 720 x 400
AVC Info: 1 SPS - 1 PPS - Profile High @ Level 3
NAL Unit length bits: 32
Chroma format YUV 4:2:0 - Luma bit depth 8 - chroma bit depth 8
SPS#1 hash: E2ADECEA8531A9FC07EE08593AF65A2AD75A3533
PPS#1 hash: 6BBE60BFBE383CE9144FA78B782534A704912778
Self-synchronized
RFC6381 Codec Parameters: avc1.64001E
Average GOP length: 250 samples
Max sample duration: 3600 / 9

Track # 2 Info - TrackID 2 - TimeScale 48000
Media Duration 00:01:04.618 - Indicated Duration 00:01:04.618
Track has 1 edit lists: track duration is 00:01:04.619
Media Info: Language "Undetermined (und)" - Type "soun:mp4a" - 3029 samples
MPEG-4 Config: Audio Stream - ObjectTypeIndication 0x40
MPEG-4 Audio AAC LC (AOT=2 implicit) - 2 Channel(s) - SampleRate 48000
Synchronized on stream 1
RFC6381 Codec Parameters: mp4a.40.2
Alternate Group ID 1
All samples are sync
Max sample duration: 1024 / 48000

bash-5.1$ /dev/shm/ffmpeg/ffprobe /dev/shm/6029_cut.mp4
ffprobe version N-112149-ga87a52ed0b Copyright (c) 2007-2024 the
FFmpeg developers
  built with gcc 11.2.0 (GCC)
  configuration:
  libavutil  58. 36.101 / 58. 36.101
  libavcodec 60. 37.100 / 60. 37.100
  libavformat60. 20.100 / 60. 20.100
  libavdevice60.  4.100 / 60.  4.100
  libavfilter 9. 17.100 

[FFmpeg-user] split from Mark's trimming thread

2024-01-13 Thread Andrew Randrianasulu
I was looking into loslesscut issue tracker and found two related issues:

https://github.com/mifi/lossless-cut/issues/126
" Implement "smart cut"

this branches into avcut and its explanation, and into

https://github.com/mifi/lossless-cut/issues/1216
"How to seek to and cut from a frame in ffmpeg?"

this discussion has interesting tip on how to convince ffmpeg to cut more
accurately on keyframes:

=
The only good solution and reproducible that I found it to set the -t to 2
frames before the keyframe wanted


So I wonder if *this* will work with Mark's files?

I tried ffmpeg's ss and to options on mp4 file and get around 3
milliseconds of difference between cut file and distance I tried to express
in milliseconds argument for " -to" switch from ss 0.0. For finding
keyframes I was using mpv's default seeking behavior {keyboard cursor
arrows will jump to keyframe} with osd-fractions option set in mpv.conf so
it displays milliseconds in both terminal output and OSD but it was with v
4.4.4 of ffmpeg, so may be not reproducible on new ffmpeg versions.

I want to thank Mark for his persistence in chasing this issue because it
turned out many open- and closed-source projects use ffmpeg/libav* for
framecut functionality, so fixing it at source is important.
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".