SuRGeoNix / Flyleaf

Media Player .NET Library for WinUI 3/ WPF/WinForms (based on FFmpeg/DirectX)
GNU Lesser General Public License v3.0
713 stars 101 forks source link

A way to work with alpha video(WPF) #492

Open LazyCuteLion opened 2 months ago

LazyCuteLion commented 2 months ago

1、FlyleafHost line-880,change the border.background to #01000000 2、Renderer.PixelShader line-560 cancel this line,does not use BlendState(if you did not do it,then you will got repetitive frame of the video) 3、Renderer.Present line-126 and 247 cancel these two line, does not use ClearRenderTargetView,beacuse of it will ignore the A of the second parameters(even it is Color4) and give a solid color. 4、there have a apng to test,you also can converter to a mov qie_640x360 5、this has some flaws,there are burrs on the edges (same video,ffmediaelement rendering good). hope someone can fix it. Snipaste_2024-08-02_16-40-06

LazyCuteLion commented 1 month ago

on the last point, some progress has been made: ShaderCompiler line-366 add "color.rgb *= color.a;"

LazyCuteLion commented 1 week ago

https://github.com/LazyCuteLion/Flyleaf/tree/alpha_video

LazyCuteLion commented 17 hours ago

WinUI3 has some progress: use WinUIEx,set the Window.SystemBackdrop to TransparentTintBackdrop, and change the line-157 of Renderer.SwapChain.cs(set alpha to true of GetSwapChainDesc).Then,it renderering as same of WPF,but,it can't be mouse through. I think,the FlyleafHost(WinUI3) should be change as same of WPF,use a Window host the SwapChainPanel. Do you have any time to try it? @SuRGeoNix

SuRGeoNix commented 16 hours ago

Not really, maybe in 1-2 weeks... I'm trying to release v3.8 with updated vortice/custom generator-ffmpeg libraries and some other libs that will be the entry level for v4.

LazyCuteLion commented 16 hours ago

Ok.But I really want it can support alpha. Look forward to your new version.