[MPlayer-users] Playing m3u8 playlist with additional token parameters
Reza Rizvi
rezilient at gmail.com
Thu Apr 18 18:01:34 CEST 2013
Hi Reimar,
First of all thanks for your reply!
When I try other "non-protected" HLS streams using the "playlist" parameter
it seems to work better because I can actually see the "chunks" (excuse
non-technical terminology) coming in. For example (only pasting the
important bits):
-------
> mplayer -user-agent 'Apple-iPhone3C1/801.293' -noconsolecontrols -nocache
-nolirc -nomouseinput -identify -vo null -ao null -frames 0 -v -playlist
http://akamedia2.lsops.net/live/smil:presstv_en.smil/playlist.m3u8
--- HTTP DEBUG HEADER --- START ---
protocol: [HTTP/1.0]
http minor version: [0]
uri: [(null)]
method: [(null)]
status code: [200]
reason phrase: [OK]
body size: [409]
Fields:
0 - Content-Type: application/vnd.apple.mpegurl
1 - Server: FlashCom/3.5.7
2 - Content-Length: 409
3 - Expires: Thu, 18 Apr 2013 15:07:54 GMT
4 - Cache-Control: max-age=0, no-cache, no-store
5 - Pragma: no-cache
6 - Date: Thu, 18 Apr 2013 15:07:54 GMT
7 - Connection: close
--- HTTP DEBUG HEADER --- END ---
get_path('chunklist-b320000.m3u8?wowzasessionid=1693899595.conf') ->
'/root/.mplayer/chunklist-b320000.m3u8?wowzasessionid=1693899595.conf'
Playing
http://akamedia2.lsops.net/live/smil:presstv_en.smil/chunklist-b320000.m3u8?wowzasessionid=1693899595
.
get_path('sub/') -> '/root/.mplayer/sub/'
Filename for url is now
http://akamedia2.lsops.net/live/smil:presstv_en.smil/chunklist-b320000.m3u8?wowzasessionid=1693899595
Filename for url is now
http://akamedia2.lsops.net/live/smil:presstv_en.smil/chunklist-b320000.m3u8?wowzasessionid=1693899595
STREAM_HTTP(1), URL:
http://akamedia2.lsops.net/live/smil:presstv_en.smil/chunklist-b320000.m3u8?wowzasessionid=1693899595
-------
However if I leave off the -playlist option it does not start downloading
the "chunklist". Notice the difference in the "get_path()" command.
-------
> mplayer -user-agent 'Apple-iPhone3C1/801.293' -noconsolecontrols -nocache
-nolirc -nomouseinput -identify -vo null -ao null -frames 0 -v
http://akamedia2.lsops.net/live/smil:presstv_en.smil/playlist.m3u8
get_path('playlist.m3u8.conf') -> '/root/.mplayer/playlist.m3u8.conf'
Playing http://akamedia2.lsops.net/live/smil:presstv_en.smil/playlist.m3u8.
get_path('sub/') -> '/root/.mplayer/sub/'
Filename for url is now
http://akamedia2.lsops.net/live/smil:presstv_en.smil/playlist.m3u8
Filename for url is now
http://akamedia2.lsops.net/live/smil:presstv_en.smil/playlist.m3u8
STREAM_HTTP(1), URL:
http://akamedia2.lsops.net/live/smil:presstv_en.smil/playlist.m3u8
Resolving akamedia2.lsops.net for AF_INET6...
Couldn't resolve name for AF_INET6: akamedia2.lsops.net
Resolving akamedia2.lsops.net for AF_INET...
Connecting to server akamedia2.lsops.net[165.254.24.161]: 80...
--- HTTP DEBUG HEADER --- START ---
protocol: [HTTP/1.0]
http minor version: [0]
uri: [(null)]
method: [(null)]
status code: [200]
reason phrase: [OK]
body size: [405]
Fields:
0 - Content-Type: application/vnd.apple.mpegurl
1 - Server: FlashCom/3.5.7
2 - Content-Length: 405
3 - Expires: Thu, 18 Apr 2013 15:10:48 GMT
4 - Cache-Control: max-age=0, no-cache, no-store
5 - Pragma: no-cache
6 - Date: Thu, 18 Apr 2013 15:10:48 GMT
7 - Connection: close
--- HTTP DEBUG HEADER --- END ---
Content-Length: [405]
Content-Type: [application/vnd.apple.mpegurl]
Cache size set to 0 KBytes
STREAM: [null]
http://akamedia2.lsops.net/live/smil:presstv_en.smil/playlist.m3u8
STREAM: Description: http streaming
STREAM: Author: Bertrand, Albeau, Reimar Doeffinger, Arpi?
STREAM: Comment: plain http
Stream not seekable!
LAVF_check: no clue about this gibberish!
Checking for YUV4MPEG2
ASF_check: not ASF guid!
Checking for REAL
Checking for SMJPEG
Searching demuxer type for filename
http://akamedia2.lsops.net/live/smil:presstv_en.smil/playlist.m3u8 ext:
.m3u8
Checking for Nullsoft Streaming Video
Checking for MOV
Checking for VIVO
header block 1 size: 69
AVS: avs_check_file - attempting to open file
http://akamedia2.lsops.net/live/smil:presstv_en.smil/playlist.m3u8
AVS: failed to load avisynth.dll
AVS: Init failed
Checking for PVA
Checking for MPEG-TS...
COULDN'T READ ENOUGH DATA, EXITING TS_CHECK
Stream not seekable!
-------
So this is why I am using the "playlist" parameter.
Regarding the WMSAuth module, I'm still confused how I can pass the token
to the destination server successfully? The WMSAuth module is just looking
for a proper "key" to gain access to the file. Once it gets through the
front door, there is no more additional authentication required (unless you
disconnect and try connecting again). Also the key is valid for 2 minutes.
The 403 Forbidden message tells me the destination server is not receiving
the key.
Upon comparing a wireshark on my laptop using VLC (where the stream works)
and on my linux machine using MPlayer I'm not seeing any differences except
the working on returns with HTTP status 200 and the non-working on returns
with status 403 Forbidden. I can send the pcap if someone could take a
look?
Thanks.
- Reza
On Mon, Apr 15, 2013 at 2:52 AM, Reimar Döffinger
<Reimar.Doeffinger at gmx.de>wrote:
> On Fri, Apr 12, 2013 at 12:28:18AM -0400, Reza Rizvi wrote:
> > Hello.
> >
> > I am trying to TEST a Live HLS stream (m3u8 playlist) using MPlayer on
> > Linux. Here is the command I'm using to test the stream:
> >
> > mplayer -user-agent 'Apple-iPhone3C1/801.293' -noconsolecontrols -nocache
> > -nolirc -nomouseinput -identify -vo null -ao null -frames 0 -v -playlist
> >
> http://streamer.website.com/tv/channelfive/playlist.m3u8?wmsAuthSign=c2VydmVyX3RpbWU9NC8xMi8yMDEzIDQ6MTI6MTAgQU0maGFzaF92YWx1ZT1hcVZoRG1RVElzNVBVVTFkdWkrVEtnPT0mdmFsaWRtaW51dGVzPTI=
> >
> > You will notice the "wmsAuthSign" and then a token, this is because the
> > streamer is using the WMSAuth plugin for Wowza (http://www.wmsauth.org).
> > The streamer is our partner so we have a valid token and I am able to
> play
> > the streams fine using VLC and other methods using a valid token.
> >
> > The problem is MPlayer is not allowing this token in the command line.
> >
> > Here is the output that I'm seeing:
> >
> > Connecting to server streamer37.eboundservices.com[146.185.20.106]:
> 80...
> > --- HTTP DEBUG HEADER --- START ---
> > protocol: [HTTP/1.0]
> > http minor version: [0]
> > uri: [(null)]
> > method: [(null)]
> > status code: [403]
> > reason phrase: [Forbidden]
> > body size: [0]
> > Fields:
> > 0 - Server: FlashCom/3.5.7
> > 1 - Content-Length: 0
> > --- HTTP DEBUG HEADER --- END ---
> > Server returned 403: Forbidden
> >
> > No stream found to handle url
> >
> http://streamer.website.com/tv/channelfive/playlist.m3u8?wmsAuthSign=c2VydmVyX3RpbWU9NC8xMi8yMDEzIDQ6MTI6MTAgQU0maGFzaF92YWx1ZT1hcVZoRG1RVElzNVBVVTFkdWkrVEtnPT0mdmFsaWRtaW51dGVzPTI=
> >
> > Error while opening playlist file
> >
> http://streamer.website.com/tv/channelfive/playlist.m3u8?wmsAuthSign=c2VydmVyX3RpbWU9NC8xMi8yMDEzIDQ6MTI6MTAgQU0maGFzaF92YWx1ZT1hcVZoRG1RVElzNVBVVTFkdWkrVEtnPT0mdmFsaWRtaW51dGVzPTI=
> :
> > Operation now in progress
> >
> > Error parsing option on the command line: -playlist
> >
> >
> > Notice the "403 forbidden" code, this occurs when the WMSAuth model is
> not
> > accepting the token. I'm assuming MPlayer is not treating this URL as a
> > valid one for HLS due to the extra token parameters. Is there any way to
> > make this work? We are trying to build a testing script that will
> evaluate
> > if the streams are working periodically and it works great for
> > "non-protected" streams but we're having trouble with this WMSAuth model.
>
> First, HLS is not a playlist format, if you try to play it as playlist
> it's not going to work well.
> More proper support is available by playing via FFmpeg (prepend
> ffmpeg:// to the URL).
> The next thing is that the URL in either way will just be passed on
> as-is, so it should be working just fine - for fetching the playlist.
> However if you always return the same playlist and expect that parameter
> to also be passed to the main file URLs or that MPlayer preserves
> cookies the server tries to set that isn't going to work, you'd have
> to return an individual playlist item that contains the proper
> wmsAuthSign - however I don't think that scheme can work since it relies
> on the request being made immediately after receiving the URL from the
> server, so it can't really work for HLS if you want to protect more
> than the playlist itself.
> Either way you can use programs like wireshark or tcpdump to check what
> requests MPlayer makes and if they are what you expect.
> Interestingly none of the examples for this scheme use HLS, so I am not
> sure anyone
> ever thought about how to use it there...
> _______________________________________________
> MPlayer-users mailing list
> MPlayer-users at mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/mplayer-users
>
More information about the MPlayer-users
mailing list