[FFmpeg-user] FFMPEG dropping the first two frames of segments generated through seeking

Fernando Peña D'Andrea fernando.dandrea at gmail.com
Thu Feb 1 22:28:45 EET 2018


Hello, all!

I'm trying to script-cut a 24 fps video and it gets close to the right
thing, except for two missing frames at the beginning of every segment I
cut with seeking.

I've found out that index-frames (keyframes) could become an issue for
seeking, so I first create an intermediate file with every frame as a index
frame using this line:

ffmpeg -i input.mov -c:v libx264 -g 1 -c:a copy intermediate.mp4

Then I proceed to make a cut with this line. Notice I'm drawing some text
on top of it:

ffmpeg -hide_banner -y -i intermediate.mp4 -ss 00:00:02.083333333333
-to 00:00:02.875000000000 -vf
drawtext=fontfile=DroidSans.ttf:fontsize=48:text="segment2":fontcolor=yellow:box=1:boxborderw=16:boxcolor=black at 0.5:x=w/32:y=h/18
output.mp4

No matter the length of the segment, the first two frames get dropped.

Probably not relevant but: I'm using a python script to control ffmpeg.

Any ideas?


More information about the ffmpeg-user mailing list