[MPlayer-users] using mplayer with ffmpeg asf stream

Dominique Andre Gunia Dominique.Gunia at schunter.etc.tu-bs.de
Wed Oct 29 12:35:30 CET 2003


Hi!

I set up a stream with ffmpeg/ffserver (ffmpeg.sourceforge.net). It
creates an asf stream that I would like to view with mplayer. When
started, I get the following result

> dom at tng:/tmp$ mplayer -nocache http://schuntille:8090/test.asf
> [...]
> Playing http://schuntille:8090/test.asf
> Resolving schuntille ...
> Connecting to server schuntille[134.169.169.6]:8090 ...
> Resolving schuntille ...
> Connecting to server schuntille[134.169.169.6]:8090 ...
> =====> ASF Redirector
> Connected to server: schuntille
> 
> 
> MPlayer interrupted by signal 2 in module: handle_playlist

The http-protocol is something like this:

> dom at tng:/tmp/MPlayer-0.92$ telnet schuntille 8090
> Trying 134.169.169.6...
> Connected to schuntille.schunter.etc.tu-bs.de.
> Escape character is '^]'.
> GET /test.asf HTTP/1.0
> Host: schuntille
> 
> HTTP/1.0 200 OK
> Pragma: no-cache
> Server: Cougar 4.1.0.3923
> Cache-Control: no-cache
> Pragma: client-id=1908046342
> Pragma: features="broadcast"
> Content-Type: video/x-ms-asf

As you can see the Content-Type is video/x-ms-asf but mplayer expects
one of these (defined in libmpdemux/asf_stream.c):

> if(!strcasecmp(content_type, "application/octet-stream") ||
> !strcasecmp(content_type, "application/vnd.ms.wms-hdr.asfv1") || 
> !strcasecmp(content_type, "application/x-mms-framed") )

Since this content type is not defined, it uses the default behaviour,
which thinks this is a redirector for some browser and tries to parse it
as playlist, which is simply wrong.

When I patch the file like this (used with 0.92 but everything here
works the same with 1.0pre2):

--- MPlayer-0.92/libmpdemux/asf_streaming.c     2003-09-25 12:29:59.000000000 +0200
+++ MPlayer-0.92.patched/libmpdemux/asf_streaming.c     2003-10-29 12:19:52.000000000 +0100
@@ -414,7 +414,8 @@
        if( content_type==NULL ) return ASF_Unknown_e;
        if(     !strcasecmp(content_type, "application/octet-stream") ||
                !strcasecmp(content_type, "application/vnd.ms.wms-hdr.asfv1") ||        // New in Corona, first request
-               !strcasecmp(content_type, "application/x-mms-framed") ) {               // New in Corana, second request
+               !strcasecmp(content_type, "application/x-mms-framed") ||                // New in Corana, second request
+               !strcasecmp(content_type, "video/x-ms-asf")) {

                if( strstr(features, "broadcast") ) {
                        mp_msg(MSGT_NETWORK,MSGL_V,"=====> ASF Live stream\n");

it all works. The output is

> Playing http://schuntille:8090/test.asf
> Resolving schuntille ...
> Connecting to server schuntille[134.169.169.6]:8090 ...
> Resolving schuntille ...
> Connecting to server schuntille[134.169.169.6]:8090 ...
> Resolving schuntille ...
> Connecting to server schuntille[134.169.169.6]:8090 ...
> Cache size set to 0 KBytes
> Connected to server: schuntille
> Stream not seekable!
> ASF file format detected.

Is this a bug in ffmpeg or in mplayer? If it is a bug in mplayer, could
you please use this patch for further versions? I found serveral users
having this problem and no one knew a solution.

Thanks very much!

Regards,
Dominique




More information about the MPlayer-users mailing list