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

Add support for MP4 videos #605

Open
colinrtwhite opened this issue Dec 3, 2020 · 9 comments
Open

Add support for MP4 videos #605

colinrtwhite opened this issue Dec 3, 2020 · 9 comments
Labels
enhancement New feature or request help wanted Issues that are up for grabs + are good candidates for community PRs

Comments

@colinrtwhite
Copy link
Member

colinrtwhite commented Dec 3, 2020

It would be great if Coil could support short MP4 videos. MP4 is now commonly used for the same use case as GIF, however it's much more efficient. Similar to GIFs, we would have to buffer the video into memory so we wouldn't be able to support large/long videos.

This would not be a replacement for ExoPlayer, which should be used to handle long videos and any advanced functionality. Any Coil MP4 support would likely only support start/stop and how many iterations to repeat.

@colinrtwhite colinrtwhite added enhancement New feature or request help wanted Issues that are up for grabs + are good candidates for community PRs labels Dec 3, 2020
@PeterTheOne
Copy link

Doesn't it already? https://coil-kt.github.io/coil/videos/

@colinrtwhite
Copy link
Member Author

colinrtwhite commented Jun 24, 2022

@PeterTheOne That adds support for decoding individual video frames.

@atulgpt
Copy link

atulgpt commented Feb 1, 2023

Hi, @colinrtwhite any pointers on how to implement this? I am planning to take this issue and wanted to know upfront what I am getting into 😅

@colinrtwhite
Copy link
Member Author

@atulgpt I think the biggest challenge will be figuring out how to get MP4s to be represented as a Drawable. Ideally we could use MediaMetadataRetriever to decode the mp4 into a custom drawable, though there are probably design limitations there.

@atulgpt
Copy link

atulgpt commented Mar 29, 2023

Hi @colinrtwhite, Let me sync the project and see how the coil works. BTW, are there any talks or blogs that explain (or give pointers) the internal working of coli?

@colinrtwhite
Copy link
Member Author

@sagar-viradiya Gave a great talk on some of the internals here!

@fansangg
Copy link

how to use imageloader in compose AsyncImage

@vladmircan
Copy link

@colinrtwhite Is there any timeline for this feature?
I'm currently developing a project from scratch and I wanted to know if I should delay the video implementation so that I can do it using Coil.

@colinrtwhite
Copy link
Member Author

I think the best way to implement this would be to create a Decoder.Factory that wraps FFmpeg. You can then read the ImageSource and wrap the output as a coil3.Image. I don't have plans to work on this so someone else will need to implement this. Depending on the complexity of supporting this it might make sense to have MP4 support as an external library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Issues that are up for grabs + are good candidates for community PRs
Projects
None yet
Development

No branches or pull requests

5 participants