0

I'm using an ffmpeg script (in Windows) that extracts all the keyframes from a video and pastes them into a folder. I've made sure that my drive speed, CPU, and RAM are not causing a bottleneck.

The quality of the video is actually not important at all in this case. I need to encode the video that the script extracts frames from so that it has the fastest possible decoding speed. File size and quality are not important, only read speed. The video does not have audio. What would work best for me?

If it matters, here's the script I'm working with:

ffmpeg -i input.mp4 -vf "select=eq(pict_type\,I)" -vsync 1 %%3d.bmp

Sorry if sound like I don't know what I'm talking about, this is not a topic I am super familiar with. I appreciate your help!

jj1999
  • 11
  • 4

1 Answers1

1

The below will be much faster for a codec like H.264

ffmpeg -discard nokey -i input.mp4 -vsync 0 %%3d.bmp

Your present approach decodes all frames and then the select filter gets to do gating, but the above command discards everything but keyframes at the demuxer level. It only works with MP4/MOV like containers.

Gyan
  • 85,394
  • 9
  • 169
  • 201