0

I need to drop all the B-frames and P-frames, only keeping the I-frames to be saved as images.

2474101468
  • 328
  • 2
  • 9
  • 1
    I’m voting to close this question because , as explained by the ffmpeg tag: Only questions about programmatic use of the FFmpeg libraries, API, or tools are on topic. Questions about interactive use of the command line tool should be asked on https://superuser.com/ or https://video.stackexchange.com/. – Rob Apr 17 '23 at 07:57
  • To my point of view, this is not surely an FFmepg command question. Potentially I was going to edit the source codes of FFmpeg to extract frames – 2474101468 Apr 18 '23 at 08:04

1 Answers1

2

You can instruct the decoder to skip non-keyframes using -skip_frame.

ffmpeg -skip_frame nokey -i input.mp4 -vsync vfr img%04d.png
Gyan
  • 85,394
  • 9
  • 169
  • 201
  • ffmpeg questions are off topic. Do not answer off topic questions. [answer] – Rob Apr 17 '23 at 07:58
  • ffmpeg Qs aren't off-topic. And this Q is not about "interactive use of the command line tool" – Gyan Apr 17 '23 at 10:15
  • From the ffmpeg tag: Only questions about programmatic use of the FFmpeg libraries, API, or tools are on topic. – Rob Apr 17 '23 at 13:22