Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VideoFrameDecoder fails decoding mp4 #732

Closed
alcere opened this issue Apr 20, 2021 · 5 comments · Fixed by #734
Closed

VideoFrameDecoder fails decoding mp4 #732

alcere opened this issue Apr 20, 2021 · 5 comments · Fixed by #734
Labels
bug Something isn't working

Comments

@alcere
Copy link

alcere commented Apr 20, 2021

Describe 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

@alcere alcere added the bug Something isn't working label Apr 20, 2021
@alcere
Copy link
Author

alcere commented Apr 20, 2021

@colinrtwhite
Copy link
Member

If you use https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4 (HTTPS) does it work? Android prevents unsecured traffic by default.

@alcere
Copy link
Author

alcere commented Apr 20, 2021

It doesn't work either, same error :(

@colinrtwhite
Copy link
Member

colinrtwhite commented Apr 22, 2021

@alcere Figured out the issue. You can work-around it by removing VideoFrameUriFetcher like this (it's safe to do so):

private val imageLoader = ImageLoader.Builder(binding.root.context)
        .componentRegistry {
            add(VideoFrameFileFetcher(binding.root.context))
            add(VideoFrameDecoder(binding.root.context))
        }
        .logger(DebugLogger(Log.VERBOSE))
        .build()

The issue will be fixed in an upcoming patch release.

@alcere
Copy link
Author

alcere commented Apr 22, 2021

Thanks for the quick reply!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants