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

Andrew Randrianasulu randrianasulu at gmail.com
Sat Jan 13 15:44:24 EET 2024


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.


More information about the ffmpeg-user mailing list