Never thought about it. So that would include things like streaming
from a URL, right?
I think that concept is referred to as "protocols" under FFmpeg/Libav.
Currently AVbin disables all protocols, and then enables the file
protocol.
~ Nathan
I have no plans for that, but I think I will add an "Interesting ideas
to consider" list to the web site to store ideas like this.
If you decide to implement it yourself, I would be interested to see
how it turns out.
~ Nathan
I don't know.
~ Nathan
> I was more thinking about custom io loader. Something that would be passed to avbin and avbin would use it load the data from the source instead of the normal file. And yes, it would be very useful for streaming and/or playing from zip/blob or directly from memory.
Hi Peter,
I did that once using ffmpeg directly. Just to point you in the right direction:
You first create an implementation of URProtocol (grep for it in the ffmpeg sources), providing pointers to a set of functions you implement for opening, closing, reading etc. in/from your custom data source:
extern "C" URLProtocol myProtocol = {
"myScheme", // name of the custom protocol as used in URLs
g4s_open,
g4s_read,
g4s_write,
g4s_seek,
g4s_close,
};
then you register your protocol with ffmpeg like this:
av_register_all();
register_protocol(&myProtocol);
If you now call
av_open_input_file(&_pFormatCtx, "myScheme:something", NULL, 0, NULL)!=0);
your functions (in this case "g4s_open", "g4s_read" etc.) will be called by ffmpeg as needed. In this example, you would get the string "something" as a filename. In my implementation of a generic datasource, I used the filename to get the address of a data source object (zip file reader, memory buffer, whatever) into the callback functions by using urls like "myProtocol:0fea1234" (not 64bit safe:)
Good luck, I too would like to see that feature in avbin!
Jan