PDA

View Full Version : Video snapshots


Tartz
16th August 2008, 13:57
I need a cli program that can take snapshots (jpg) from a .mp4 264 video file.
I want to incorporate this in my batch (see previous post).

I searched the whole (yes the whole) internet and couldn't find it.

Does anyone know of a (open-source) tool that can do this?
It must have CLI.

Thanks in advance :)

wyti
16th August 2008, 14:01
i don't know if this program exist, but it need to take png snapshot otherwise you will include the compression artefact of the jpg too.

Tartz
16th August 2008, 14:07
png is fine too

Kurtnoise
16th August 2008, 15:34
You can extract images from a video:

ffmpeg -i foo.mp4 -r 1 -s WxH -f image2 foo-%03d.jpeg


This will extract one video frame per second from the video and will
output them in files named foo-001.jpeg, foo-002.jpeg,
etc. Images will be rescaled to fit the new WxH values.

The syntax foo-%03d.jpeg specifies to use a decimal number
composed of three digits padded with zeroes to express the sequence
number. It is the same syntax supported by the C printf function, but
only formats accepting a normal integer are suitable.

If you want to extract just a limited number of frames, you can use the
above command in combination with the -vframes or -t option, or in
combination with -ss to start extracting from a certain point in time.



http://ffmpeg.mplayerhq.hu/ffmpeg-doc.html

for png format use -f image7

DeeGee
16th August 2008, 15:42
Mplayer can output to jpg and png. It might be tricky to output only the frames you want to.

Tartz
16th August 2008, 17:30
Kurtnoise13 your a life saver!!!
Thanks :D