Nikhil Agrawal
Nikhil Agrawal

Reputation: 48590

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. Media Player has no background property also.

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.

Upvotes: 2

Views: 4387

Answers (2)

xmedeko
xmedeko

Reputation: 7820

Another workaround is to use color keying - assing a color (or more colors) in your video, which you translate to the transparency by a WPF Effect(BitmapEffect or ShaderEffect).

Upvotes: 0

Anton
Anton

Reputation: 7719

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

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.

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/

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

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

Upvotes: 1

Related Questions