oralodabas / google-cast-sdk

Automatically exported from code.google.com/p/google-cast-sdk
0 stars 0 forks source link

HLS X-KEY error #367

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
1. have #EXT-X-KEY:METHOD=NONE in the header of your m3u8
2. getting an error:  [ 11.443s] [cast.player.hls.HlsParser] Unexpected 
EXT-X-KEY: state 3

getting the above error.

What version of the product are you using? On what operating system?
Android, iOS & JS

When removing this header completely solves the issue

Original issue reported on code.google.com by o...@shafranet.com on 27 Aug 2014 at 8:05

GoogleCodeExporter commented 9 years ago
Could you please attach the m3u8 file in question?

Original comment by vadi...@google.com on 2 Sep 2014 at 5:23

GoogleCodeExporter commented 9 years ago
the main m3u8:

#EXTM3U
#EXT-X-VERSION:4
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio",NAME="deu",DEFAULT=YES,AUTOSELECT=YES,L
ANGUAGE="deu",URI="Stream(02)/index.m3u8"
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=868982,CODECS="avc1.77.21",RESOLUTION=4
80x270,AUDIO="audio"
Stream(01)/index.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1418678,CODECS="avc1.77.30",RESOLUTION=
640x360,AUDIO="audio"
Stream(03)/index.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=2118569,CODECS="avc1.100.30",RESOLUTION
=720x404,AUDIO="audio"
Stream(04)/index.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=2619221,CODECS="avc1.100.31",RESOLUTION
=960x540,AUDIO="audio"
Stream(05)/index.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=3618482,CODECS="avc1.100.31",RESOLUTION
=1280x720,AUDIO="audio"
Stream(06)/index.m3u8

and a child m3u8:
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:4
#EXT-X-MEDIA-SEQUENCE:352562904
#EXTINF:4,
#EXT-X-KEY:METHOD=NONE
#EXT-X-PROGRAM-DATE-TIME:2014-09-09T08:33:38Z
Segment(14102516180000000)/segment.ts
#EXTINF:4,
Segment(14102516220000000)/segment.ts
#EXTINF:4,
Segment(14102516260000000)/segment.ts
#EXTINF:4,
Segment(14102516300000000)/segment.ts
#EXTINF:4,
Segment(14102516340000000)/segment.ts
#EXTINF:4,
Segment(14102516380000000)/segment.ts
#EXTINF:4,
Segment(14102516420000000)/segment.ts
#EXTINF:4,
Segment(14102516460000000)/segment.ts
#EXTINF:4,
Segment(14102516500000000)/segment.ts
#EXTINF:4,
Segment(14102516540000000)/segment.ts
#EXTINF:4,
Segment(14102516580000000)/segment.ts
#EXTINF:4,
Segment(14102516620000000)/segment.ts
#EXTINF:4,
Segment(14102516660000000)/segment.ts
#EXTINF:4,
Segment(14102516700000000)/segment.ts
#EXTINF:4,
Segment(14102516740000000)/segment.ts
#EXTINF:4,
Segment(14102516780000000)/segment.ts
#EXTINF:4,
Segment(14102516820000000)/segment.ts
#EXTINF:4,
Segment(14102516860000000)/segment.ts
#EXTINF:4,
Segment(14102516900000000)/segment.ts
#EXTINF:4,
Segment(14102516940000000)/segment.ts
#EXTINF:4,
Segment(14102516980000000)/segment.ts
#EXTINF:4,
Segment(14102517020000000)/segment.ts
#EXTINF:4,
Segment(14102517060000000)/segment.ts
#EXTINF:4,
Segment(14102517100000000)/segment.ts
#EXTINF:4,
Segment(14102517140000000)/segment.ts
#EXTINF:4,
Segment(14102517180000000)/segment.ts
#EXTINF:4,
Segment(14102517220000000)/segment.ts
#EXTINF:4,
Segment(14102517260000000)/segment.ts
#EXTINF:4,
Segment(14102517300000000)/segment.ts
#EXTINF:4,
Segment(14102517340000000)/segment.ts

Original comment by o...@shafranet.com on 9 Sep 2014 at 8:36

GoogleCodeExporter commented 9 years ago
In your case, EXT-X-KEY follows #EXTINF which is rejected by media player 
library, because it's in violation of the HLS specification that states that 
the EXTINF must be followed by a url:

3.3.2.  EXTINF

   The EXTINF tag specifies the duration of a media segment.  It applies
   only to the media segment that follows it, and MUST be followed by a
   media segment URI.

Original comment by vadi...@google.com on 9 Sep 2014 at 4:35

GoogleCodeExporter commented 9 years ago
Thanks. but if I remove the EXT-X-KEY completely, it will work (even though 
EXTINF doesnt have uri afterwards) - you can see the first chunk

Original comment by o...@shafranet.com on 9 Sep 2014 at 4:59

GoogleCodeExporter commented 9 years ago
The error you saw

Unexpected EXT-X-KEY: state 3

is due to the KEY tag following EXTINF which is not in compliance with the HLS 
spec.

Original comment by vadi...@google.com on 9 Sep 2014 at 7:26

GoogleCodeExporter commented 9 years ago
This behavior is by design.

Original comment by anad...@google.com on 9 Sep 2014 at 9:50

GoogleCodeExporter commented 9 years ago
It is not clear why this BUG would not fixed...

Specification does not say that URI should be immediately after the #EXTINF tag.
and other tags like #EXT-X-KEY cannot be after EXTINF.

#EXTINF:4,
#EXT-X-KEY:METHOD=NONE
#EXT-X-PROGRAM-DATE-TIME:2014-09-09T08:33:38Z
Segment(14102516180000000)/segment.ts
#EXTINF:4,
Segment(14102516220000000)/segment.ts

This part conforms to specification because serment description is presented 
after #EXTINF tag. And file does not have #EXTINF without following segment.

Original comment by Dmitry.A...@gmail.com on 10 Sep 2014 at 1:30

GoogleCodeExporter commented 9 years ago
Please reopen this issue.

Original comment by Dmitry.A...@gmail.com on 10 Sep 2014 at 1:31

GoogleCodeExporter commented 9 years ago
Here is the wording of the spec, it seems very clear that EXTINF must be 
followed by a media segment URL.

3.3.2.  EXTINF

   The EXTINF tag specifies the duration of a media segment.  It applies
   only to the media segment that follows it, and MUST be followed by a
   media segment URI.

Original comment by vadi...@google.com on 10 Sep 2014 at 1:35

GoogleCodeExporter commented 9 years ago
Segment in problem .m3u8 file is pointed out after EXTINF tag.Isn't it?

I emphasize that spec does not specify that segment must be present in a next 
line. 

Spec describes that after each EXTINF should be segment and before segment 
should be EXTINF tag. More over, other new tags (#EXT-X-...) do not have 
restrictions for placement (for example, that they cannot be after EXTINF).

Original comment by Dmitry.A...@gmail.com on 10 Sep 2014 at 7:21

GoogleCodeExporter commented 9 years ago
Dear Chromecast SDK team,

Could you please look at this issue once again? 

Please take in account following points:
1. Sample .m3u8 file that is placed in https://developer.apple.com/streaming/ 
has structure 
where the EXT-X-BYTERANGE tag is placed right on the next line after the EXTINF 
tag.(see 
https://devimages.apple.com.edgekey.net/streaming/examples/bipbop_16x9/gear5/ifr
ame_index.m3u8)

2. Apple has a mediastreamvalidator tool 
(https://developer.apple.com/downloads/index.action?=http%20live%20streaming%20t
ools)
I used this tool to check .m3u8 files where the EXT-X-KEY tag is placed right 
after the EXTINF tag and result of check is :
"Playlist Syntax:   OK". It means that Apple does not see something wrong in 
playlist structure.

Original comment by Dmitry.A...@gmail.com on 15 Sep 2014 at 9:26

GoogleCodeExporter commented 9 years ago
We'll relax this requirement in the next media player library update.

Original comment by vadi...@google.com on 16 Sep 2014 at 5:07

GoogleCodeExporter commented 9 years ago
I asked autors of the HLS specification 
(http://tools.ietf.org/html/draft-pantos-http-live-streaming-13) and I got the 
answer: "Other tags can be between the EXTINF and the URI". It means that 
problem playlist are in agreement with spec.

Could you please forecast when this issue is planned to fix?

Original comment by Dmitry.A...@gmail.com on 17 Sep 2014 at 5:33

GoogleCodeExporter commented 9 years ago
We are planning to make this change in the next update.

Original comment by vadi...@google.com on 17 Sep 2014 at 8:36

GoogleCodeExporter commented 9 years ago
thumbs up!

Original comment by o...@shafranet.com on 17 Sep 2014 at 8:37

GoogleCodeExporter commented 9 years ago
This is in MPL 1.0

//www.gstatic.com/cast/sdk/libs/mediaplayer/1.0.0/media_player.js

Original comment by vadi...@chromium.org on 25 Sep 2014 at 4:30