[FFmpeg-devel] [PATCH] dox/muxers: document how to use glob patterns in the image2 demuxers

Alexander Strasser eclipse7 at gmx.net
Sun Aug 5 12:13:49 CEST 2012


Stefano Sabatini wrote:
> On date Saturday 2012-08-04 21:42:35 +0200, Alexander Strasser encoded:
> > Stefano Sabatini wrote:
> > > ---
> > >  doc/demuxers.texi |   27 +++++++++++++++++++++++++--
> > >  1 files changed, 25 insertions(+), 2 deletions(-)
> > 
> >   this and the rest of the series look good to me.
> 
> Updated with some restructuring and rewording (for example "sequence
> pattern" favored over "printf pattern").
> 
> I'll push this in a day or so if I read no comments.

  Looks even better now :)

> >From ddd1d666b3d2130a5842c5beabfdba615d2484a5 Mon Sep 17 00:00:00 2001
> From: Stefano Sabatini <stefasab at gmail.com>
> Date: Sat, 4 Aug 2012 18:23:08 +0200
> Subject: [PATCH] doc/muxers: document how to use glob patterns in the image2
>  demuxer
> 
> ---
>  doc/demuxers.texi |   26 ++++++++++++++++++++++++--
>  1 files changed, 24 insertions(+), 2 deletions(-)
> 
> diff --git a/doc/demuxers.texi b/doc/demuxers.texi
> index 07d82c0..807ad95 100644
> --- a/doc/demuxers.texi
> +++ b/doc/demuxers.texi
> @@ -24,7 +24,22 @@ Image file demuxer.
>  
>  This demuxer reads from a list of image files specified by a pattern.
>  
> -The pattern may contain the string "%d" or "%0 at var{N}d", which
> +If @code{glob()} is supported on your system, and the provided pattern

NIT: Drop the glob() function reference and associate the support
     with lavf and not with the "system".

For example:

  "If your version of libavformat was compiled with globbing support, and..."

  BTW this reminds me of a comment I had when reviewing the original
patch. There is no easy way for the user to find out if the above
statement is true, besides trying it with a glob pattern that would
match one or more existing files. But again this is unrelated, I will
try to come up with a patch (including documentation updates relative
to this patch).

  Remaining stuff is fine for me.

> +contains at least one glob meta character among @code{%*?[]@{@}} that
> +is preceded by an unescaped "%", it is interpreted like a
> + at code{glob()} pattern, otherwise is interpreted like a sequence
> +pattern (see below).
> +
> +All glob special characters @code{%*?[]@{@}} must be prefixed
> +with "%". To escape a literal "%" you shall use "%%".
> +
> +For example the glob pattern @code{foo-%*.jpeg} will match all the
> +filenames prefixed by "foo-" and terminating with ".jpeg", and
> + at code{foo-%?%?%?.jpeg} will match all the filenames prefixed with
> +"foo-", followed by a sequence of three characters, and terminating
> +with ".jpeg".
> +
> +A sequence pattern may contain the string "%d" or "%0 at var{N}d", which
>  specifies the position of the characters representing a sequential
>  number in each filename matched by the pattern. If the form
>  "%d0 at var{N}d" is used, the string representing the number in each
> @@ -32,7 +47,7 @@ filename is 0-padded and @var{N} is the total number of 0-padded
>  digits representing the number. The literal character '%' can be
>  specified in the pattern with the string "%%".
>  
> -If the pattern contains "%d" or "%0 at var{N}d", the first filename of
> +If the sequence pattern contains "%d" or "%0 at var{N}d", the first filename of
>  the file list specified by the pattern must contain a number
>  inclusively contained between @var{start_number} and
>  @var{start_number}+4, and all the following numbers must be
> @@ -80,6 +95,13 @@ As above, but start by reading from a file with index 100 in the sequence:
>  ffmpeg -start_number 100 -i 'img-%03d.jpeg' -r 10 out.mkv
>  @end example
>  
> +The following example shows how to read images matching the "*.png"
> +glob pattern (which must be escaped as illustrated above), that is all
> +the files terminating with the ".png" suffix:
> + at example
> +ffmpeg -i "%*.png" -r 10 out.mkv
> + at end example
> +
>  Note that the pattern must not necessarily contain "%d" or
>  "%0 at var{N}d", for example to convert a single image file
>  @file{img.jpeg} you can employ the command:
> -- 
> 1.7.5.4

  Alexander


More information about the ffmpeg-devel mailing list