How to bypass av_open_input_file

For the developers that use FFmpeg in their software.
Post Reply
francesco
Posts: 10
Joined: Tue Dec 20, 2011 3:19 pm

How to bypass av_open_input_file

Post by francesco » Tue Jan 10, 2012 2:12 pm

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 ? :?:

Akad
Posts: 2
Joined: Mon Jan 09, 2012 12:05 pm

Re: How to bypass av_open_input_file

Post by Akad » Tue Jan 10, 2012 2:43 pm

You can use init_put_byte/av_open_input_stream. Read this tutorial.

Vladimir
Posts: 29
Joined: Tue Sep 27, 2011 1:15 pm

Re: How to bypass av_open_input_file

Post by Vladimir » Mon Jan 16, 2012 8:47 am

This method is obsolete in the latest versions.
One should use AVIOContext instead

Post Reply