lihaosky / google-cast-sdk

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

Brain freeze during playback of ffmpeg generated HLS streams under Media Player 0.9 #360

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Download, adjust m3u8 file, and host 
https://www.dropbox.com/sh/hxr2kyxs64or6qi/AACmNoAB3hf-jOzIkVSUKEW1a
2. Cast to a receiver using media player library 0.9

What is the expected output? What do you see instead?
The video should play to the end without crashing the Chromecast, instead it 
plays for a around 30 seconds and then crashes.

This HLS stream was generated using ffmpeg by segmenting 
big_buck_bunny_1080p_h264.mov from 
http://www.bigbuckbunny.org/index.php/download/

The original file plays just fine, but when played back under 0.9 as a HLS 
stream it results in a brain freeze.

I also have a number of videos that playback as HLS streams under media player 
0.5 just fine, but crash after a period of time under 0.6-0.9. Although I can't 
really share them with you, I'm hoping that once this issue is fixed my other 
videos will be able to be played back on the newer version of the media player 
library.

What version of the product are you using? On what operating system?
Chromecast version 17977, Media Player Library version 0.9

Please provide any additional information below.

Original issue reported on code.google.com by willlunn...@gmail.com on 14 Aug 2014 at 6:02

GoogleCodeExporter commented 9 years ago
What receiver are you using?

Original comment by anad...@google.com on 14 Aug 2014 at 6:05

GoogleCodeExporter commented 9 years ago
Sorry, should have said it is a custom reciever using 
https://www.gstatic.com/cast/sdk/libs/receiver/2.0.0/cast_receiver.js

Original comment by willlunn...@gmail.com on 14 Aug 2014 at 6:08

GoogleCodeExporter commented 9 years ago
At what bitrate was the content encoded?  Some segments are fairly large, e.g. 
segment00002.ts is over 27 MB.

Original comment by vadi...@google.com on 14 Aug 2014 at 6:11

GoogleCodeExporter commented 9 years ago
I'm not sure tbh, I picked this video as I'm able to distribute it. The 
non-segmented version plays back OK, and the segmentation process does not 
re-encode the video, so I would have thought the hardware can cope with it.

Original comment by willlunn...@gmail.com on 14 Aug 2014 at 6:15

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
You should stay at 8Mbps or less which puts a 10 second segment at around 10 
MB.  Setting the source of the the video element directly is different than 
using segmented streaming (which uses Media Source Extensions), so the fact 
that it works with one is not a guarantee it will work with the other.

Original comment by vadi...@google.com on 14 Aug 2014 at 6:25

GoogleCodeExporter commented 9 years ago
Is that documented anywhere, https://developers.google.com/cast/docs/media 
doesn't seem to mention it. 

I'll try to generate a new stream to demonstrate my problem of videos playing 
under MPL 0.5 but not the newer versions. 

Original comment by willlunn...@gmail.com on 14 Aug 2014 at 6:39

GoogleCodeExporter commented 9 years ago
0.5 buffered up to 20 seconds, while 0.9 buffers up to 30 seconds. That likely 
is impacting your streams containing these large segments.  We can look into 
making buffer duration configurable.

Original comment by vadi...@google.com on 14 Aug 2014 at 7:40

GoogleCodeExporter commented 9 years ago
That could be part of the problem, although for most of my videos they play for 
a few minutes before crashing the Chromecast. Either way it would be helpful if 
the Chromecast would issue an error rather than completely crashing :)

Here is a lower bitrate one based off of big_buck_bunny_480p_h264.mov 
https://www.dropbox.com/sh/86jh53lt50n3fmj/AABUslE0UWJQy4v9CAJ54cvna which 
plays for around 3 and a half minutes before giving up.

Do you have any recommended test videos that I can convert to HLS?

Original comment by willlunn...@gmail.com on 14 Aug 2014 at 8:05

GoogleCodeExporter commented 9 years ago
The size for segment00054.ts (13.69 MB) and segment00055.ts (12.45 MB) still 
seems too high.  For some reason your segmenter is not creating segment files 
with uniform sizes.

Original comment by vadi...@google.com on 14 Aug 2014 at 8:13

GoogleCodeExporter commented 9 years ago
Its creating segments with roughtly equal length (10 seconds), while keeping 
the original video stream which will have a variable bitrate. Those segments 
are for the end credits where there is a lot of motion. However, that is 9+ 
minutes into the stream, and the Chromecast only plays for about 3 and a half, 
and looking at the network tab hasn't gone anywhere near those segments yet. 

Original comment by willlunn...@gmail.com on 14 Aug 2014 at 8:17

GoogleCodeExporter commented 9 years ago
There is likely an issue with how the content is segmented.  I'm not able to 
play through the second repro.  When played, there are time gaps created in the 
source buffer that Chrome doesn't jump over, i.e.  

[cast.player.core.SourceBufferManager] 0: 43.8390007019043 - 49.8763313293457"
[cast.player.core.SourceBufferManager] 0: 49.983001708984375 - 
59.71099853515625"
[cast.player.core.SourceBufferManager] 0: 59.98833465576172 - 
69.65233612060547", [cast.player.core.SourceBufferManager] 0: 69.99366760253906 
- 82.5163345336914",

Original comment by vadi...@google.com on 14 Aug 2014 at 9:47

GoogleCodeExporter commented 9 years ago
Has anything changed related to the handling of these gaps since 0.5, or is it 
still likely to be the buffer size.

I'll try to put together some sample clips that aren't supported by Chromecast 
natively and have to be transcoded to HLS.

Original comment by willlunn...@gmail.com on 15 Aug 2014 at 7:10

GoogleCodeExporter commented 9 years ago
Segments in your stream are too large.

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

GoogleCodeExporter commented 9 years ago
My problem is this. Months ago I looked at the official documentation (which 
said and still says nothing about bitrate limits) and decided to go with HLS as 
it was already supported by the server software my app uses. I then played some 
test videos with the default receiver and everything worked just fine, so I 
built a custom receiver which again could play all my test videos. I then send 
a preview out to 20 or so alpha testers and over the last few months, they 
haven't reported a single video that wouldn't play back. I've now updated to 
the latest version, and most of my videos no longer play back consistantly. My 
choice is currently to stick with vesrion 0.5 of the media player library, or 
require the server to transcode the video stream (rather than just segment it) 
which I really don't want to have to do it as encoding H.264 is CPU intensive.

With regard to the segments being too large, is that really the reason for the 
last video I posted? Although two segments were >10MB, they were the segments 
from the closing credits, and my Chromecast choked up and died about 3 minutes 
in, it hadn't gone anywhere near them yet.

Original comment by willlunn...@gmail.com on 10 Sep 2014 at 6:50