Open colinrtwhite opened 3 years ago
Doesn't it already? https://coil-kt.github.io/coil/videos/
@PeterTheOne That adds support for decoding individual video frames.
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 😅
@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.
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?
@sagar-viradiya Gave a great talk on some of the internals here!
how to use imageloader in compose AsyncImage
@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
.
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.
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.