简体   繁体   English

如何在媒体元素中播放透明背景avi文件?

[英]How to Play Transparent background avi file in media element?

I have a video with transparent background in .avi format (Made from Adobe After Effects), but the transparent background appears black in mediaelement. 我有一个具有.avi格式透明背景的视频(由Adobe After Effects制造),但是透明背景在mediaelement中显示为黑色。 Media Player has no background property also. Media Player也没有背景属性。

What should i use so that this media element plays the file and when placed on an image takes that image as its background. 我应该使用什么来使该媒体元素播放文件,并将其放置在图像上时以该图像作为背景。 (No i cannot embed that image in the avi file as my image keeps changing). (不,我的图像不断变化,我无法将该图像嵌入到avi文件中)。

*If my approach is wrong please let me know. *如果我的方法有误,请告诉我。

另一个解决方法是使用颜色键控-在视频中添加一种(或多种)颜色,然后通过WPF EffectBitmapEffectShaderEffect )将其转换为透明度。

I'm afraid using the normal wpf media player this can't be done. 恐怕无法使用常规的wpf媒体播放器完成此操作。

The mediaplayer ignores the transparent regions, even with video formats that accept it. 媒体播放器会忽略透明区域,即使使用接受它的视频格式也是如此。 From memory, i dont think AVI files support transparent regions. 从内存来看,我不认为AVI文件支持透明区域。 MOV files do. MOV文件呢。

Having said that, and although it could be a very complicated task, it may be possible to enhance the WPFMediaKit mediaplayer to do what you want. 话虽如此,尽管这可能是一个非常复杂的任务,但是可以增强WPFMediaKit媒体播放器来执行您想要的事情。

http://wpfmediakit.codeplex.com/ http://wpfmediakit.codeplex.com/

J Morrill the author of wpfmediakit may be able to let you know if it is possible or not. wpfmediakit的作者J Morrill可能会让您知道是否可能。

I might add that i got around this problem in a project once by using a sequence of .png files that played a short 10 second movie. 我可能会补充说,我曾经使用一系列播放短短10秒电影的.png文件解决了这个问题。 Of course this is not an ideal solution, but it got me out of a jam 当然,这不是理想的解决方案,但这使我摆脱了困境

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM