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

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Michael IV
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 = &params;
    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?


_______________________________________________
Libav-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/libav-user
Reply | Threaded
Open this post in threaded view
|

Re: av_open_input_stream() with the new API

Carl Eugen Hoyos-2
2017-09-27 11:19 GMT+02:00 Michael IV <[hidden email]>:
> 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

This looks outdated.
Did you look at the examples in doc/examples ?

Carl Eugen
_______________________________________________
Libav-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/libav-user
Reply | Threaded
Open this post in threaded view
|

Re: av_open_input_stream() with the new API

Michael IV
What I understood from doc/examples/muxing.c is that it operates on YUV frames.
My data is raw h264 NALUs stream from NVENC and I want mux those directly into TS adding audio frames .


On Wed, Sep 27, 2017 at 1:36 PM, Carl Eugen Hoyos <[hidden email]> wrote:
2017-09-27 11:19 GMT+02:00 Michael IV <[hidden email]>:
> 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

This looks outdated.
Did you look at the examples in doc/examples ?

Carl Eugen
_______________________________________________
Libav-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/libav-user


_______________________________________________
Libav-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/libav-user
Reply | Threaded
Open this post in threaded view
|

Re: av_open_input_stream() with the new API

Michael IV
Ok,I think I got it.In my case I have to useĀ av_parser_parse2() to get h264 frame into packet,then mux into interleaved frame.

On Wed, Sep 27, 2017 at 1:46 PM, Michael IV <[hidden email]> wrote:
What I understood from doc/examples/muxing.c is that it operates on YUV frames.
My data is raw h264 NALUs stream from NVENC and I want mux those directly into TS adding audio frames .


On Wed, Sep 27, 2017 at 1:36 PM, Carl Eugen Hoyos <[hidden email]> wrote:
2017-09-27 11:19 GMT+02:00 Michael IV <[hidden email]>:
> 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

This looks outdated.
Did you look at the examples in doc/examples ?

Carl Eugen
_______________________________________________
Libav-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/libav-user



_______________________________________________
Libav-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/libav-user