# The Ubuntu Forum Community > Ubuntu Official Flavours Support > Multimedia Software > [xubuntu] Using ffmpeg to extract frames from video

## SillySod

I know I can use ffmpeg to extract all the frames of a video file as separate images, such as:



```
ffmpeg -i Video.mpg Pictures%d.jpg
```

Is there a way I can use this to create an image every, say, 50 or 75 frames?  If I extract every frame there will be too many to use.

----------


## lovinglinux

If you want to generate a contact sheet, you can use  Video Contact Sheet *NIX (vcs). Is just a script, so if open it with a text editor you might find the code to do what you want in the command-line.

----------


## cipi.ro

Hi,

Look here: http://lists.mplayerhq.hu/pipermail/...er/005327.html

It says to do something like:



```
# ffmpeg -i file.mp4 -y -ss 5 -an -sameq -f image2 -r 1/5 filename%03d.jpg
```

I did some research on all the options involved in the command above:

-y
Overwrite output files-ss position
Seek to given time position in seconds. "hh:mm:ss[.xxx]" syntax is also supported-an
Disable audio recording-sameq
Use same video quality as source-f fmt
Force format-r fps
Set frame rate (Hz value, fraction or abbreviation), (default = 25)

This means that the command could be simplified to:



```
# ffmpeg -i file.mp4 -r 1/5 filename%03d.jpg
```

Maybe you might want to use -ss too.
Also, I think that - r 1/5 result from the fact that you have a video at 25 fps and you want to grab frames with a 5 seconds step (25 * (1/5) = 5)

----------

