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

Stefano Sabatini stefano.sabatini-lala
Tue Aug 12 09:40:04 CEST 2008


On date Tuesday 2008-08-12 02:01:38 +0100, M?ns Rullg?rd encoded:
> 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.

Fixed. I also fixed the problem pointed out by V?ctor (img-001.jpeg
versus img001.jpeg).

> >> +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"

Fixed.

> > 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.

Indeed it doesn't work otherwise, issuing error messages of the kind:
av_interleaved_write_frame(): I/O error occurred
Usually that means that input file is truncated and/or corrupted.

> >> +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.

OK.

Thanks for the reviews, regards.
-- 
FFmpeg = Foolish Free Magic Patchable Excellent Guide
-------------- next part --------------
A non-text attachment was scrubbed...
Name: add-img-extract-example-01.patch
Type: text/x-diff
Size: 1147 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080812/75c43db3/attachment.patch>



More information about the ffmpeg-devel mailing list