gingerbeur / google-cast-sdk

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

HLS live stream sequence number tolerance #397

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Problem description
Sometimes when starting one of our HLS live streams the chromecast fails to 
start and the debug console returns the following error:
HOST ERROR - Fatal Error: code = 1

What steps will reproduce the problem?
1. Play our HLS live stream (on certain moments)

What version of the product are you using? On what operating system?
We are using Cast Media Library v1.0.0 and Cast Receiver v2.0.0 on a Custom 
Receiver page

Please provide any additional information below.
Investigating this problem further seems to indicate that this behaviour is 
caused by the chromecast switching variants of our live stream.
As expected the chromecast starts to stream the first variant stream in our 
index.m3u8 and then quickly switches to the highest bitrate variant.

However every time the highest bitrate (variant2.m3u8 in this case) file 
contains a lower sequence number (because of CDN caching) then the previously 
loaded variant (variant0.m3u8) the chromecast stops playing with the error 
mentioned above. As far as we know now this variance between playlists is 
allowed within the HLS specifications and also plays perfectly on any iOS 
device.

The following are the contents of the mentioned playlists (sensitive 
information removed):

Index.m3u8 contents:

#EXTM3U
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=627168,RESOLUTION=0x0
/Variant0.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1696512,RESOLUTION=0x0
/Variant1.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=2538752,RESOLUTION=0x0
/Variant2.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=431648,RESOLUTION=0x0
/Variant3.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=78208,RESOLUTION=0x0
/Variant4.m3u8

Variant0.m3u8 contents:

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:7
#EXT-X-MEDIA-SEQUENCE:2065230
#EXT-X-KEY:METHOD=AES-128,URI="/key01.key"
#EXTINF:6,
http://hostname.nl/stream/0_segment_2065230_20141002190104.ts
#EXT-X-KEY:METHOD=AES-128,URI="/key02.key"
#EXTINF:6,
http://hostname.nl/stream/0_segment_2065231_20141002190111.ts
#EXT-X-KEY:METHOD=AES-128,URI="/key03.key"
#EXTINF:6,
http://hostname.nl/stream/0_segment_2065232_20141002190117.ts

Variant2.m3u8 contents:

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:7
#EXT-X-MEDIA-SEQUENCE:2065229
#EXT-X-KEY:METHOD=AES-128,URI="/key21.key"
#EXTINF:6,
http://hostname.nl/stream/2_segment_2065229_20141002190101.ts
#EXT-X-KEY:METHOD=AES-128,URI="/key22.key"
#EXTINF:6,
http://hostname.nl/stream/2_segment_2065230_20141002190107.ts
#EXT-X-KEY:METHOD=AES-128,URI="/key23.key"
#EXTINF:6,
http://hostname.nl/stream/2_segment_2065231_20141002190113.ts

Original issue reported on code.google.com by s...@stefkampen.nl on 3 Oct 2014 at 10:29

GoogleCodeExporter commented 9 years ago
Could you please set logging level to debug

cast.player.api.setLoggerLevel(cast.player.api.LoggerLevel.DEBUG);

and post the log from the beginning of playback leading up to the error.

Original comment by vadi...@google.com on 6 Oct 2014 at 8:30

GoogleCodeExporter commented 9 years ago

Original comment by and...@google.com on 6 Oct 2014 at 10:38

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Attached you will find the log. Please note that this is from a different 
moment in the stream and covering the same situation. For this public log I 
have replaced all the sensitive names with dummy names.

I can provide you with private access to the stream if that would be helpful.

Original comment by s...@stefkampen.nl on 7 Oct 2014 at 7:59

Attachments:

GoogleCodeExporter commented 9 years ago
Same issue. Hope it will be fixed now.
https://code.google.com/p/google-cast-sdk/issues/detail?id=347

Original comment by etherwi...@gmail.com on 9 Oct 2014 at 3:37

GoogleCodeExporter commented 9 years ago
Did you have any chance to review my information?

Original comment by s...@stefkampen.nl on 17 Nov 2014 at 3:50

GoogleCodeExporter commented 9 years ago
As mentioned in 347, your streams need consistency in their sequence numbers 
across your variants. Your segments are also not time aligned. 

Original comment by and...@google.com on 17 Nov 2014 at 11:02