[FFmpeg-devel] [PATCH] lavf/image2: extend start_number range to accept zero

Stefano Sabatini stefasab at gmail.com
Thu Aug 22 10:10:30 CEST 2013


Fix trac issue #2874.
---
 doc/muxers.texi       | 2 +-
 libavformat/img2enc.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/muxers.texi b/doc/muxers.texi
index 4fa9f11..04c0daf 100644
--- a/doc/muxers.texi
+++ b/doc/muxers.texi
@@ -260,7 +260,7 @@ ffmpeg -i in.avi -f image2 -frames:v 1 img.jpeg
 @table @option
 @item start_number @var{number}
 Start the sequence from @var{number}. Default value is 1. Must be a
-positive number.
+non negative number.
 
 @item -update @var{number}
 If @var{number} is nonzero, the filename will always be interpreted as just a
diff --git a/libavformat/img2enc.c b/libavformat/img2enc.c
index 7b10623..11223fb 100644
--- a/libavformat/img2enc.c
+++ b/libavformat/img2enc.c
@@ -142,7 +142,7 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
 static const AVOption muxoptions[] = {
     { "updatefirst",  "continuously overwrite one file", OFFSET(update),  AV_OPT_TYPE_INT, { .i64 = 0 }, 0,       1, ENC },
     { "update",       "continuously overwrite one file", OFFSET(update),  AV_OPT_TYPE_INT, { .i64 = 0 }, 0,       1, ENC },
-    { "start_number", "set first number in the sequence", OFFSET(img_number), AV_OPT_TYPE_INT,  { .i64 = 1 }, 1, INT_MAX, ENC },
+    { "start_number", "set first number in the sequence", OFFSET(img_number), AV_OPT_TYPE_INT,  { .i64 = 1 }, 0, INT_MAX, ENC },
     { "strftime",     "use strftime for filename", OFFSET(use_strftime), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, ENC },
     { NULL },
 };
-- 
1.8.1.2



More information about the ffmpeg-devel mailing list