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

Stefano Sabatini stefasab at gmail.com
Sat Aug 4 18:39:45 CEST 2012

 doc/demuxers.texi |   27 +++++++++++++++++++++++++--
 1 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/doc/demuxers.texi b/doc/demuxers.texi
index d80a83f..7e6d078 100644
--- a/doc/demuxers.texi
+++ b/doc/demuxers.texi
@@ -24,7 +24,23 @@ 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, the pattern will be
+interpreted like a @code{glob()} pattern, with the @code{GLOB_BRACE}
+option enabled. All glob special characters @code{%*?[]@{@}} must be prefixed
+with "%". To escape a literal "%" you shall use "%%".
+For example the pattern @code{foo-%*.jpeg} will match all the
+filenames prefixed by "foo-" and terminating with ".jpeg",
+ at code{foo-%?%?%?.jpeg} will match all the filenames prefixed with
+"foo-", followed by a sequence of three characters, and terminating
+with ".jpeg".
+The provided filename is recognized as a glob pattern only if it
+contains at least one glob meta character that is preceded by
+an unescaped "%", otherwise the filename is interpreted like a printf
+pattern (see below).
+A printf 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 +48,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 printf 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 +96,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:

More information about the ffmpeg-devel mailing list