Hello, I'm trying to use the pyglet.media.Player, in tandem with FFmpeg, to play back some animations. These animations are primarily in WebM format, containing an alpha channel. From what I understand, FFmpeg does indeed support alpha channels in VP8/9. On a browser, these WebM files render with the alpha channel as expected.
However, it seems that during playback with the Player, the animation works, but the alpha channel is substituted with a white matte solely in the Player's render/blit area. To try to solve a slight loop delay issue, I can also try to load the WebM file and then call get_animation() on it and then work with it as if it were an animated sprite. However, not only does the animation not work, but also the first frame is also flipped upside down and the background matte is white just like before. (Actually, this seems to happen with any sort of source that I load with pyglet.media.load...) This leads me to doubt whether or not pyglet currently supports sources with an alpha channel. My suspicion is that the modification that need be done is not that complicated - I am looking at pyglet/media/sources/ffmpeg.py line 814, an ImageData of RGBA instead of RGB should be made if an option is passed in. Likewise on line 851 and 857, instead of AV_PIX_FMT_RGB24, we'd want to use a pixel format of AV_PIX_FMT_RGBA if we want an alpha. I'll fiddle around with this for a while and see if I can get something to work. Thanks in advance. -- You received this message because you are subscribed to the Google Groups "pyglet-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/pyglet-users. For more options, visit https://groups.google.com/d/optout.
