Page 1 of 1

How to bypass av_open_input_file

Posted: Tue Jan 10, 2012 2:12 pm
by francesco
Hi to all
up to now I used the subsequent code for initializing the AVFormatContext structure
before decoding an image (mpeg2 one):

AVFormatContext *pFormatCtx;
av_init_packet(&packet);

if(av_open_input_file(&pFormatCtx,filename.c_str(),NULL,0,NULL)!=0)
{Memo1->Lines->Add("Error opening file"); goto end_conv;}

in this way all the job is done by av_open_input_file. Now If I have the stream in a
buffer (yet loaded), how can I initialize the AVFormatContext structure starting from a buffer ? :?:

Re: How to bypass av_open_input_file

Posted: Tue Jan 10, 2012 2:43 pm
by Akad
You can use init_put_byte/av_open_input_stream. Read this tutorial.

Re: How to bypass av_open_input_file

Posted: Mon Jan 16, 2012 8:47 am
by Vladimir
This method is obsolete in the latest versions.
One should use AVIOContext instead