SharpDX MediaFoundation and DirectShow
-
I'm somewhat new to DirectX programming and need a bit of guidance. My requirement is currently limited to video and 2D drawing and so far I've managed to get SharpDX to play a video from a file without problems, and also have been able to do my 2D drawing. This was simple enough and the performance is good. Ultimately, my video source will need to be video input devices ( i.e. web cams, video capture cards, etc. ). My question is: Does SharpDX.MediaFoundation include DirectShow wrappers such that I can access and play video from local video input devices? If so, can someone point me in the right direction and link some examples of using SharpDX for this purpose? Many thanks.
-
I'm somewhat new to DirectX programming and need a bit of guidance. My requirement is currently limited to video and 2D drawing and so far I've managed to get SharpDX to play a video from a file without problems, and also have been able to do my 2D drawing. This was simple enough and the performance is good. Ultimately, my video source will need to be video input devices ( i.e. web cams, video capture cards, etc. ). My question is: Does SharpDX.MediaFoundation include DirectShow wrappers such that I can access and play video from local video input devices? If so, can someone point me in the right direction and link some examples of using SharpDX for this purpose? Many thanks.
Quote:
NOTE: As of 29 Mar 2019, SharpDX is no longer being under development or maintenance
Are you sure you still want to go down SharpDX path? Sadly, the only .NET wrapper for DirectX anything that I know of, that is still in development, DirectN[^].
Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles.
Dave Kreskowiak -
Quote:
NOTE: As of 29 Mar 2019, SharpDX is no longer being under development or maintenance
Are you sure you still want to go down SharpDX path? Sadly, the only .NET wrapper for DirectX anything that I know of, that is still in development, DirectN[^].
Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles.
Dave KreskowiakI understand it's no longer supported, but it's battle tested and I don't think the risk at present is any greater than investing in the "latest and greatest" GUI framework only to have it killed off before it gets off the ground. Besides, I feel if I use SharpDX to get a better handle on the underlying concepts, porting to something new(er) when required would be easier. As to my original question, I know there's other NuGet packages that make easy work of displaying camera input ( i.e. AForge, Accord ), but I'm not convinced they're taking full advantage of the GPU, which is what I'm looking for. Specifically, I need to route the capture byte stream directly to the mediaengine's render surface as I'll be dealing with larger sizes and framerates.
Regards, R. Wey
-
I understand it's no longer supported, but it's battle tested and I don't think the risk at present is any greater than investing in the "latest and greatest" GUI framework only to have it killed off before it gets off the ground. Besides, I feel if I use SharpDX to get a better handle on the underlying concepts, porting to something new(er) when required would be easier. As to my original question, I know there's other NuGet packages that make easy work of displaying camera input ( i.e. AForge, Accord ), but I'm not convinced they're taking full advantage of the GPU, which is what I'm looking for. Specifically, I need to route the capture byte stream directly to the mediaengine's render surface as I'll be dealing with larger sizes and framerates.
Regards, R. Wey
Add WPF to your search keywords. directx4wpf [CodePlex Archive](https://archive.codeplex.com/?p=directx4wpf) [c# - Attach DirectShow video window to WPF Control - Stack Overflow](https://stackoverflow.com/questions/39604743/attach-directshow-video-window-to-wpf-control)
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it. ― Confucian Analects: Rules of Confucius about his food
-
Add WPF to your search keywords. directx4wpf [CodePlex Archive](https://archive.codeplex.com/?p=directx4wpf) [c# - Attach DirectShow video window to WPF Control - Stack Overflow](https://stackoverflow.com/questions/39604743/attach-directshow-video-window-to-wpf-control)
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it. ― Confucian Analects: Rules of Confucius about his food
I'm using WinForms (yeah, I know ... old school), tho I don't think that makes much difference as in the end its simply the window/control Handle that has to be specified as the swapchain.OuputHandle. I'm doing that already for playing a video file as a test and performance is very good. When looking through SharpDX.MediaFoundation with Reflector, I get the strong feeling it provides the means for capture input, but I can't find any complete examples in that specific area.
Regards, R. Wey
-
I'm using WinForms (yeah, I know ... old school), tho I don't think that makes much difference as in the end its simply the window/control Handle that has to be specified as the swapchain.OuputHandle. I'm doing that already for playing a video file as a test and performance is very good. When looking through SharpDX.MediaFoundation with Reflector, I get the strong feeling it provides the means for capture input, but I can't find any complete examples in that specific area.
Regards, R. Wey
And herein lies the problem with using a library that's been dead in the water for two years, lack of support. I can't help you as I've never used the thing.
Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles.
Dave Kreskowiak -
And herein lies the problem with using a library that's been dead in the water for two years, lack of support. I can't help you as I've never used the thing.
Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles.
Dave KreskowiakNo problem. Given that it saw over 2.5 million downloads, I figured there might be somebody that used it for this purpose and I don't think DirectX11 is going anywhere any time soon. As for newer platforms, I unfortunately don't have a lot of experience with them so I'm concerned about the stumbling block that would present and not knowing their limitations. I could struggle my way thru UWP, but using what accelerated graphics API? Win2D? WinUI3? DirectN ? It's hard to know which platform to choose that will still be around by the time I learn it.
Regards, R. Wey
-
Add WPF to your search keywords. directx4wpf [CodePlex Archive](https://archive.codeplex.com/?p=directx4wpf) [c# - Attach DirectShow video window to WPF Control - Stack Overflow](https://stackoverflow.com/questions/39604743/attach-directshow-video-window-to-wpf-control)
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it. ― Confucian Analects: Rules of Confucius about his food
Cool
-
I'm using WinForms (yeah, I know ... old school), tho I don't think that makes much difference as in the end its simply the window/control Handle that has to be specified as the swapchain.OuputHandle. I'm doing that already for playing a video file as a test and performance is very good. When looking through SharpDX.MediaFoundation with Reflector, I get the strong feeling it provides the means for capture input, but I can't find any complete examples in that specific area.
Regards, R. Wey
seems nice