Answers.Body: <p>Retime the remaining frames.</p>
  <p><code>ffmpeg -framerate 30 -i /home/pictures/%*.jpg -vf &quot;blackframe=0,metadata=select:key=lavfi.blackframe.pblack:value=50:function=less,setpts=N/FR/TB,scale=640:-2,format=yuv420p&quot; -c:v libx264 -crf 28 /home/out.mp4</code></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-17T06:07:18.900Z
Answers.Text: brilliant, thanks a lot!
Answers.UserDisplayName: FritzFatz
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-17T04:49:08.187Z
Answers.LastActivityDate: 2020-09-17T04:49:08.187Z
Answers.UserDisplayName: Gyan
Body: <p>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.</p>
  <p>What i've tried:</p>
  <pre><code>ffmpeg -framerate 30 -i /home/pictures/%*.jpg -c:v libx264 -vf &quot;blackframe=0,metadata=select:key=lavfi.blackframe.pblack:value=50:function=less,scale=640:-2,format=yuv420p&quot; -crf 28 /home/out.mp4
  </code></pre>
  <p>Any ideas?</p>
  
Tags: <ffmpeg>
Title: Removing black frames with constant framerate
UserDisplayName: FritzFatz
ThreadText: # Removing black frames with constant framerate
  
  (Asked by: username_0 on 2020-09-16)
  
  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?
  
  **Tags:** ffmpeg
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-09-17. Score: 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`
  
  > **Comments:**
  > **username_0**: brilliant, thanks a lot!  
  
  ---
  
  