如何在媒体元素中播放透明背景 avi 文件? [英] How to Play Transparent background avi file in media element?

查看:55
本文介绍了如何在媒体元素中播放透明背景 avi 文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 .avi 格式的具有透明背景的视频(由 Adob​​e After Effects 制作),但透明背景在 mediaelement 中显示为黑色.媒体播放器也没有背景属性.

I have a video with transparent background in .avi format (Made from Adobe After Effects), but the transparent background appears black in mediaelement. Media Player has no background property also.

我应该使用什么来让这个媒体元素播放文件,并在放置在图像上时将该图像作为其背景.(不,我无法将该图像嵌入到 avi 文件中,因为我的图像不断变化).

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).

*如果我的方法有误,请告诉我.

*If my approach is wrong please let me know.

推荐答案

恐怕使用普通的 wpf 媒体播放器无法做到这一点.

I'm afraid using the normal wpf media player this can't be done.

媒体播放器会忽略透明区域,即使是接受它的视频格式.从记忆中,我不认为 AVI 文件支持透明区域.MOV 文件可以.

The mediaplayer ignores the transparent regions, even with video formats that accept it. From memory, i dont think AVI files support transparent regions. MOV files do.

话虽如此,虽然这可能是一项非常复杂的任务,但可能可以增强 WPFMediaKit 媒体播放器以执行您想要的操作.

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.

http://wpfmediakit.codeplex.com/

wpfmediakit 的作者 J Morrill 可能会告诉您是否可行.

J Morrill the author of wpfmediakit may be able to let you know if it is possible or not.

我可能会补充说,我曾经在一个项目中通过使用播放 10 秒短片的 .png 文件序列解决了这个问题.当然这不是一个理想的解决方案,但它让我摆脱了困境

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. Of course this is not an ideal solution, but it got me out of a jam

这篇关于如何在媒体元素中播放透明背景 avi 文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆