[FFmpeg-devel] [PATCH] lavf/img2doc: document options

Stefano Sabatini stefasab at gmail.com
Sat Aug 4 13:22:48 CEST 2012


---
 doc/demuxers.texi     |   27 +++++++++++++++++++++++++--
 libavformat/img2dec.c |   10 +++++-----
 2 files changed, 30 insertions(+), 7 deletions(-)

diff --git a/doc/demuxers.texi b/doc/demuxers.texi
index a7af1c8..7eabf8f 100644
--- a/doc/demuxers.texi
+++ b/doc/demuxers.texi
@@ -34,8 +34,9 @@ specified in the pattern with the string "%%".
 
 If the 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 0 and 4, all the following numbers must
-be sequential. This limitation may be hopefully fixed.
+inclusively contained between @var{start_number} and
+ at var{start_number}+4, all the following numbers must be
+sequential.
 
 The pattern may contain a suffix which is used to automatically
 determine the format of the images contained in the files.
@@ -57,6 +58,11 @@ second:
 ffmpeg -i 'img-%03d.jpeg' -r 10 out.mkv
 @end example
 
+As above, but start by reading from a file with index 100 in the sequence:
+ at example
+ffmpeg -start_number 100 -i 'img-%03d.jpeg' -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:
@@ -64,6 +70,23 @@ Note that the pattern must not necessarily contain "%d" or
 ffmpeg -i img.jpeg img.png
 @end example
 
+This demuxer accepts the following options:
+ at table @option
+ at item framerate
+Set the framerate for the video stream. It defaults to 25.
+ at item loop
+If set to 1, loop over the input. Default value is 0.
+ at item pixel_format
+Set the pixel format of the images to read. If not specified the pixel
+format is guessed from the first image file in the sequence.
+ at item start_number
+Set the index of the file matched by the image file pattern to start
+to read from. Default value is 1.
+ at item video_size
+Set the video size of the images to read. If not specified the pixel
+format is guessed from the first image file in the sequence.
+ at end table
+
 @section applehttp
 
 Apple HTTP Live Streaming demuxer.
diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c
index 2a74483..12884ed 100644
--- a/libavformat/img2dec.c
+++ b/libavformat/img2dec.c
@@ -382,11 +382,11 @@ static int read_close(struct AVFormatContext* s1)
 #define OFFSET(x) offsetof(VideoDemuxData, x)
 #define DEC AV_OPT_FLAG_DECODING_PARAM
 static const AVOption options[] = {
-    { "framerate",    "", OFFSET(framerate),    AV_OPT_TYPE_STRING, {.str = "25"}, 0, 0, DEC },
-    { "loop",         "", OFFSET(loop),         AV_OPT_TYPE_INT,    {.dbl = 0},    0, 1, DEC },
-    { "pixel_format", "", OFFSET(pixel_format), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC },
-    { "start_number", "first number in the sequence", OFFSET(start_number), AV_OPT_TYPE_INT, {.dbl = 1}, 0, INT_MAX, DEC },
-    { "video_size",   "", OFFSET(video_size),   AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC },
+    { "framerate",    "set the video framerate",             OFFSET(framerate),    AV_OPT_TYPE_STRING, {.str = "25"}, 0, 0, DEC },
+    { "loop",         "force loop over input file sequence", OFFSET(loop),         AV_OPT_TYPE_INT, {.dbl = 0},    0, 1, DEC },
+    { "pixel_format", "set video pixel format",              OFFSET(pixel_format), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC },
+    { "start_number", "set first number in the sequence",    OFFSET(start_number), AV_OPT_TYPE_INT, {.dbl = 1}, 0, INT_MAX, DEC },
+    { "video_size",   "set video size",                      OFFSET(video_size),   AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC },
     { NULL },
 };
 
-- 
1.7.5.4



More information about the ffmpeg-devel mailing list