how play video with alpha ( vp9 alpha encoding .webm ) PIXI.Texture.fromVideo

ps: I do not know if it's my javascript code, so i post this issue in javascript support.

hi everybody, I can not play a transparent video with pixi.
do you have any idea why i have this issue ?
68747470733a2f2f692e696d67626f782e636f6d2f75576864387650592e676966


i see here we can do it withy chromius add the support FFmpeg/FFmpeg

So i use the FFmpeg .webm (RGBA || yuva420p)
see link here:
https://github.com/FFmpeg/FFmpeg/commit/acca56d9629b7fc158ce188190d22314c3d92c39


so i try 2 configu on the trancoding, but PIXI show alway video with black background !!?.
-pix_fmt yuva420p || -pix_fmt rgba
68747470733a2f2f692e696d67626f782e636f6d2f636a6156427175792e6a7067

Someone has an idea of what I do wrong.
68747470733a2f2f692e696d67626f782e636f6d2f7a684c75716675692e6a7067


I looked at some methods here,
https://developer.mozilla.org/fr/docs/Web/API/HTMLMediaElement

but nothing seems to can solve my problem.
Thanks for all help that yours can bring me.
Hey man, this is a common problem in PIXI I think. Surfing in the internet you can find some people that has tried to make some fixes. Try to make a new plugin file named, for example, pixi-patch.js and paste this code there:

Code:
PIXI.glCore.GLTexture.prototype.upload = function(source)
{
    this.bind();

    var gl = this.gl;

    gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, this.premultiplyAlpha);

        var isVideo = !!source.videoWidth;
    var newWidth = isVideo ? source.videoWidth : source.width;
    var newHeight = isVideo ? source.videoHeight : source.height;

    if(newHeight !== this.height || newWidth !== this.width || isVideo)
    {
        gl.texImage2D(gl.TEXTURE_2D, 0, this.format, this.format, this.type, source);
    }
    else
    {
        gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, this.format, this.type, source);
    }

    this.width = newWidth;
    this.height = newHeight;

};

I don't know if this can solve the problem, but at least you can try!

Source:
yes a see this code.

i also try replace original pixi code in the core with this to test.
but not work, i have black background.
PHP:
Texture.prototype.upload = function(source)
{
   this.bind();

   var gl = this.gl;

   gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, this.premultiplyAlpha);

       var isVideo = !!source.videoWidth;
   var newWidth = isVideo ? source.videoWidth : source.width;
   var newHeight = isVideo ? source.videoHeight : source.height;

   if(newHeight !== this.height || newWidth !== this.width || isVideo)
   {
       gl.texImage2D(gl.TEXTURE_2D, 0, this.format, this.format, this.type, source);
   }
   else
   {
       gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, this.format, this.type, source);
   }

   this.width = newWidth;
   this.height = newHeight;

};
the alpha are ok iwht very old forma VP8, but is very scappy S^%$#
36hxedG9.gif


i send the video webm + alpha encoded.
Is some can get it to work !
I am discouraged.
I will surely opt for another technique with png image in batch.
RGB32 seem work with VP9 .webm
and i remove -pix_fmt yuva420p , i just dont use it at all!
PHP:
FFVideoSource("%source_file%", colorspace = "RGB32", \
              cachefile = "%source_temp_file%.ffindex")
i find it int this index
http://avisynth.nl/index.php/Avisynthplus_color_formats

But i have a strange repainting.
Almost looks like image stacked in overlay, not clearing or displaying per frame !!!
am shure is a pixi bug !
very strange

68747470733a2f2f692e696d67626f782e636f6d2f6f6c734a395830482e676966
RGB32 seem work with VP9 .webm
and i remove -pix_fmt yuva420p , i just dont use it at all!
PHP:
FFVideoSource("%source_file%", colorspace = "RGB32", \
              cachefile = "%source_temp_file%.ffindex")
i find it int this index
http://avisynth.nl/index.php/Avisynthplus_color_formats

But i have a strange repainting.
Almost looks like image stacked in overlay, not clearing or displaying per frame !!!
am shure is a pixi bug !
very strange

68747470733a2f2f692e696d67626f782e636f6d2f6f6c734a395830482e676966

Sorry for necropost, but have you resolved? I'm becoming mad trying to display webm with alpha with no results...
Sorry for necropost, but have you resolved? I'm becoming mad trying to display webm with alpha with no results...
i use sequence png only, no more alpha video codec, they are really bad.
Extract you video and make package with texturePacker are the only way i use now.
i use sequence png only, no more alpha video codec, they are really bad.
Extract you video and make package with texturePacker are the only way i use now.

Damn... really? Why they are really bad? I don't understand.

Have you succeded to run a video with alpha? Yes or no? Why is it so bad?

However, can you explain me a little how to do this workaround? I mean, i have created an animation on adobe after effects with transparent background and i thought i could reproduce it on the screen of the game, without the black background ç_ç
i never found codec setting who worked fine with alpha in pixi4< , may more luck for v5.
actually AE allowing png sequencing with alpha on export setting
1610529687004.png

Than you pack this in texturePacker.
Than you use sprite animation or any renderer method you want.
ok added update for future issue, thanks DarkSeario to wakeup this tread.
workedsince v5.1.2> only
i added demo here.

Above versions (5.1.1<) produce backscreen and repainting.
So rmmv or rmmz need update to min 5.1.2
Don't suppose anyone has found a solution to this yet?
If anyone is interested I found an almost perfect workaround that despite only testing a couple of times, has got me a perfect result.
Don't suppose anyone has found a solution to this yet?
If anyone is interested I found an almost perfect workaround that despite only testing a couple of times, has got me a perfect result.
hi ADBOY9000, what's the soultion you've found? I'm also looking for a workaround.
hi ADBOY9000, what's the soultion you've found? I'm also looking for a workaround.
I'll have to double check the links as I haven't been on my project recently, but basically you need Yanflys grid free doodads (and add on) to start and then...
- Someone made an add on for the plugin that starts animated doodads from their first frame when they become visible, locate that (if I can relocate it I'll link it)
- create switches to act as animation on and off triggers.
- When your animation is supposed to start, turn the animation trigger ON.
- In a parallel event, put a wait X frames and then turn the animation trigger off. This will take a bit of trial and error to not get your animation to loop back as I feel it doesn't sync perfectly to frames, but I put some blank frames at the start and end of my animations to give some room for error.
- Turn all animation triggers off once everything is done so they can be reused for other maps.

With this technique you can chain animations together, I have a Lazer blast coming on, then looping animation as my characters talk, then an off animation when the scene concludes, as you never know how fast your player reads.

Hope this helps, let me know if anythings confusing and I'll try to find that code edit for doodads when I get back into my game.
Following on from my last reply: I couldn't find the link myself, but I know how long I spent looking for this solution so couldn't leave it unresolved... Sorry I can't remember the persons name so cannot shout out to them, but they gave it away for free (and are a godsend) so I assume it's okay to post.

Basically you want to replace YEP_X_ExtDoodadPack1 with this one I have labeled "update", it has the correct code. This should make all your animated doodads start from frame 1 once they are activated rather than continuously loop from the moment the map loads.

Please be safe and backup original files just in case, but I took this straight from my JS folder.
hi ADBOY9000, what's the soultion you've found? I'm also looking for a workaround.

Original thread: https://forums.rpgmakerweb.com/threads/how-play-video-with-alpha-vp9-alpha-encoding-webm-pixi-texture-fromvideo.82002/