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
Related
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.
I have to display a video stream from an ethernet camera into a WinForm C# 4.0 application. I made some tests with the software of the camera and I saw that the image provided by the camera was distorted by lenses.
I know that it's possible to correct the image using a calibration grid.
Do you have any feedback about some image processing libraray that can be use for this purpose? The library not necessary need to be free.
For some other projects I use Halcon or OpenCV, but I don't know witch one is the best for that.
Thanks in advance.
OpenCV can do it without any problem. There are a lot of implementations of camera calibration with OpenCV:
Here you have the official version of EmguCV calibration, it uses the CameraCalibration class
Or you can find the official OpenCV's sample application of camera calibration on OpenCV's GitHub, but this one is a native implementation.
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.
I'm trying to apply an effect on a mediacapture stream for a WPF app I'm porting over to Metro. In the WPF app I used Pixel shaders to modify a bitmap whose source was set to the stream of a webcam, but since effects have been dropped for Metro I'm looking for an alternative solution.
The best, and most Metro standards compliant, way of doing this that I've found is building my own MFTs and adding them to my MediaCapture element via the addEffectAsync() method. I've downloaded the MFTGrayscale and MediaExtension examples which show how to apply these effects to a MediaCapture element, but I'm having an issue understanding the actual C++ MFT code. Can someone point me to or give a decent walkthrough/explanation of how I'd go about building my own MFT effect from the ground up? I don't know too much C/C++, just enough to understand some of the example code. I'm really having trouble with the conceptual and architectural aspects of MFT, and hence am very confused by the source code.
Your help is very much appreciated.
EDIT:
Another option I'd consider is using SharpDX. However I'm having issues getting a stream of the MediaCapture object to display on a xaml image element. Any help would be appreciated. Thanks.
You should absolutely have a look at the following git repo: https://github.com/mmaitre314/VideoEffect
It shows how to apply image effects from the Lumia Imaging SDK, Win2D, and DirectX HLSL pixel shaders to videos in Universal Store Apps for Windows Phone 8.1 and Windows 8.1.
Effects can be applied via MediaTranscoder, MediaComposition, MediaCapture, or MediaElement. And the binaries are available via NuGet.
I ended up getting answer on the MSDN forums. It's not an ideal answer, but it's what I'd been fearing all along.
http://social.msdn.microsoft.com/Forums/en-US/winappswithcsharp/thread/f3a6934e-df7a-44da-bfd8-7b95d494ff43/#90690f89-e57d-4043-9881-60fcc587f736
This is totally doable... I've just rewritten one of the MF transforms from the samples to use the Nokia Imaging SDK and apply filters in real-time to webcam video. You can see how I did it at the link below (plus download some source code). It's not exactly what you need to do, but in the wiki page I explain what you need to change from the boilerplate sample that MS provided.
http://developer.nokia.com/community/wiki/Template_universal_app_for_video_recording_with_MediaCapture_using_Imaging_SDK_Filters
I want to record my kinect camera vision.I have searched, but I couldn't find any C# same core codes. Do you have same simple codes or same suggestions? thanks.
I believe the AForge library may be of use to you. Here: http://www.aforgenet.com/framework/features/ffmpeg.html you can see how you can instantiate a VideoFileWriter and write individual frames into it.
I am using this kinect record library for the kinect Kinect toolbox library
http://kinecttoolbox.codeplex.com/
and here is a tutorial
http://blogs.msdn.com/b/eternalcoding/archive/2011/07/04/gestures-and-tools-for-kinect.aspx