question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

HLS (.m3u8) ParserException in v. 2.9.6 and above

See original GitHub issue

Content description

The main problem is the Player gets stuck with some streams (hls). We produce great quantity of content and mostly works perfect, but there are some cases where Exoplayer launches an internal Exception, and stop playing.

It start happen, or we notice when we migrate from the 2.9.4 to the 2.10.[0-4] versions. We were forced to rollback the version.

The Exception is launched in the TsExtractor class, when it tries to calculate the size of the packet because he cannot find the starting point properly.

Simple bug report:

E/EventLogger: playerFailed [74.58, 884.12, window=0, period=0]
    com.google.android.exoplayer2.ExoPlaybackException: com.google.android.exoplayer2.ParserException: Cannot find sync byte. Most likely not a Transport Stream.
        at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:386)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:193)
        at android.os.HandlerThread.run(HandlerThread.java:65)
     Caused by: com.google.android.exoplayer2.ParserException: Cannot find sync byte. Most likely not a Transport Stream.
        at com.google.android.exoplayer2.extractor.ts.TsExtractor.findEndOfFirstTsPacketInBuffer(TsExtractor.java:412)
        at com.google.android.exoplayer2.extractor.ts.TsExtractor.read(TsExtractor.java:280)
        at com.google.android.exoplayer2.source.hls.HlsMediaChunk.feedDataToExtractor(HlsMediaChunk.java:357)
        at com.google.android.exoplayer2.source.hls.HlsMediaChunk.loadMedia(HlsMediaChunk.java:325)
        at com.google.android.exoplayer2.source.hls.HlsMediaChunk.load(HlsMediaChunk.java:301)
        at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:381)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:764)

Looks like was a known issue, previously reported, that where affecting older versions of ExoPlayer:

https://github.com/google/ExoPlayer/issues/5039 https://github.com/google/ExoPlayer/issues/4660

We don’t have any problem reproducing the stream in IOS or in the Web in any player we tried.

Link to test content

An example stream:

https://dc9jagk60w3y3mt6171f-ispjcf-fas.p5cdn.com/ck0mkmgdgtikk0h5voe8uu8c5/master.m3u8

Is possible to reproduce in the ExoPlayer demo project just by adding the next block to the HLS samples in the media.exolist.json:

      {
        "name": "TEST",
        "uri": "https://dc9jagk60w3y3mt6171f-ispjcf-fas.p5cdn.com/ck0mkmgdgtikk0h5voe8uu8c5/master.m3u8"
      }

Version of ExoPlayer being used

Versions: 2.10.5, 2.10.4 , 2.10.3, 2.10.2, 2.10.0, 2.9.6

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

Android 9, Pixel 3 (Emulator) Android 10, Pixel 3 (Real device)

A full bug report captured from the device

bugreport-sdk_gphone_x86-PSR1.180720.075-2019-09-19-11-13-05.zip

UPDATED : The error stream was updated to static one, not depending on the geographical location.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
AquilesCantacommented, Sep 30, 2019

I think this was fixed by b8ec05aea19be5eb3ef317a7daf10ed1d36154b4. Can you please patch that in and see if that fixes your issue, please?

0reactions
VictorPurMarcommented, Sep 30, 2019

@AquilesCanta Almost for this CDN compression issues, the patch works like a charm! We will try to apply to prod, and see if this solves this issue.

Thank you very much.

Read more comments on GitHub >

github_iconTop Results From Across the Web

About the EXT-X-VERSION tag - Apple Developer
Find the protocol version that corresponds with the HLS features your app ... Support for M3U8 Playlists was introduced with iOS 3.0, Mac...
Read more >
HLS protocol , ParserException: Failed to parse the playlist ...
The EXT-X-STREAM-INF tags are used in a Master playlist. A Master playlist points to multiple Media playlists - also m3u8 - and not...
Read more >
get-hls-streaming-session-url - Amazon AWS
The initialization fragment contains the codec private data for the stream, and other data needed to set up the video or audio decoder...
Read more >
Introduction to HTTP Live Streaming: HLS on Android and More
Metadata lines start with #. This example illustrates what an M3U8 file for a simple HLS stream looks like: #EXTM3U #EXT-X-VERSION:3 #EXT ...
Read more >
m3u8 - Go Packages
Package M3U8 is parser & generator library for Apple HLS. ... Support HLS specs up to version 5 of the protocol.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found