[FFmpeg-user] Cutting out part of a video does not work

Bo Berglund bo.berglund at gmail.com
Fri Mar 26 17:40:26 EET 2021


On Fri, 26 Mar 2021 10:59:23 +0100, Peter White <peter.white at posteo.net> wrote:

>You can use ffprobe to find the keyframe timestamps:
>
>ffprobe -select_streams V:0 -show_frames -skip_frame nokey -show_entries frame=best_effort_timestamp_time 2021-03-25ToastmastersClubAvond.mp4
>

Interesting, I have wondered about why my ffmpeg cut engine does not give me
clean cuts...

I tested your command ona typical video file and found thta the output looks
basically like this:

[FRAME]
best_effort_timestamp_time=3900.000000
[/FRAME]
[FRAME]
best_effort_timestamp_time=3905.000000
[/FRAME]
[FRAME]
best_effort_timestamp_time=3910.000000
[/FRAME]
[FRAME]
best_effort_timestamp_time=3915.000000
[/FRAME]

It seems like there are "frames" at every 5 seconds.
So on such videos is it impossible to cut say from time 2603 to 3401 and get a
video of length 798 seconds?

What does ffmpeg do?
Does it skip to the closest frame border or does it include both the starting
and ending frame so giving a video time of 805 seconds?

Switching from the copy handler to something else makes ffmpeg work a lot harder
and processing time goes from 5 seconds to 30 minutes or so....


-- 
Bo Berglund
Developer in Sweden



More information about the ffmpeg-user mailing list