i'm trying to create a video made of jpgs (camera-snapshots every hour) with removal of black frames (snapshots at night). It works BUT, whenever a black frame has been removed (or ignored), the video stucks at that point. I want to have a smooth video with 30 fps as result and don't want to fill up the ignored frames with copies etc.

What i've tried:

ffmpeg -framerate 30 -i /home/pictures/%*.jpg -c:v libx264 -vf "blackframe=0,metadata=select:key=lavfi.blackframe.pblack:value=50:function=less,scale=640:-2,format=yuv420p" -crf 28 /home/out.mp4

Any ideas?

1 Answer 1


Retime the remaining frames.

ffmpeg -framerate 30 -i /home/pictures/%*.jpg -vf "blackframe=0,metadata=select:key=lavfi.blackframe.pblack:value=50:function=less,setpts=N/FR/TB,scale=640:-2,format=yuv420p" -c:v libx264 -crf 28 /home/out.mp4

  • brilliant, thanks a lot!
    – FritzFatz
    Sep 17, 2020 at 6:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.