[Ffmpeg-devel] [RFC] mms support

Ryan Martell rdm4
Sat Nov 25 04:37:17 CET 2006


On Nov 14, 2006, at 10:54 PM, Ryan Martell wrote:

> Hi...
>
> I was looking at adding mms support to ffmpeg.

So I have this somewhat working.

> I have downloaded libmms from sourceforge, which claims to be  
> LGPL'd, with all permissions gained.  Unfortunately, it still  
> linked against the Glib Gnet, which is GPL.  I have now ripped out  
> the dependency (simply parsing of the uri and byteswapping), so it  
> should be totally LGPL.  With the VC1 codec stuff working as well  
> as it does, this would allow ffmpeg to natively support streaming  
> WM files..

I took the libmms as mentioned, created an AVInputFormat for mms, and  
linked the two together.  I unfortunately had to include a lot of  
duplicate code from asf.c.  Furthermore, I currently preallocate the  
entire video based on it's size, and read into that.  Needless to  
say, that doesn't work for streaming (where the size isn't known).

Also, although the asf packet size is fixed, the speed at which they  
are consumed is variable, which means that knowing how much to read  
from the tcp port is somewhat problematic (maintaining a buffer ahead  
of where you currently are (this is also a problem for me on h264  
streaming, as if the connection isn't fast enough, since there isn't  
an idea of prebuffering, i can stall when I run out of data)).

> I know I would need to add another protocol handler, but I'm  
> curious how to wire that up to work in conjuction with the asf code  
> (which is what I would need to use to parse the header).

I'm wondering if I should have setup a URLProtocol for mms, which  
would then allow me to not use any of the asf code (it would handle  
it in place)?

If I do that, what's the best way to read network data, which can be  
used at a completely different rate from the playback data?   A  
separate thread?

Or is all of this stuff things that should be done above ffmpeg,  
since real time playback isn't (or is it?) a design criteria for  
ffmpeg?  As it stands now, the packet data is setup right, so you  
could conceivably transcode an mms stream into some other format.

Thanks,
-Ryan




More information about the ffmpeg-devel mailing list