KirovBvulgaru / google-cast-sdk

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

Improve media_player.js HLS support #142

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Media Player library is throwing an InvalidStateError exception using my 
sample. Other samples I have tried are working, including samples from 
http://commondatastorage.googleapis.com/cast-media-server-samples%2Fmedia.zip  
The non-working sample videos are H262 - MPEG-4 AVC (part10). I have attached a 
copy of the sample videos and the whole chromecast receiver log.

What steps will reproduce the problem?
1. Clone from github.com/googlecast the CastCompanionLibrary-android and 
Cast-Media-Player-Library-Sample and setup as documented. Register app ID with 
URL that retrieves the Cast-Media-Player-Library-Sample's 
MediaPlayerLibrarySample.html and register your Chromecast device for 
development.

2. Use CastCompanionLibrary to add Chromecast support to your android app.

3. In your android app, build your MediaInfo object and make a call to 
CastCompanionLibrary's method mVideoCastManager.startCastControllerActivity().

What is the expected output? 

Sample video playing on selected receiver.

What do you see instead?

No video, and debugging session to receiver shows exception:

 [  7.258s] [goog.net.XhrIo] Sending request [GET http://192.168.0.120/streams/hls_test/17474SD.mp4Frag1Num1.ts -1]
 media_player.js:23
 [  7.268s] [cast.player.api.Player] auto resume
 media_player.js:23
Uncaught InvalidStateError: An attempt was made to use an object that is not, 
or is no longer, usable. media_player.js:100
g.He media_player.js:100
 [  7.440s] [cast.player.api.Player] sourceclose
 media_player.js:23
 [  7.445s] [cast.player.api.Player] play
 media_player.js:23
 [  7.601s] [cast.receiver.MediaManager] Load metadata error
 cast_receiver.js:19
qb cast_receiver.js:19
ob.Bb cast_receiver.js:19
C.log cast_receiver.js:14
G cast_receiver.js:16
Z.oa cast_receiver.js:67
Lb cast_receiver.js:24
Ib cast_receiver.js:25
(anonymous function) cast_receiver.js:22
 [  7.471s] [cast.player.api.Player] error
 media_player.js:23
Ob media_player.js:23
Kb.jf media_player.js:23
wb.log media_player.js:18
Xb media_player.js:37
g.vc media_player.js:114
Fatal Error - 1 receiver_dev.html:115
 [  7.481s] [cast.player.api.Player] unload 0

Please use labels and text to provide additional information.

Original issue reported on code.google.com by gad...@gmail.com on 15 Feb 2014 at 11:38

Attachments:

GoogleCodeExporter commented 8 years ago
There was an issue with non-master playlist files in the the last media player 
library update.  We're testing a fix and will roll it out within a week.  In 
the meantime to get unblocked, you could create a master playlist file that 
would list just your single playlist.

Original comment by vadi...@google.com on 16 Feb 2014 at 4:06

GoogleCodeExporter commented 8 years ago
The workaround doesn't work. I still get the same exception. Using the same 
sample data I created a master playlist file listing just my original single 
playlist.

I will wait for the fix. Is there a notification service for releases/fixes?

Original comment by gad...@gmail.com on 16 Feb 2014 at 7:22

GoogleCodeExporter commented 8 years ago
When a fix is ready, we will add a note here; you will see an email when a new 
comment is added to this issue.

Original comment by anad...@google.com on 16 Feb 2014 at 8:06

GoogleCodeExporter commented 8 years ago
I have same issue in my project (we try add chromecast support). Chromecast 
download playlist, first segment and after that error. But this stream work 
with Android/iOS/Smart TV's.
Also when I cut same large output stream (MPEG-TS) by myself (ffmpeg segmenter) 
without re-encoding and it works. Strange behavior.

Video: H.264, High, Level: 4.1; FPS: 29,97; 720p
Audio: AAC; 5.1

Server: Nginx with CORS enabled.

XHR finished loading: "http://192.168.1.14/static/hlsdump/sgm1.ts". 
media_player.js:52
Uncaught InvalidStateError: An attempt was made to use an object that is not, 
or is no longer, usable. media_player.js:101
######### MEDIA ELEMENT ERROR [object Event] receiver.html:151
 [ 17.692s] [cast.receiver.MediaManager] Load metadata error
 cast_receiver.js:19
### Media Manager - LOAD METADATA ERROR: 
{"senderId":"12:com.example.chromecastsample-79","message":{"currentTime":0,"med
ia":{"streamType":"BUFFERED","duration":0,"contentType":"application/x-mpegURL",
"contentId":"http://192.168.1.14/static/hlsdump/playlist.m3u8","metadata":{"titl
e":"HTTP Live Stream - 
Gladiator","metadataType":1}},"requestId":2,"autoplay":true}} receiver.html:401
 [ 17.701s] [cast.receiver.MediaManager] Resetting media element
 cast_receiver.js:19
 [ 17.709s] [cast.receiver.MediaManager] Sending error message to 12:com.example.chromecastsample-79
 cast_receiver.js:19
 [ 17.713s] [cast.receiver.IpcChannel] IPC message sent: {"namespace":"urn:x-cast:com.google.cast.media","senderId":"12:com.example.chromecastsample-79","data":"{\"requestId\":2,\"type\":\"LOAD_FAILED\"}"}
 cast_receiver.js:19
 [ 16.114s] [cast.player.api.Player] error
 media_player.js:24
### HOST ERROR - Fatal Error: code = 1 

Original comment by ibmpc.ma...@gmail.com on 21 Feb 2014 at 2:08

GoogleCodeExporter commented 8 years ago
Playlist attached from my not working HLS stream.
All segments duration ~ 3.9 sec. HLS stream playing OK on Android device. 

Original comment by ibmpc.ma...@gmail.com on 21 Feb 2014 at 2:23

Attachments:

GoogleCodeExporter commented 8 years ago
If possible, could you also please attach the TS segments as well ? (segm1.ts 
up to segm8.ts from playlist.m3u8).
Thanks.

Original comment by dami...@chromium.org on 22 Feb 2014 at 12:44

GoogleCodeExporter commented 8 years ago
I'm having the same issue. I can reproduce this with just a single file 
playlist. Files are attached.

Original comment by ko...@koushikdutta.com on 2 Mar 2014 at 8:47

Attachments:

GoogleCodeExporter commented 8 years ago
gadjex:

Here is the PES video timestamps of the first segment:
02-21 15:36:52.206 I/eureka_shell(  716): [11:11:INFO:es_parser_h264.cc(131)] 
VDTS=700 VPTS=700
02-21 15:36:52.216 I/eureka_shell(  716): [11:11:INFO:es_parser_h264.cc(131)] 
VDTS=700 VPTS=749
02-21 15:36:52.216 I/eureka_shell(  716): [11:11:INFO:es_parser_h264.cc(131)] 
VDTS=716 VPTS=716
02-21 15:36:52.216 I/eureka_shell(  716): [11:11:INFO:es_parser_h264.cc(131)] 
VDTS=733 VPTS=733
02-21 15:36:52.216 I/eureka_shell(  716): [11:11:INFO:es_parser_h264.cc(131)] 
VDTS=750 VPTS=783
02-21 15:36:52.216 I/eureka_shell(  716): [11:11:INFO:es_parser_h264.cc(131)] 
VDTS=766 VPTS=766
02-21 15:36:52.216 I/eureka_shell(  716): [11:11:INFO:es_parser_h264.cc(131)] 
VDTS=783 VPTS=816
02-21 15:36:52.216 I/eureka_shell(  716): [11:11:INFO:es_parser_h264.cc(131)] 
VDTS=800 VPTS=800
02-21 15:36:52.216 I/eureka_shell(  716): [11:11:INFO:es_parser_h264.cc(131)] 
VDTS=816 VPTS=849
02-21 15:36:52.216 I/eureka_shell(  716): [11:11:INFO:es_parser_h264.cc(131)] 
VDTS=833 VPTS=833
02-21 15:36:52.226 I/eureka_shell(  716): [11:11:INFO:es_parser_h264.cc(131)] 
VDTS=850 VPTS=883
02-21 15:36:52.226 I/eureka_shell(  716): [11:11:INFO:es_parser_h264.cc(131)] 
VDTS=866 VPTS=866
02-21 15:36:52.226 I/eureka_shell(  716): [11:11:INFO:es_parser_h264.cc(131)] 
VDTS=883 VPTS=916
02-21 15:36:52.226 I/eureka_shell(  716): [11:11:INFO:es_parser_h264.cc(131)] 
VDTS=900 VPTS=900
02-21 15:36:52.226 I/eureka_shell(  716): [11:11:INFO:es_parser_h264.cc(131)] 
VDTS=916 VPTS=949
02-21 15:36:52.226 I/eureka_shell(  716): [11:11:INFO:es_parser_h264.cc(131)] 
VDTS=933 VPTS=933
02-21 15:36:52.226 I/eureka_shell(  716): [11:11:INFO:es_parser_h264.cc(131)] 
VDTS=950 VPTS=983
02-21 15:36:52.226 I/eureka_shell(  716): [11:11:INFO:es_parser_h264.cc(131)] 
VDTS=966 VPTS=966
02-21 15:36:52.226 I/eureka_shell(  716): [11:11:INFO:es_parser_h264.cc(131)] 
VDTS=983 VPTS=1049
02-21 15:36:52.226 I/eureka_shell(  716): [11:11:INFO:es_parser_h264.cc(131)] 
VDTS=1000 VPTS=1000
...

As can be seen, the first 2 access units have exactly the same DTS which is 
currenlty forbidden in class SourceBufferStream.

Original comment by anad...@google.com on 11 Mar 2014 at 3:58

GoogleCodeExporter commented 8 years ago
Yeah, I fixed that by using:

#EXT-X-DISCONTINUITY

before each segment.

If I recall correctly, once I did that the default media player will now play 
the HLS stream. But my custom receiver would not. I've still not been able to 
make my custom player work.

Original comment by ko...@koushikdutta.com on 11 Mar 2014 at 5:58

GoogleCodeExporter commented 8 years ago
Have same InvalidStateError. I am using the latest CastMediaPlayerStreamingDRM 
sample and load the following urls (one works while the other fails):
https://googledrive.com/host/0B4hpBwz7cjJkNXFqSDlIRmFsWEE/fail.m3u8
https://googledrive.com/host/0B4hpBwz7cjJkNXFqSDlIRmFsWEE/work.m3u8

i'll be happy to know if there is a way to see some extended logs in order to 
better understand my TS\W3U8 issues.

Thanks.

Original comment by ILA...@gmail.com on 7 Apr 2014 at 8:29

GoogleCodeExporter commented 8 years ago
Is this an issue? I'd like to close that if not.

Original comment by anad...@google.com on 20 Jul 2014 at 10:27

GoogleCodeExporter commented 8 years ago
Resolved

Original comment by ko...@koushikdutta.com on 20 Jul 2014 at 10:31

GoogleCodeExporter commented 8 years ago
Same problem here with this stream:

https://docs.google.com/file/d/0B3Sp5dbSm8lxSVNVdVBlb3dTdXc/edit

Original comment by pabl...@gmail.com on 23 Jul 2014 at 3:54

GoogleCodeExporter commented 8 years ago
I am closing this issue as fixed. If you have a different stream that has 
issue, you need to open a new issue, provide stream + logs.

Original comment by anad...@google.com on 23 Jul 2014 at 4:01