Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HLS LIVE STREAM from NGINEX delivered in TS format does not play #3712

Closed
elPre opened this issue Jan 16, 2018 · 1 comment
Closed

HLS LIVE STREAM from NGINEX delivered in TS format does not play #3712

elPre opened this issue Jan 16, 2018 · 1 comment

Comments

@elPre
Copy link

elPre commented Jan 16, 2018

ExoPlayer Version (release-v2)

The stream that NGINEX server is delivered is in a TS file format

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-MEDIA-SEQUENCE:31652
#EXT-X-TARGETDURATION:8
#EXTINF:7.992,
cam1-31652.ts
#EXTINF:7.992,
cam1-31653.ts
#EXTINF:7.992,
cam1-31654.ts
#EXTINF:7.992,
cam1-31655.ts
#EXTINF:7.992,
cam1-31656.ts

What happens is that as soon it start to do the playback is just stuck.

I kind of solve it using the normal VideoView like this
VideoView player = (VideoView)findViewById(R.id.player);
String httpLiveUrl = "http://demo.myparentsonboard.com/live/cam1.m3u8?md5=wIba1dhGCRqM1_epleF9bQ&expires=1520818854";
player.setVideoURI(Uri.parse(httpLiveUrl));
player.setMediaController(new MediaController(this));
player.requestFocus();
player.start();

But I really want to use ExoPlayer, much better have a player that is a proof that runs in every device using YOUTUBE (in all the world). And million times better than the native player and videoview.

I did read the FAQ but it was very vague the info on turn on the flags, I followed too like three threads about the same issue, but no success. Using dev-v1 and v2. Extending from DefaultFactory and modifying TsExtractor and so on.

Reproduction steps && ### Link to test content

Inside the media.exolist.json add the following that is in the DEMO APP

{
"name": "MPOB LIVE STREAM 1",
"uri": "http://demo.myparentsonboard.com/livelow/cam1.m3u8?md5=Q7Gplw7Nwbjj4T-IgiAedw&expires=1521257464"
},
{
"name": "MPOB LIVE STREAM 2",
"uri": "http://demo.myparentsonboard.com/livelow/cam2.m3u8?md5=5yB6W7utNzLDcDZXYXXpbA&expires=1521257464"
},
{
"name": "MPOB LIVE STREAM 3",
"uri": "http://demo.myparentsonboard.com/live/cam3.m3u8?md5=Gc8a0_fPpf2LAJ1OxNyBzg&expires=1521257464"
},
{
"name": "MPOB LIVE STREAM 4",
"uri": "http://demo.myparentsonboard.com/live/cam4.m3u8?md5=yeyGPsPg9csUiyNVNNSE-g&expires=1521257464"
}

Device(s) and version(s) of Android being used

For every device is always reproduce-able
Nexus 4 Android version 5.1.1
Google Pixel Android version 7.1.2
Samsung Galaxy S8 Android version 7.0

A full bug report captured from the device

01-15 19:48:47.616 586-2327/? I/ActivityManager: START u0 {act=com.google.android.exoplayer.demo.action.VIEW dat=http://demo.myparentsonboard.com/livelow/cam1.m3u8?md5=Q7Gplw7Nwbjj4T-IgiAedw&expires=1521257464 cmp=com.google.android.exoplayer2.demo/.PlayerActivity (has extras)} from uid 10129 on display 0
01-15 19:48:47.622 586-2327/? V/WindowManager: addAppToken: AppWindowToken{e28bf12 token=Token{9f28e9d ActivityRecord{17890974 u0 com.google.android.exoplayer2.demo/.PlayerActivity t245}}} to stack=1 task=245 at 1
01-15 19:48:47.631 188-638/? D/audio_hw_primary: select_devices: out_snd_device(2: speaker) in_snd_device(0: none)
01-15 19:48:47.631 188-638/? D/ACDB-LOADER: ACDB -> send_afe_cal
01-15 19:48:47.631 188-638/? D/audio_hw_primary: enable_snd_device: snd_device(2: speaker)
01-15 19:48:47.639 188-638/? D/audio_hw_primary: enable_audio_route: apply and update mixer path: low-latency-playback
01-15 19:48:47.671 5407-5407/com.google.android.exoplayer2.demo I/ExoPlayerImpl: Init 2aedc4ad [ExoPlayerLib/2.5.4] [mako, Nexus 4, LGE, 22]
01-15 19:48:47.674 5407-5407/com.google.android.exoplayer2.demo D/EventLogger: state [0.00, true, I]
01-15 19:48:47.679 586-2003/? V/WindowManager: Adding window Window{32e748e0 u0 com.google.android.exoplayer2.demo/com.google.android.exoplayer2.demo.PlayerActivity} at 4 of 9 (after Window{31711726 u0 com.google.android.exoplayer2.demo/com.google.android.exoplayer2.demo.SampleChooserActivity})
01-15 19:48:47.681 5407-5407/com.google.android.exoplayer2.demo D/EventLogger: state [0.01, true, B]
01-15 19:48:47.732 586-1214/? V/WindowManager: Adding window Window{344fba5e u0 SurfaceView} at 4 of 10 (before Window{32e748e0 u0 com.google.android.exoplayer2.demo/com.google.android.exoplayer2.demo.PlayerActivity})
01-15 19:48:47.779 899-899/? I/GoogleInputMethod: onFinishInput() : Dummy InputConnection bound
01-15 19:48:47.779 586-616/? I/ActivityManager: Displayed com.google.android.exoplayer2.demo/.PlayerActivity: +153ms
01-15 19:48:47.780 899-899/? I/GoogleInputMethod: onStartInput() : Dummy InputConnection bound
01-15 19:48:47.826 5407-5441/com.google.android.exoplayer2.demo D/OpenGLRenderer: endAllStagingAnimators on 0xb850af70 (ExpandableListView) with handle 0xb8650508
01-15 19:48:47.830 5407-5407/com.google.android.exoplayer2.demo D/EventLogger: sourceInfo [periodCount=1, windowCount=1
01-15 19:48:47.830 5407-5407/com.google.android.exoplayer2.demo D/EventLogger: period [?]
01-15 19:48:47.830 5407-5407/com.google.android.exoplayer2.demo D/EventLogger: window [53.30, true, true]
01-15 19:48:47.831 5407-5407/com.google.android.exoplayer2.demo D/EventLogger: ]
01-15 19:48:47.832 5407-5407/com.google.android.exoplayer2.demo D/EventLogger: loading [true]
01-15 19:48:48.051 172-172/? W/SurfaceFlinger: couldn't log to binary event log: overflow.
01-15 19:48:50.864 188-656/? D/audio_hw_primary: disable_audio_route: reset and update mixer path: low-latency-playback
01-15 19:48:50.865 188-656/? D/audio_hw_primary: disable_snd_device: snd_device(2: speaker)
01-15 19:48:51.564 586-655/? E/WifiStateMachine: WifiStateMachine CMD_START_SCAN source -2 txSuccessRate=87.09 rxSuccessRate=335.61 targetRoamBSSID=any RSSI=-50
01-15 19:48:59.057 5407-5407/com.google.android.exoplayer2.demo D/EventLogger: sourceInfo [periodCount=1, windowCount=1
01-15 19:48:59.058 5407-5407/com.google.android.exoplayer2.demo D/EventLogger: period [?]
01-15 19:48:59.058 5407-5407/com.google.android.exoplayer2.demo D/EventLogger: window [53.30, true, true]

And keeps forever like this and the streams never appears.

Thanks a lot!

@AquilesCanta
Copy link
Contributor

The issue is that the TS segments declare an AAC track in the PMT but no audio PES packets appear (so ExoPlayer waits for the AAC track indefinitely). I'd suggest contacting NGINEX and see if that can be fixed on their side. You can work around this issue by enabling DefaultTsPayloadReaderFactory#FLAG_IGNORE_AAC_STREAM. To do this, you will need to inject your custom HlsExtractorFactory (take a look at DefaultHlsExtractorFactory first, you just need a very small change). Of course, if the stream did contain AAC packets, they would be ignored even though they are present, so take this into account.

Another alternative is using a master playlist that contains only video codecs in the CODECS attribute, but that also requires a change server-side. Good luck!

@google google locked and limited conversation to collaborators Jun 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants