[Libav-user] Using avformat_open_input with an image sequence that doesn't start at zero

gga ggarra13 at gmail.com
Fri Jan 31 01:05:26 EET 2020

On 30/1/20 18:50, Jonathan Noble wrote:
> What must I do to open an image sequence that doesn't start at zero?
AVDictionary* opts = NULL;

char buf[64];

int64_t frameStart = 20; // your number goes here

sprintf( buf, "%" PRId64, frameStart );
av_dict_set(&opts, "start_number", buf, 0);

// Set:
// AVFormatContext* _context;           //!< current read file context
// Set fileroot() to your image full pathname, like: /mydir/test.%04d.exr

int err = avformat_open_input( &_context, fileroot(),
                                 NULL, &opts );

// Use av_read_frame() and others as usual.

Gonzalo Garramuño

More information about the Libav-user mailing list