Saturday, March 28, 2009

Using ffmpeg to capture screen of flv file

ffmpeg is a powerful utility for audio and video processing. However, you have to compile the source code yourself. This web page tells how to compile the source code of ffmpeg to become executables.

One very simple use of ffmpeg is to capture screen from a flv file. Actually, this is to save a video frame to file.

For example, this command :
ffmpeg -i MyFile.flv -ss 00:00:31 -vframes 1 -y MyImage.jpg
will capture a frame from the file MyFile.flv at the time 00:00:31 to the file MyImage.jpg
If you want to capture 101 frames, here is the command:
ffmpeg -i MyFile.flv -ss 00:00:31 -vframes 101 -y MyImage-%03d.jpg
The will capture the 101 frames to the files MyImage-001.jpg to Myimage-101.jpg.
However, under Windows, there is some special processing for the percent sign. Therefore, the command has to be adjusted as follow:
ffmpeg -i MyFile.flv -ss 00:00:31 -vframes 101 -y MyImage-%%03d.jpg
In short, double percent signs have to be used under Windows.


No comments:

Duplicate Open Current Folder in a New Window

Sometimes after I opened a folder in Win7, I would like to duplicate open the same folder again in another explorer window. Then, I can ope...