1

I'm playing video on my form using DirectX AudioVideoPlayback. Source code is pretty simple

using System;
using System.Windows.Forms;
using Microsoft.DirectX.AudioVideoPlayback;

namespace WindowsFormsApplication1
{
public partial class Form2 : Form
{
    public Video MyVideo;

    public Form2()
    {
        InitializeComponent();
        ShowVideo();
    }

    void ShowVideo()
    {
        MyVideo = new Video("bottle.mp4", true);
        MyVideo.Owner = this;            
    }
}
}

video itself bottle.mp4 designed the way that it can have transparent background

http://youtu.be/T35kGZMXg5g

Here are my questions:

  1. How can I put my custom background image instead of green video background?
  2. How can I make this background transparent? So I can see the bottle and my desktop behind it
  3. Is it necessary to have h.264 (.mp4) format video, will this also work with .wmv file?

Thanks.

Soner Gönül
  • 97,193
  • 102
  • 206
  • 364
Michael Samteladze
  • 1,310
  • 15
  • 38
  • Note that this is using the legacy Managed DirectX 1.1 assemblies which in turn use DirectShow. Be sure to read [DirectX and .NET](http://blogs.msdn.com/b/chuckw/archive/2010/12/09/directx-and-net.aspx). – Chuck Walbourn Nov 29 '14 at 07:16
  • So as I understood directx SDK is depricated and while my only goal is video, not game development, you'd suggest to use directshow rather than directx? – Michael Samteladze Dec 01 '14 at 10:08
  • DirectShow is the only 'DirectX' component for video, and you get it from the Windows SDK and not the legacy DirectX SDK--it was moved out of the DirectX SDK back in ~2005. See [DirectX SDKs of a certain age](http://blogs.msdn.com/b/chuckw/archive/2012/08/22/directx-sdk-s-of-a-certain-age.aspx). The DirectShow.NET wrapper I mention is an option here for C# usage. – Chuck Walbourn Dec 01 '14 at 16:56
  • 1
    BTW, Direct3D 11.1 (Windows 8.0, [Windows 7 SP1 + KB 2670838](http://blogs.msdn.com/b/chuckw/archive/2013/02/26/directx-11-1-and-windows-7-update.aspx)) does have "Direct3D 11 Video" which is extremely low-level and you should really look at Media Foundation instead on those platforms. – Chuck Walbourn Dec 01 '14 at 17:00
  • So as I understood DirectX is more gaming direction and I should better consider Media Foundation .Net right? – Michael Samteladze Dec 04 '14 at 09:58
  • 1
    "DirectX" as a brand is historically about gaming, yes, and primarily 2D and 3D graphics. It's not really so much about video processing. "DirectShow" was really a media project shoved into the "DirectX" brand... it was originally called "ActiveMovie". DirectShow is the legacy video API for Windows that still does some stuff the 'current' video API for Windows doesn't (Media Foundation) and is supported on Windows XP. If you are targeting Windows Vista or later, then you should consider Media Foundation as a first choice for video work on Windows. – Chuck Walbourn Dec 04 '14 at 19:30
  • Yes my target is Windows Vista and higher. So I'll try Media Foundation. Thanks Chuck. – Michael Samteladze Dec 05 '14 at 11:22

0 Answers0