Closed moneytoo closed 2 years ago
You have an impressive collection of AVI files! I'm glad we found each other. Lots of stuff here:
The other one is a codec buffer overrun. It looks like the codec can only handle 8192 bytes, but the muxer muxed them as 16000. There is a slim chance that setting the Format.MaxInputSize, will fix it, but if not, it will probably have to be fixed in ExoPlayer. I've pushed a commit setting the MaxInputSize. Fingers crossed!
These are mostly some random files I happened to download recently. But I still have a few files lying around. ;-)
Here's the source: https://brouken.com/tmp/kb.avi I haven't tested your recent changes yet (will do that later).
With the latest changes, it generates ArrayIndexOutOfBoundsException
:
E/LoadTask: Unexpected exception loading stream
java.lang.ArrayIndexOutOfBoundsException: length=2; index=76
at com.google.android.exoplayer2.extractor.avi.AviExtractor.getAviTrack(AviExtractor.java:424)
at com.google.android.exoplayer2.extractor.avi.AviExtractor.readIdx1(AviExtractor.java:355)
at com.google.android.exoplayer2.extractor.avi.AviExtractor.read(AviExtractor.java:502)
at com.google.android.exoplayer2.source.BundledExtractorsAdapter.read(BundledExtractorsAdapter.java:127)
at com.google.android.exoplayer2.source.ProgressiveMediaPeriod$ExtractingLoadable.load(ProgressiveMediaPeriod.java:1042)
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:920)
E/EventLogger: internalError [eventTime=0.12, mediaPos=0.00, window=0, period=0, loadError
com.google.android.exoplayer2.upstream.Loader$UnexpectedLoaderException: Unexpected ArrayIndexOutOfBoundsException: length=2; index=76
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:920)
Caused by: java.lang.ArrayIndexOutOfBoundsException: length=2; index=76
at com.google.android.exoplayer2.extractor.avi.AviExtractor.getAviTrack(AviExtractor.java:424)
at com.google.android.exoplayer2.extractor.avi.AviExtractor.readIdx1(AviExtractor.java:355)
at com.google.android.exoplayer2.extractor.avi.AviExtractor.read(AviExtractor.java:502)
at com.google.android.exoplayer2.source.BundledExtractorsAdapter.read(BundledExtractorsAdapter.java:127)
at com.google.android.exoplayer2.source.ProgressiveMediaPeriod$ExtractingLoadable.load(ProgressiveMediaPeriod.java:1042)
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:920)
]
E/ExoPlayerImplInternal: Playback error
com.google.android.exoplayer2.ExoPlaybackException: Source error
at com.google.android.exoplayer2.ExoPlayerImplInternal.handleIoException(ExoPlayerImplInternal.java:639)
at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:615)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.os.HandlerThread.run(HandlerThread.java:67)
Caused by: com.google.android.exoplayer2.upstream.Loader$UnexpectedLoaderException: Unexpected ArrayIndexOutOfBoundsException: length=2; index=76
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:920)
Caused by: java.lang.ArrayIndexOutOfBoundsException: length=2; index=76
at com.google.android.exoplayer2.extractor.avi.AviExtractor.getAviTrack(AviExtractor.java:424)
at com.google.android.exoplayer2.extractor.avi.AviExtractor.readIdx1(AviExtractor.java:355)
at com.google.android.exoplayer2.extractor.avi.AviExtractor.read(AviExtractor.java:502)
at com.google.android.exoplayer2.source.BundledExtractorsAdapter.read(BundledExtractorsAdapter.java:127)
at com.google.android.exoplayer2.source.ProgressiveMediaPeriod$ExtractingLoadable.load(ProgressiveMediaPeriod.java:1042)
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:920)
E/EventLogger: playerFailed [eventTime=0.13, mediaPos=0.00, window=0, period=0, errorCode=ERROR_CODE_IO_UNSPECIFIED
com.google.android.exoplayer2.ExoPlaybackException: Source error
at com.google.android.exoplayer2.ExoPlayerImplInternal.handleIoException(ExoPlayerImplInternal.java:639)
at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:615)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.os.HandlerThread.run(HandlerThread.java:67)
Caused by: com.google.android.exoplayer2.upstream.Loader$UnexpectedLoaderException: Unexpected ArrayIndexOutOfBoundsException: length=2; index=76
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:920)
Caused by: java.lang.ArrayIndexOutOfBoundsException: length=2; index=76
at com.google.android.exoplayer2.extractor.avi.AviExtractor.getAviTrack(AviExtractor.java:424)
at com.google.android.exoplayer2.extractor.avi.AviExtractor.readIdx1(AviExtractor.java:355)
at com.google.android.exoplayer2.extractor.avi.AviExtractor.read(AviExtractor.java:502)
at com.google.android.exoplayer2.source.BundledExtractorsAdapter.read(BundledExtractorsAdapter.java:127)
at com.google.android.exoplayer2.source.ProgressiveMediaPeriod$ExtractingLoadable.load(ProgressiveMediaPeriod.java:1042)
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:920)
]
D/EventLogger: loading [eventTime=0.13, mediaPos=0.00, window=0, period=0, false]
state [eventTime=0.13, mediaPos=0.00, window=0, period=0, IDLE]
D/BufferPoolAccessor2.0: bufferpool2 0x717d530cf8 : 0(0 size) total buffers - 0(0 size) used buffers - 194/204 (recycle/alloc) - 5/396 (fetch/transfer)
bufferpool2 0x717d5485e8 : 0(0 size) total buffers - 0(0 size) used buffers - 110/119 (recycle/alloc) - 5/230 (fetch/transfer)
evictor expired: 2, evicted: 2
Sorry about the crash. As I'm writing tests, I'm making changes to make the code more modular and testable. Unfortunately, it means sometimes I create new issues. I've pushed a fix for the crash.
The file will play on my S20, but it gives me a lot of errors. I'll try to remux it to a different container and see if it's the video or my software.
The file now plays, but I'm getting an crash after jumping to the middle of the time line:
2022-01-26 00:19:48.783 15846-18621/com.google.android.exoplayer2.demo W/AviExtractor: Unknown tag=;Þe pos=773517466 size=-1503974498 moviEnd=1031014180
2022-01-26 00:19:48.783 15846-18621/com.google.android.exoplayer2.demo 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.upstream.DataSpec.<init>(DataSpec.java:643)
at com.google.android.exoplayer2.upstream.DataSpec.<init>(DataSpec.java:32)
at com.google.android.exoplayer2.upstream.DataSpec$Builder.build(DataSpec.java:214)
at com.google.android.exoplayer2.source.ProgressiveMediaPeriod$ExtractingLoadable.buildDataSpec(ProgressiveMediaPeriod.java:1088)
at com.google.android.exoplayer2.source.ProgressiveMediaPeriod$ExtractingLoadable.load(ProgressiveMediaPeriod.java:1008)
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:920)
2022-01-26 00:19:48.785 15846-15846/com.google.android.exoplayer2.demo E/EventLogger: internalError [eventTime=2.66, mediaPos=2389.97, 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: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:920)
Caused by: java.lang.IllegalArgumentException
at com.google.android.exoplayer2.util.Assertions.checkArgument(Assertions.java:39)
at com.google.android.exoplayer2.upstream.DataSpec.<init>(DataSpec.java:643)
at com.google.android.exoplayer2.upstream.DataSpec.<init>(DataSpec.java:32)
at com.google.android.exoplayer2.upstream.DataSpec$Builder.build(DataSpec.java:214)
at com.google.android.exoplayer2.source.ProgressiveMediaPeriod$ExtractingLoadable.buildDataSpec(ProgressiveMediaPeriod.java:1088)
at com.google.android.exoplayer2.source.ProgressiveMediaPeriod$ExtractingLoadable.load(ProgressiveMediaPeriod.java:1008)
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:920)
]
2022-01-26 00:19:48.790 15846-18620/com.google.android.exoplayer2.demo E/ExoPlayerImplInternal: Playback error
com.google.android.exoplayer2.ExoPlaybackException: Source error
at com.google.android.exoplayer2.ExoPlayerImplInternal.handleIoException(ExoPlayerImplInternal.java:639)
at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:615)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.os.HandlerThread.run(HandlerThread.java:67)
Caused by: com.google.android.exoplayer2.upstream.Loader$UnexpectedLoaderException: Unexpected IllegalArgumentException: 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:920)
Caused by: java.lang.IllegalArgumentException
at com.google.android.exoplayer2.util.Assertions.checkArgument(Assertions.java:39)
at com.google.android.exoplayer2.upstream.DataSpec.<init>(DataSpec.java:643)
at com.google.android.exoplayer2.upstream.DataSpec.<init>(DataSpec.java:32)
at com.google.android.exoplayer2.upstream.DataSpec$Builder.build(DataSpec.java:214)
at com.google.android.exoplayer2.source.ProgressiveMediaPeriod$ExtractingLoadable.buildDataSpec(ProgressiveMediaPeriod.java:1088)
at com.google.android.exoplayer2.source.ProgressiveMediaPeriod$ExtractingLoadable.load(ProgressiveMediaPeriod.java:1008)
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:920)
I see similar error with one other file I have (out of total 15 files I tested with your extractor). All other (13) videos play fine (but as you already mentioned, some would really use better timestamp sync).
The seek logic is very meh. I plan on re-writing the seek logic at some point. I even wrote a bug for myself. :)
I pushed the current code before I really wanted to in order to fix the crash. Hopefully, things will be stabilized by the end of the week.
I tested another 50 videos and only 3 had some playback issues related to the extractor (not counting 1 OpenDML and 2 videos which failed to play even after remuxing). So I will retest these after the rewrite. It's looking really good. 👍
That's great! I was actually nervous about the last round of changes. Serendipitously, the release contains a bug that works-around a bug in AviMuxer. I cleaned up my bug, but I'll keep behavior that works-around the issue.
I still have issues with this file on my lower end devices. I assume it's because this file has very large audio packets. Remuxing fixes it.
Spent some more time on this file. Both the video and audio are muxed wrong. If you remux it should work fine. I'm calling this one done.
Some files give me errors like these. I'm not fully able to reproduce it with their cut samples. I will try providing the sources later.