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.

Unexpected exception loading stream HEVC HDR10+

See original GitHub issue

ExoPlayer Version

2.17.1

Devices that reproduce the issue

Onn Android TV box Pixel 3 XL FIreTV 4k Stick

Devices that do not reproduce the issue

No response

Reproducible in the demo app?

No

Reproduction steps

Playing the file

Expected result

Media playsback

Actual result

I am making an assumption that the issue might be the HDR10+. I have played back almost identical files without the HDR, and they seem to work without issue. I have tried a few examples with HDR10+ and they all seem to fail. I was able to playback the same file using a different player on the same devices.

I tried version 2.17.1 and 2.16.1 and they both throw the same stack trace. There is no video displayed at all. It appears to fail prior to completly loading the file.

Thanks, Josh

Here is the media format info:

Format : Matroska Format version : Version 4 File size : 4.33 GiB Duration : 45 min 45 s Overall bit rate : 13.6 Mb/s Writing application : mkvmerge v49.0.0 (‘Sick Of Losing Soulmates’) 64-bit Writing library : libebml v1.4.0 + libmatroska v1.6.1

Video ID : 1 Format : HEVC Format/Info : High Efficiency Video Coding Format profile : Main 10@L5@Main HDR format : SMPTE ST 2094 App 4, Version 1, HDR10+ Profile B compatible Codec ID : V_MPEGH/ISO/HEVC Duration : 45 min 45 s Bit rate : 13.1 Mb/s Width : 3 840 pixels Height : 2 160 pixels Display aspect ratio : 16:9 Frame rate mode : Constant Frame rate : 23.976 (24000/1001) FPS Color space : YUV Chroma subsampling : 4:2:0 (Type 2) Bit depth : 10 bits Bits/(Pixel*Frame) : 0.066 Stream size : 4.19 GiB (97%) Default : Yes Forced : No Color range : Limited Color primaries : BT.2020 Transfer characteristics : PQ Matrix coefficients : BT.2020 non-constant Mastering display color primaries : Display P3 Mastering display luminance : min: 0.0001 cd/m2, max: 1000 cd/m2

Audio ID : 2 Format : E-AC-3 Format/Info : Enhanced AC-3 Commercial name : Dolby Digital Plus Codec ID : A_EAC3 Duration : 45 min 45 s Bit rate mode : Constant Bit rate : 192 kb/s Channel(s) : 6 channels Channel layout : L R C LFE Ls Rs Sampling rate : 48.0 kHz Frame rate : 31.250 FPS (1536 SPF) Compression mode : Lossy Stream size : 62.8 MiB (1%) Language : English Service kind : Complete Main Default : Yes Forced : No

Text #1 ID : 3 Format : UTF-8 Codec ID : S_TEXT/UTF8 Codec ID/Info : UTF-8 Plain Text Title : English Language : English Default : No Forced : No

Text #2 ID : 4 Format : UTF-8 Codec ID : S_TEXT/UTF8 Codec ID/Info : UTF-8 Plain Text Title : English [SDH] Language : English Default : No Forced : No

Here is the stack trace:

E/LoadTask: Unexpected exception loading stream
      java.lang.IllegalStateException
        at com.google.android.exoplayer2.util.Assertions.checkState(Assertions.java:84)
        at com.google.android.exoplayer2.util.ParsableNalUnitBitArray.assertValidOffset(ParsableNalUnitBitArray.java:209)
        at com.google.android.exoplayer2.util.ParsableNalUnitBitArray.readBits(ParsableNalUnitBitArray.java:149)
        at com.google.android.exoplayer2.util.ParsableNalUnitBitArray.readExpGolombCodeNum(ParsableNalUnitBitArray.java:196)
        at com.google.android.exoplayer2.util.ParsableNalUnitBitArray.readUnsignedExpGolombCodedInt(ParsableNalUnitBitArray.java:178)
        at com.google.android.exoplayer2.util.NalUnitUtil.skipShortTermReferencePictureSets(NalUnitUtil.java:795)
        at com.google.android.exoplayer2.util.NalUnitUtil.parseH265SpsNalUnitPayload(NalUnitUtil.java:542)
        at com.google.android.exoplayer2.util.NalUnitUtil.parseH265SpsNalUnit(NalUnitUtil.java:451)
        at com.google.android.exoplayer2.video.HevcConfig.parse(HevcConfig.java:81)
        at com.google.android.exoplayer2.extractor.mkv.MatroskaExtractor$Track.initializeOutput(MatroskaExtractor.java:2012)
        at com.google.android.exoplayer2.extractor.mkv.MatroskaExtractor.endMasterElement(MatroskaExtractor.java:770)
        at com.google.android.exoplayer2.extractor.mkv.MatroskaExtractor$InnerEbmlProcessor.endMasterElement(MatroskaExtractor.java:1879)
        at com.google.android.exoplayer2.extractor.mkv.DefaultEbmlReader.read(DefaultEbmlReader.java:84)
        at com.google.android.exoplayer2.extractor.mkv.MatroskaExtractor.read(MatroskaExtractor.java:480)
        at com.google.android.exoplayer2.source.BundledExtractorsAdapter.read(BundledExtractorsAdapter.java:127)
        at com.google.android.exoplayer2.source.ProgressiveMediaPeriod$ExtractingLoadable.load(ProgressiveMediaPeriod.java:1046)
        at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:409)
        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:919)
2022-06-03 12:31:04.869 9050-9195/jvl.sage.miniclient.android.tv.debug.debug E/ExoPlayerImplInternal: Playback error
      com.google.android.exoplayer2.ExoPlaybackException: Source error
        at com.google.android.exoplayer2.ExoPlayerImplInternal.handleIoException(ExoPlayerImplInternal.java:628)
        at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:604)
        at android.os.Handler.dispatchMessage(Handler.java:103)
        at android.os.Looper.loop(Looper.java:214)
        at android.os.HandlerThread.run(HandlerThread.java:67)
     Caused by: com.google.android.exoplayer2.upstream.Loader$UnexpectedLoaderException: Unexpected IllegalStateException: null
        at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:430)
        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:919)
     Caused by: java.lang.IllegalStateException
        at com.google.android.exoplayer2.util.Assertions.checkState(Assertions.java:84)
        at com.google.android.exoplayer2.util.ParsableNalUnitBitArray.assertValidOffset(ParsableNalUnitBitArray.java:209)
        at com.google.android.exoplayer2.util.ParsableNalUnitBitArray.readBits(ParsableNalUnitBitArray.java:149)
        at com.google.android.exoplayer2.util.ParsableNalUnitBitArray.readExpGolombCodeNum(ParsableNalUnitBitArray.java:196)
        at com.google.android.exoplayer2.util.ParsableNalUnitBitArray.readUnsignedExpGolombCodedInt(ParsableNalUnitBitArray.java:178)
        at com.google.android.exoplayer2.util.NalUnitUtil.skipShortTermReferencePictureSets(NalUnitUtil.java:795)
        at com.google.android.exoplayer2.util.NalUnitUtil.parseH265SpsNalUnitPayload(NalUnitUtil.java:542)
        at com.google.android.exoplayer2.util.NalUnitUtil.parseH265SpsNalUnit(NalUnitUtil.java:451)
        at com.google.android.exoplayer2.video.HevcConfig.parse(HevcConfig.java:81)
        at com.google.android.exoplayer2.extractor.mkv.MatroskaExtractor$Track.initializeOutput(MatroskaExtractor.java:2012)
        at com.google.android.exoplayer2.extractor.mkv.MatroskaExtractor.endMasterElement(MatroskaExtractor.java:770)
        at com.google.android.exoplayer2.extractor.mkv.MatroskaExtractor$InnerEbmlProcessor.endMasterElement(MatroskaExtractor.java:1879)
        at com.google.android.exoplayer2.extractor.mkv.DefaultEbmlReader.read(DefaultEbmlReader.java:84)
        at com.google.android.exoplayer2.extractor.mkv.MatroskaExtractor.read(MatroskaExtractor.java:480)
        at com.google.android.exoplayer2.source.BundledExtractorsAdapter.read(BundledExtractorsAdapter.java:127)
        at com.google.android.exoplayer2.source.ProgressiveMediaPeriod$ExtractingLoadable.load(ProgressiveMediaPeriod.java:1046)
        at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:409)
        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:919) 

Media

I can provide an example if needed.

Bug Report

  • You will email the zip file produced by adb bugreport to dev.exoplayer@gmail.com after filing this issue.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ojw28commented, Jun 17, 2022

I have a candidate fix for this. We will merge it next week.

0reactions
ojw28commented, Jun 6, 2022

@MarcusWichelmann - It looks like you may have contributed this code? I don’t suppose you’d be able to take a look at this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Waiting for the HDR10 switch in HEVC export to work...
MOV has flagging on container level, but not in private h264 headers. Assuming h265 behaves the same issue is that Resolve doesn't set...
Read more >
Re: HDR10 Export Steps? - Adobe Support Community - 11718304
I have found an inability to export my video content to HEVC HDR10 as it crashes but with version 19 or 13.1.5 it...
Read more >
Encoding UHD 4K HDR10 and HDR10+ Videos
This command converts only the video, keeping the HDR10 intact. We will have to pass these arguments not to ffmpeg, but to the...
Read more >
Pass over HDR10+ and Dolby Vision information? [Archive]
I'm interested, my TV is a Samsung Q70R so not compatible with DoVi, only HDR10+. What is the result if I recode a...
Read more >
Compatible media transcoding - Android Developers
For example, a one minute HEVC video file takes roughly 20 seconds to ... when not absolutely necessary might invoke transcoding in unintended...
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