VideoFrameDecoder fails decoding mp4
See original GitHub issueDescribe the bug Getting a video frame from an online resource fails for mp4 files, it works fine for .mov files.
Expected behavior
To Reproduce
private val imageLoader = ImageLoader.Builder(binding.root.context)
.componentRegistry {
add(VideoFrameFileFetcher(binding.root.context))
add(VideoFrameUriFetcher(binding.root.context))
add(VideoFrameDecoder(binding.root.context))
}
.logger(DebugLogger(Log.VERBOSE))
.build()
imageView.load("http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4", imageLoader = imageLoader)
Logs/Screenshots
Failed - http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4 - java.lang.IllegalArgumentException
E/RealImageLoader: java.lang.IllegalArgumentException
at android.media.MediaMetadataRetriever.setDataSource(MediaMetadataRetriever.java:173)
at coil.fetch.VideoFrameUriFetcher.setDataSource(VideoFrameFetcher.kt:50)
at coil.fetch.VideoFrameUriFetcher.setDataSource(VideoFrameFetcher.kt:35)
at coil.fetch.VideoFrameFetcher.fetch$suspendImpl(VideoFrameFetcher.kt:72)
at coil.fetch.VideoFrameFetcher.fetch(Unknown Source:0)
at coil.intercept.EngineInterceptor$intercept$2.invokeSuspend(EngineInterceptor.kt:403)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
Version 1.2.0
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Video frame ended with Exception · Issue #1236 · coil-kt/coil
Factory()) add(VideoFrameDecoder. ... Often this means BitmapFactory could not decode the image data read from the input source (e.g. ...
Read more >Unable to decode mp4 video using A… - Apple Developer
It happens specifically on iPhone 11 Pro and iPhone XR. Have 1 second mp4 video. use copyNextSampleBuffer. check the status of assetReader; it...
Read more >Decoding mp4/mkv using FFMPEG fails - Stack Overflow
I realize that I can probably fix this by converting files into a raw format first, but I would like to be able...
Read more >VideoFrameDecoder
A Decoder that uses MediaMetadataRetriever to fetch and decode a frame from a video. Types Constructors Functions. Constructors.
Read more >video decoding failed! : mp4, m4v, mp4 - krpano HTML5 Viewer
video decoding failed! had a video created and converted flv and DRM CONVERTER, also in flv, mp4 and m4v but still gives the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@alcere Figured out the issue. You can work-around it by removing
VideoFrameUriFetcher
like this (it’s safe to do so):The issue will be fixed in an upcoming patch release.
Thanks for the quick reply!!