[Ffmpeg-devel] [C API] Add suport for ifstreams

Jaime Corvera Vargas inf220
Tue Sep 5 14:35:38 CEST 2006

Fran?ois Revol wrote:
>> i need to open istreams to decode some files.
> I did something alike long ago:
> http://thread.gmane.org/gmane.comp.video.ffmpeg.devel/26784/focus=26788

Wow, Great!
That is what im looking for! i can understand what is to be done but not
fully how. I was going to just overwrite the file.c with my protocol.
But it seem that i can also have a file(containing the protocol) that i
can simply add an use?

One question:
after i write my own URL Protocol... how do i use it?
do i simply register it and use FFMPEG as normal?

I've been only using the "av_open_input_file" until now.
or do i have to use another function for passing the stream? Lets say i
have this code, where do i change it?
thanks for the insight!

 AVFormatContext *pFormatCtx;
char* filename="example.avi";

//how do  i use this?
istream myStream("example.avi");

    // Register all formats and codecs

    // Open video file
    if(av_open_input_file(&pFormatCtx, filename, NULL, 0, NULL)!=0)
        return -1; // Couldn't open file

[...codec finding and further stuff...]

More information about the ffmpeg-devel mailing list