ExoPlayer icon indicating copy to clipboard operation
ExoPlayer copied to clipboard

HLS Live Stream from Wowza wont play

Open HandsomeFrank opened this issue 12 years ago • 8 comments

Hello , I am using the latest dev-hls to test a live stream from wowza server , the stream has play ok on a safari. I played back VOD stream from Wowza have no problem.

This is the error log

10-31 14:43:49.477: E/EventLogger(14331): playerFailed [6.64] 10-31 14:43:49.477: E/EventLogger(14331): com.google.android.exoplayer.ExoPlaybackException: com.google.android.exoplayer.upstream.HttpDataSource$InvalidResponseCodeException: Response code: 403 10-31 14:43:49.477: E/EventLogger(14331): at com.google.android.exoplayer.MediaCodecTrackRenderer.doPrepare(MediaCodecTrackRenderer.java:191) 10-31 14:43:49.477: E/EventLogger(14331): at com.google.android.exoplayer.TrackRenderer.prepare(TrackRenderer.java:117) 10-31 14:43:49.477: E/EventLogger(14331): at com.google.android.exoplayer.ExoPlayerImplInternal.incrementalPrepareInternal(ExoPlayerImplInternal.java:273) 10-31 14:43:49.477: E/EventLogger(14331): at com.google.android.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:201) 10-31 14:43:49.477: E/EventLogger(14331): at android.os.Handler.dispatchMessage(Handler.java:98) 10-31 14:43:49.477: E/EventLogger(14331): at android.os.Looper.loop(Looper.java:136) 10-31 14:43:49.477: E/EventLogger(14331): at android.os.HandlerThread.run(HandlerThread.java:61) 10-31 14:43:49.477: E/EventLogger(14331): at com.google.android.exoplayer.ExoPlayerImplInternal$1.run(ExoPlayerImplInternal.java:110) 10-31 14:43:49.477: E/EventLogger(14331): Caused by: com.google.android.exoplayer.upstream.HttpDataSource$InvalidResponseCodeException: Response code: 403 10-31 14:43:49.477: E/EventLogger(14331): at com.google.android.exoplayer.upstream.HttpDataSource.open(HttpDataSource.java:251) 10-31 14:43:49.477: E/EventLogger(14331): at com.google.android.exoplayer.upstream.UriDataSource.open(UriDataSource.java:66) 10-31 14:43:49.477: E/EventLogger(14331): at com.google.android.exoplayer.upstream.DataSourceStream.load(DataSourceStream.java:223) 10-31 14:43:49.477: E/EventLogger(14331): at com.google.android.exoplayer.hls.HlsChunk.load(HlsChunk.java:173) 10-31 14:43:49.477: E/EventLogger(14331): at com.google.android.exoplayer.upstream.Loader$LoadTask.run(Loader.java:206) 10-31 14:43:49.477: E/EventLogger(14331): at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422) 10-31 14:43:49.477: E/EventLogger(14331): at java.util.concurrent.FutureTask.run(FutureTask.java:237) 10-31 14:43:49.477: E/EventLogger(14331): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) 10-31 14:43:49.477: E/EventLogger(14331): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) 10-31 14:43:49.477: E/EventLogger(14331): at java.lang.Thread.run(Thread.java:841) 10-31 14:43:49.477: D/EventLogger(14331): state [6.64, true, I]

and this is the content of the m3u8 created on the fly by Wowza Engine

EXTM3U

EXT-X-VERSION:3

EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1343647,CODECS="avc1.77.31,mp4a.40.2",RESOLUTION=1280x720

chunklist_w1182673521.m3u8

HandsomeFrank avatar Oct 31 '14 06:10 HandsomeFrank

403 Forbidden, please check your stream server, or add User-Agent

crossle avatar Oct 31 '14 07:10 crossle

Thanks for the comment. I played the same URL with build-in Wowza test player with out any issue, I am doing more test and will update my findings

Frank

HandsomeFrank avatar Oct 31 '14 08:10 HandsomeFrank

I found an error in the wowza side , but i did not see this error when playback VOD

WARN server comment - HTTPStreamerAdapterCupertinoStreamer.onPlaylist[live/myStream/playlist.m3u8]: Invalid session

Need to do more debug on both side .....

HandsomeFrank avatar Oct 31 '14 08:10 HandsomeFrank

@HandsomeFrank could you share a URL the Wowza stream that has this issue?

andudo avatar Oct 31 '14 16:10 andudo

opps, I found the problem , DemoUtil.TYPE_HLS_MASTER should be usee .. I just modify the exisiting config and it was set to DemoUtil.TYPE_HLS_MEDIA , i overlooked this ........

but should i set uid:hls:applemaster for both ? seems that wowza will output master playlist for both vod and live

public static final Sample[] HLS = new Sample[] { new Sample("Wowza Playlist", "uid:hls:applemaster", "http://192.168.1.58:1935/vod/definst/mp4:sample.mp4/" + "playlist.m3u8", DemoUtil.TYPE_HLS_MASTER, false, true), new Sample("LIVE PLAY BACK", "uid:hls:applesinglemedia", "http://192.168.1.58:1935/live/myStream/" + "playlist.m3u8", DemoUtil.TYPE_HLS_MASTER, false, true),

now both live and vod on wowza is playing well , thanks

HandsomeFrank avatar Oct 31 '14 18:10 HandsomeFrank

The string is just an identifier for the content - you can set it to anything you want.

ojw28 avatar Oct 31 '14 19:10 ojw28

@ojw28 I had a similar issue, lost some time on that. Would it be possible for the parser to detect the content type (HLS_MASTER or HLS_MEDIA) so the user wouldn't have to specify it? The master and variant playlist are different in that the former has a list of playlists, while the latter has a list of chunks, so it should be possible to identify each type. The logic could go something like this: if the list of variant playlists is empty, then create a dummy master playlist to wrap the current playlist.

Currently the content type is switched on in demo/full/player/HlsRendererBuilder.java:72 to build the playlist object.

Let me know if you want me to register an issue for this.

perchrh avatar Oct 31 '14 19:10 perchrh

@perchrh Yes, we're aware of this inconvenience and plan to fix it, but it's not a high priority issue. Please go ahead and open an issue for this, we'll get to it once major HLS features are in.

andudo avatar Oct 31 '14 21:10 andudo