[FFmpeg-devel] [PATCH] Add an usage example for extracting images from a video in the docs

Måns Rullgård mans
Tue Aug 12 03:01:38 CEST 2008


The Wanderer <inverseparadox at comcast.net> writes:

> Stefano Sabatini wrote:
>
>> Hi, as in subject.
>
> A few comments:
>
>> +* You can extract images from a video:
>> +
>> + at example
>> +ffmpeg -i foo.avi -r 1 -s WxH -f image2 foo%03d.jpeg 
>> + at end example
>> +
>> +This will extract one video frame per second from the video and will
>> +output them in files named like @file{foo-001.jpeg}, @file{foo-002.jpeg},
>> +etc. Images are rescaled to fit the new WxH values.
>
> I would say "will be rescaled", because you are using the future tense
> in the previous sentence and it flows better if the tenses match.

Agree.

>> +The syntax @code{foo%03d.jpeg} specifies to use a decimal number composed by
>> +three digit to express the sequence number, and is the same format supported by
>> +the C printf function.
>
> "composed of three digits"
>
> Does the syntax actually support e.g. "%03f", "%02lld", etc., as
> printf() does? (I wouldn't really expect so, as those formats would not
> make sense as filename patterns.) If not, is it useful to point out the
> derivation here?

It is a printf format, but only formats accepting a normal integer are
suitable.  I don't know what happens if you specify something else.

>> +If you want to extract just a limited number of frames you can use the
>> +above command in combination with the -vframes option.
>
> It might be a good idea to add a comma after "frames" here, but it's not
> strictly necessary, and it could arguably introduce more problems than
> it fixes.

I'd definitely go with the comma.

-- 
M?ns Rullg?rd
mans at mansr.com




More information about the ffmpeg-devel mailing list