1

I am working on laying out video stills in a book. I am pretty new to using the command line and discovered ffmpeg just yesterday.

Right now, I want to extract 8fps from a video between, for example, 00:05:30 and 00:42:30. This is what I have written. I am not sure how to include the out point or if I am using the right option to begin with (-ss).

ffmpeg -ss 00:05:30 -i video.mp4 -vf fps=8 out%05d.png

As another approach, I know this segment is 37 seconds. So:

ffmpeg -ss 00:05:30 -i video.mp4 -t 00:00:37 -vf fps=8/16 out%05d.png

I am also wondering if -ss has to be specified before the input or if it can be placed after. I guess I'm confused about syntax. Could it be ffmpeg -i video.mp4 -ss 00:05:30 ... as well? It seems to be running, but slower.

AFG
  • 39
  • 2
  • 4
  • 1
    `ffmpeg -ss 00:05:30 -to 00:42:30 -i video.mp4 -vf fps=8 out%05d.png` – Gyan Dec 30 '18 at 18:16
  • Please read: https://trac.ffmpeg.org/wiki/Seeking – slhck Dec 30 '18 at 21:11
  • 1
    @slhck You marked this as duplicate, but it is not quite the same. That is only cutting the video but I am asking how to take screenshots from a segment of the video? Is the solution to just add `-vf fps=8 out%05d.png` after `ffmpeg -ss [start] -i in.mp4 -t [duration]`? – AFG Dec 30 '18 at 23:10
  • Yes, isn't that what your original command does, except for the missing "to" option? (Or duration using the "t" option, both are valid.) I thought you were unclear about the seeking behavior, hence the link to the other question. – slhck Dec 30 '18 at 23:24
  • Yes I was just not sure if adding `-vf ...` was all that it took. Thank you a lot for sending both links about the seeking behavior. It definitely cleared up a lot. – AFG Dec 30 '18 at 23:28
  • @Gyan `Option to (record or transcode stop time) cannot be applied to input url video.mp4 -- you are trying to apply an input option to an output file or vice versa. Move this option before the file it belongs to.` – Michael Dec 18 '19 at 21:53
  • You're using an old version. – Gyan Dec 19 '19 at 04:24
  • @Michael If you're using an old version and getting that error, try moving the -input option before the -to option like this: (worked for me). ffmpeg -ss 00:05:30 -i video.mp4 -to 00:42:30 -vf fps=8 out%05d.png – g0h Apr 16 '20 at 10:52

0 Answers0