[Libav-user] av_open_input_stream() with the new API

Michael IV explomaster at gmail.com
Wed Sep 27 12:19:48 EEST 2017

I am trying to open input stream,and I found an example which seems to be pretty

old : https://lists.libav.org/pipermail/libav-user/2009-May/003034.html

So I am moving step by step converting the old API to the new one.

Now I have this part:

AVFormatParameters params, *ap = ¶ms;
    memset(ap, 0, sizeof(*ap));
    ap->time_base.num = 1;
    ap->time_base.den = 25;

    DEBUG << "Opening stream" << endlog;

    if( av_open_input_stream( &ic, &io, "",
                              fmt, ap ) )
        DEBUG << "Can't open input stream " << endlog;
        return 0;


I see that instead of AVFormatParameters I should use AVDictionary.
But withint the

context struct I can't see any options like time_base.num or den,which
if I get it right,

set frame rate of the incoming stream.

So how do I pass the frame rate into this dictionary?

I also noticed that in almost every possible example in the web NULL
is passed instead

of the dictionary.Is it optional?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20170927/7eaa4117/attachment.html>

More information about the Libav-user mailing list