Microsoft.DirectX.AudioVideoPlayback alternative in SharpDX - c#

I want to play a video, and this is how it is done in DirectX:
Microsoft.DirectX.AudioVideoPlayback.Video video = new Video(fileName);
video.Owner = panel1;
video.Play();
But I can't find AudioVideoPlayback in SharpDX, the DirectX API for .NET.
Is it supported in SharpDX? Any tip is appreciated.

For playing video in Windows 8.1 store apps and Windows Phone 8.1, the preferred method is using the XAML tools Microsoft provides in their framework that makes this fairly simple. See Quickstart: video and audio (XAML) for more details.
Managed DirectX was released in 2002[1] and based on DirectX 9. It has been deprecated for a while, which is why for users of managed code, libraries like SharpDX exist to provide a managed wrapper around the unmanaged (C++). In Windows Store and Windows 8.1 phone apps, DirectX 11 is required, which is why Managed DirectX wasn't working for you.

Related

How can I use DirectX to create a video editor in C#?

Is it possible to create a video editor in C# by using DirectX or should I use a different SDK to make a video editor? Keep in mind that I need to be able to animate objects (shapes and paths like in After Effects if possible).
There are really two Windows APIs you should consider for a video editor:
Media Foundation which is the modern Windows media API for video and audio.
DirectShow which is an older technology that dates back to the late 90s.
The DirectX SDK is not applicable to video application development. DirectShow was pulled out of the DirectX SDK back in April 2005. Media Foundation never shipped in the DirectX SDK. See DirectX SDKs of a certain age.
Note that even the DirectX SDK itself is legacy these days. See MSDN
Instead, these APIs are available in the Windows SDK. If you are using Visual Studio, you likely already have a copy of this SDK. For a list of versions, see A Brief History of Windows SDKs
To make use of either of these APIs from C#, you should take a look at Media Foundation and directshow.net.
There is a Direct3D 11 Video technology that is part of the DirectX 11.1 Runtime (Windows 8 SDK or later). It is extremely low-level and is really intended for things like Media Foundation itself to use as a renderer with some ability to do GPU acceleration of the processing.

OpenGL support in windows 8 store Application C#

Is OpenGL and OpenGL ES available for Windows 8 Store Application (want to run application in windows 8 pro tablet)?
and yes then it is available in C#?
(This above question is because i want chroma key composting "green screen" implement in windows 8 pro using OpenGL)
Microsoft Open Technologies are working on OpenGL ES support for Windows Store.
https://github.com/MSOpenTech/angle
It's written in C++.
Please find answer from here MSDN FORUMS
DirectX is available to Windows Store apps. OpenGL is not. How best to
perform a green screen will depend on what sort of green screen you
need. For advanced graphics you generally want DirectX, but for simple
static greenscreening you can access a WriteableBitmap's PixelBuffer
directly.
--Rob

Can I code Windows 8 RT Games in C#

Is it possible to code a Windows 8 RT and/or Windows 8 Phone game using C#?
I have done a fair amount of research on the "Games in C#" thing, so I thought I would post it for others:
XNA is an easy way to make a C# game. You can post a new XNA game on the Windows Store and it will work fine.
However, you cannot make a Windows Phone 8 or Windows 8 game using XNA. (You can only target version 7.1 of Windows Phone.) The new APIs for these operating systems are not supported in XNA.
However, both Windows Phone 8 and Windows 8 will run XNA apps. Those apps just cannot target any features that are specific to Windows 8 or Windows 8 Phone.
So to sum up. The current version of XNA (4.0) supports the older API to talk to Windows and Windows Phone. They can still run on Windows 8, but you can't use the newer stuff.
Microsoft does not have an offering to make games in C# for the new Windows 8 and Windows Phone 8 APIs.
However, if you don't mind using open source projects there are some things you can do to write a game in C# that can use the newer Windows 8 and Windows Phone 8 API:
MONOGAME
If you want to use XNA's api to make games for the new Windows 8 APIs you can use MonoGame (this is what I use). It is an open source api that implements the XNA API but has plugins for IOS, Android and Windows 8. This is a really good cross platform option. 3D graphics recently became supported by MonoGame(i.e. Infinite Flight, Armed). (Note: I am not affiliated with MonoGame in any way.)
SHARP DX (DirectX)
If you want a Microsoft Supported way to make a game that targets the Windows 8 API your best bet is DirectX. But Direct X is a C++ API. It is also really really hard.
If you are wanting to make a 2D game (like Plants vs Zombies or Angry Birds) then Direct X is overkill. You are far better off going the MonoGame route. I spent several days digging through tutorials and working very hard to understand Direct X. By the end of that time I was rewarded with the ability to draw a single triangle on the screen. (That same amount of time had my game loop going and sprites moving around in MonoGame.)
So I repeat, if you don't already know DirectX and you are making a 2D app, don't go down the DirectX/SharpDX road.
The DirectX 2D route is further hindered by Windows Phone 8 not supporting Direct2D. DirectX has a subset called Direct2D for 2D rendering. However, this subset is not supported on Windows Phone 8. The "replacement" (for now) is the Direct X toolkit.
If you are still all in with the Direct X road, then you can write it in C# using SharpDX. It is a C# wrapper for DirectX that works very well (though I don't know if it supports the Direct X Toolkit).
SUMMARY
The short of it (for me) is that Microsoft did not update their APIs for C# game development to support the new stuff in Windows 8 and Windows Phone 8. But MonoGame lets you use the XNA API to do just that. It also allows you to write cross platform games, so it is better anyway. (You get porting to IOS and Android for "Free".)
My game is well underway in MonoGame with no issues so far!

Playing AVI movie on directx 9 surface

I have got a directx9 window and i want to play an avi-video on a texture.
i have heard that i can use directshow to do this?
if this is really posssible, where can i find tutorials or sample code to do this?
thanks!
DirectShow Samples on MSDN:
Texture3D9 Sample Playback Draws video on a Microsoft DirectX 9.0 texture surface.
You will need to look for an older Windows SDK or DirectX SDK to find this sample though. I think it is removed from latest Windows SDK already.
\Samples\Multimedia\DirectShow\Players\Texture3D9

Can we use AudioEngine on Windows Phone 7?

I am porting a Windows XNA app to Windows Phone. It uses AudioEngine, SoundBank, Cue and WaveBank.
I am getting compile errors on Windows Phone 7 for these objects. Are these supported on Windows 7? If not, what's the path to port this stuff?
private Microsoft.Xna.Framework.Audio.AudioEngine audioEngine;
private SoundBank soundBank;
private WaveBank waveBank;
private Cue musicCue;
As per your previous question, no, XACT isn't supported on Windows Phone 7. MSDN (and Google search) is very clear about that.
And as for porting it, I recommend you read this blog post: Playing with Sound on XNA 4 WP7.
Next time, try do a little research yourself ;-)

Categories