Extracting a single frame from from a video with ffmpeg is super slow

  Kiến thức lập trình

I have the following script (slightly abbreviated) that extracts (and scales) the middle frame after cropping to a PNG

This works fine, but with a 4k mp4 file this takes 50 seconds on a well specced machine, without a GPU. I think that’s crazy and I must be doing something very wrong.

This is final command of the script

ffmpeg -ss 1 -i video.mp4 -update 1 -vframes:v 1 -vf "crop=3840:2160:0:0,scale=-1:256" -y test.png

I already moved the time arguments to the start, but the difference was pretty minimal

LEAVE A COMMENT