[MPlayer-dev-eng] [PATCH] using mplayer with ffmpeg asf stream

Dominique Andre Gunia Dominique.Gunia at schunter.etc.tu-bs.de
Thu Oct 30 00:54:32 CET 2003


On Wed, 2003-10-29 at 22:42, Bertrand Baudet wrote:

Hi!

This stream can be played with MS WMP (WinXP) without any problems.
Thats the reason why I though mplayer should be able to play this, too
:)

I looked at the source code of asfrecorder.sf.net now. It also does not
work with this asf stream until I changed the code to recognize
video/x-ms-asf as video stream, not as redirector.

That lets me believe, ffmpeg is wrong in sending it as Content-Type for
the asf stream, but then I do not understand how MS WMP can play this
stream. 

I now have also found that ffmpeg changed the Content-Type from
application/octet-stream to video/x-ms-asf in Dezember 2002:

> (File libavformat/asf.c)
>  Revision 1.36 / (download) - annotate - [select for diffs] , Fri Dec 
> 20 23:10:58 2002 UTC (10 months, 1 week ago) by michaelni
> Branch: MAIN
> CVS Tags: release_0_4_6
> Changes since 1.35: +2 -2 lines
> Diff to previous 1.35
> 
> mimetype fixes patch by (Ryutaroh Matsumoto <ryutaroh at it dot ss dot
> titech dot ac dot jp>)

So probably there was a reason to change this. I will try to ask them
why they changed it.

So probably something has to be changed in mplayer to behave like the MS
WMP?

Regards,
Dominique

> Hi,
> 
> I'm not sure it's ok!
> 
> Did you try to connect to a server that redirect you by sending the same mime 
> type? I'm not sure it's going to work with your patch.
> 
> In addition, I haven't seen a MS WMS that is sending this mime type for a live 
> stream.
> Did you try to connect a MS WMP to this stream? did it work?
> 
> Please verify that all cases are handled properly.
> 
> Bertrand
> 
> On Wednesday 29 October 2003 12:53, Dominique Andre Gunia wrote:
> > 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. The
> > problem is, that mplayer thinks the asf file would be a playlist because
> > of an unknown Content-Type. Details follow:
> >
> > 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:
> >
> > --- main/libmpdemux/asf_streaming.c     2003-09-25 02:36:04.000000000 +0200
> > +++ main.patched/libmpdemux/asf_streaming.c     2003-10-29
> > 12:44:32.000000000 +0100 @@ -421,7 +421,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");
> >
> >
> > everything is fine. 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
> 
> _______________________________________________
> MPlayer-dev-eng mailing list
> MPlayer-dev-eng at mplayerhq.hu
> http://mplayerhq.hu/mailman/listinfo/mplayer-dev-eng




More information about the MPlayer-dev-eng mailing list