The parameters are here for testing to see if everything performs as required.

What I get is a video with 20 black frames followed by 10 frames of content. While I want the 10 frames I don't know how the 20 black frames got there. The documentation of the select-filter clearly states that only the frames for which the expression evaluates to a value different to 0 are selected. In the above gte(n,20) should remove them.

1 Answer
1

setpts='PTS-STARTPTS' resets the presentation time stamp of each frame (so the first frame is 0.0 seconds, and they increment correctly) - the select filter will send the selected frames to the rest of ffmpeg, but it will not, by itself, alter the presentation time stamp, which can cause all sorts of problems - as you found out.