Search code examples
flutterblenderflutter-animationflutter-video-player

play video on flutter with transparent background


I did some complex 3d animations on blender and I want to play them on flutter. The problem is that when I export the animation into a video and I put it on my flutter app the transparent background is gone. I'm using video_player to play videos on flutter and the video extension I use is .webm because is the only one I know that can be readed on flutter and have a transparent background but the application puts a black background in the video.


Solution

  • The conclusion I get is that video player plugin is not the best idea to do it. So i've been searching about how flutter manage gifs and it's manage alpha channel perfectly because it can manage alpha channel on image. But the next problem is how to control the gif, for that I use gifimage plugin which works really well to reproduce an animation. Finally the last problem is to export from blender to a gif, blender can't export on gif format so you should export into a quicktime format with Qt animation codec and then convert it to gif. If for some reason the first frame of the gif stay as background of the gif you should edit the gif with photoshop for example and change in the timeline the first frame to not disappear to disappear.