0
ffmpeg -i file -c:v libwebp -vf 'fps=1/".($Duration/10)."'-vsync vfr img%01d.webp

I first find out the duration of the video, then specify how many seconds it is necessary to snatch the frame.

The question is, is it possible to do the same without first calculating how many seconds to snatch frames???

  • No. FFmpeg filters don't have access to the duration. – Gyan Jan 27 '21 at 04:36
  • In the filters, you can find out the height of the frame and so on. For example, `overlay=(W-w)/2:(H-h)/2`. Isn't there a similar solution? A variable that contains the duration... – Дмитрий Варзанов Jan 27 '21 at 05:25
  • No, but you can make a variable by [using `ffprobe` to get the duration](https://superuser.com/questions/650291/how-to-get-video-duration-in-seconds/945604#945604). – llogan Jan 27 '21 at 06:04

0 Answers0