Exoplayer: Getting " InvalidResponseCodeException" and "IllegalArgumentException" on MP4 playback!

Created on 28 Nov 2018  路  8Comments  路  Source: google/ExoPlayer

Hi, recently have been experiencing issues while playing MP4 files from server.
Below are the exceptions being thrown :

`E/LoadTask: Unexpected exception loading stream
    java.lang.IllegalArgumentException
        at com.google.android.exoplayer2.util.Assertions.checkArgument(Assertions.java:39)
        at com.google.android.exoplayer2.extractor.mp4.AtomParsers.parseStbl(AtomParsers.java:279)
        at com.google.android.exoplayer2.extractor.mp4.Mp4Extractor.processMoovAtom(Mp4Extractor.java:408)
        at com.google.android.exoplayer2.extractor.mp4.Mp4Extractor.processAtomEnded(Mp4Extractor.java:364)
        at com.google.android.exoplayer2.extractor.mp4.Mp4Extractor.readAtomPayload(Mp4Extractor.java:355)
        at com.google.android.exoplayer2.extractor.mp4.Mp4Extractor.read(Mp4Extractor.java:186)
        at com.google.android.exoplayer2.source.ExtractorMediaPeriod$ExtractingLoadable.load(ExtractorMediaPeriod.java:856)
        at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:320)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
        at java.lang.Thread.run(Thread.java:761)
2015-01-04 05:41:14.952 11036-11036/com.example.ridsys_001.AsterTest E/EventLogger: internalError [0.87, 4270.00, window=0, period=0, loadError]
    com.google.android.exoplayer2.upstream.Loader$UnexpectedLoaderException: Unexpected IllegalArgumentException: null
        at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:342)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
        at java.lang.Thread.run(Thread.java:761)
     Caused by: java.lang.IllegalArgumentException
        at com.google.android.exoplayer2.util.Assertions.checkArgument(Assertions.java:39)
        at com.google.android.exoplayer2.extractor.mp4.AtomParsers.parseStbl(AtomParsers.java:279)
        at com.google.android.exoplayer2.extractor.mp4.Mp4Extractor.processMoovAtom(Mp4Extractor.java:408)
        at com.google.android.exoplayer2.extractor.mp4.Mp4Extractor.processAtomEnded(Mp4Extractor.java:364)
        at com.google.android.exoplayer2.extractor.mp4.Mp4Extractor.readAtomPayload(Mp4Extractor.java:355)
        at com.google.android.exoplayer2.extractor.mp4.Mp4Extractor.read(Mp4Extractor.java:186)
        at com.google.android.exoplayer2.source.ExtractorMediaPeriod$ExtractingLoadable.load(ExtractorMediaPeriod.java:856)
        at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:320)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)聽
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)聽
        at java.lang.Thread.run(Thread.java:761)聽

 com.google.android.exoplayer2.upstream.HttpDataSource$InvalidResponseCodeException: Response code: 416
        at com.google.android.exoplayer2.upstream.DefaultHttpDataSource.open(DefaultHttpDataSource.java:211)
        at com.google.android.exoplayer2.upstream.DefaultDataSource.open(DefaultDataSource.java:147)
        at com.google.android.exoplayer2.source.ExtractorMediaPeriod$ExtractingLoadable.load(ExtractorMediaPeriod.java:844)
        at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:320)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
        at java.lang.Thread.run(Thread.java:761)
     Caused by: com.google.android.exoplayer2.upstream.DataSourceException
        at com.google.android.exoplayer2.upstream.DefaultHttpDataSource.open(DefaultHttpDataSource.java:214)
        at com.google.android.exoplayer2.upstream.DefaultDataSource.open(DefaultDataSource.java:147)聽
        at com.google.android.exoplayer2.source.ExtractorMediaPeriod$ExtractingLoadable.load(ExtractorMediaPeriod.java:844)聽
        at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:320)聽
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)聽
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)聽
        at java.lang.Thread.run(Thread.java:761)聽
2015-01-04 05:41:16.103 11036-11036/com.example.ridsys_001.AsterTest E/EventLogger: internalError [2.02, 4270.00, window=0, period=0, loadError]
    com.google.android.exoplayer2.upstream.HttpDataSource$InvalidResponseCodeException: Response code: 416
        at com.google.android.exoplayer2.upstream.DefaultHttpDataSource.open(DefaultHttpDataSource.java:211)
        at com.google.android.exoplayer2.upstream.DefaultDataSource.open(DefaultDataSource.java:147)
        at com.google.android.exoplayer2.source.ExtractorMediaPeriod$ExtractingLoadable.load(ExtractorMediaPeriod.java:844)
        at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:320)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
        at java.lang.Thread.run(Thread.java:761)
     Caused by: com.google.android.exoplayer2.upstream.DataSourceException
        at com.google.android.exoplayer2.upstream.DefaultHttpDataSource.open(DefaultHttpDataSource.java:214)
        at com.google.android.exoplayer2.upstream.DefaultDataSource.open(DefaultDataSource.java:147)聽
        at com.google.android.exoplayer2.source.ExtractorMediaPeriod$ExtractingLoadable.load(ExtractorMediaPeriod.java:844)聽
        at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:320)聽
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)聽
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)聽
        at java.lang.Thread.run(Thread.java:761)聽
`

I have attached the medinfo for the file and atom information.
movieInfo.txt
mediaInfo2.txt

Would be really helpfuly if u guys could help with this!!!

bad media question

All 8 comments

The IllegalArgumentException in AtomParsers.parseStbl indicates that the MP4 header data is not in the expected format. InvalidResponseCodeException: Response code: 416 suggests that the player is requesting an invalid byte range from the server.

The media could be invalid, or at last not supported by ExoPlayer's MP4 extractor. To know for sure we'd need to have a copy of the MP4. If you provide that we can verify and reopen the issue if needed.

Hi..i ve added the mp4dump as well....not able to figure out where the content is bad

mp4dump.txt

Hope this helps!!

We really need to see the MP4 or at least the whole moov box. You can attach it here or send it to [email protected] with subject line "Issue #5162".

@andrewlewis Hi..i ve mailed the mp4 file to [email protected] with subject line "Issue #5162".

The video track sample table contains more CTTS entry than we expect, which is causing the assertion failure. Do you know what specific program (and version number) was used to encode the file?

The file plays correctly after removing this assertion, so we might replace it with a logged warning.

@andrewlewis .thanks for the information..but the content happens to be downloaded from internet so the specifics are unknown!!..could you tell how the CTTS entry was extracted and removed?
..because that would be helpful in clearing from our side..!!

We'll push a change shortly that changes the assertion into a warning. This issue will be updated automatically to reference the commit.

One other thing to note about this issue: the IllegalArgumentException in parseStbl will be addressed by the commit once it gets pushed, but I'm not sure why the HTTP 416 error was appearing. If we were retrying parsing the stream after throwing, the range request should be valid. I also can't reproduce that part of this issue (I just see the exception parsing stbl then a playback failure after retrying and getting the same exception). The range request error may be caused by a player bug or possibly server misconfiguration, so if you can reproduce it again please file a new issue. Thanks!

Was this page helpful?
0 / 5 - 0 ratings