|
|
Aug
11
Written by:
Jeremiah Morrill
8/11/2008 11:52 AM
Everyone grab a copy of .NET 3.5 SP1, its RTM. For this RTM release I have a new DirectShow video player that utilizes the D3DImage, for pretty seamless WPF->DShow interop. The code is a mess, there are big bugs, leaks and I'm using D3DImage slightly incorrectly, but besides that, This is just a rough preview that I'd like anyone who is interested to give it a run and see what the performance characteristics are like or any other feedback. The demo application has a DVD player, Webcam and file player. SP1 RTM is required. Download here: http://jmorrill.hjtcentral.com/Portals/21/Blog/Files/D3DImageExample.zip
Tags:
17 comments so far...
Re: D3DImage VideoPlayer
Glad to see you posting again. You had me scared for awhile. You posts and projects are valuable to us all, we appreciate your time.
By Chris on
8/12/2008 9:00 AM
|
Re: D3DImage VideoPlayer
Thanks for this, we are keeping a close eye on this over at www.meedios.com, it would be great to have a proper DVD player using WPF.
By Zag on
8/12/2008 12:45 PM
|
Re: D3DImage VideoPlayer
Just finished implementing the D3DImage in SichboPVR (http://pvr.sichbo.ca) tonight also. So far so good (I think) So long MediaElement anyhow!
I found I had to add a Quality slider setting and use D3D StretchRectangle() during PresentImage so that it can scale down 1080i content to 720i Surface for slower machines. (This of course doubles as a YUV->RGB conversion.) WPF CPU usage seems to correlate with the size of the Surface you've handed it. So long as the surface isn't too large, it can scale it right across your monitor quite nicely with not too bad frame rate.
By Sichbo on
8/12/2008 6:52 PM
|
Re: D3DImage VideoPlayer
Hey Sichbo,
Did my code help you or did you roll your own D3DImage solution? I was thinking about trying to support the EVR and MediaFoundation also in the future.
-Jer
By Jeremiah Morrill on
8/14/2008 5:56 AM
|
Re: D3DImage VideoPlayer
This is just what I was looking for. Please keep it up, and tweek on the performance.
/Ken
By Ken on
8/18/2008 11:50 AM
|
Re: D3DImage VideoPlayer
Hi Ken!
I don't know the performance characteristics on other OS's if you aren't running Vista SP1. I do have to say with the computers I have tested on (some slow, some fast), the D3DImage provides great performance, near that of MediaElement. There's really not much more I can do with performance as I'm just using the raw DShow, D3D and WPF. You can do like Sichbo said and lower the surface dimensions for better performance on low end hardware.
-Jer
By Jeremiah Morrill on
8/18/2008 12:51 PM
|
Re: D3DImage VideoPlayer
Jer, performance (in speed) was maybe the wrong word to use.
I run Vista (32 bit) on a Quad code (2.4) with GeForce 8800GT, so it runs realy smooth and video clip starts much fatster than MediaElement. And a big plus is that I can play .VOB files, MediaPlyar can't do that. And I can now easily build my own graph for TV card (BDA).
But it seem to leek memory (not releasing when I load another video clip).
/Ken
By Ken on
8/19/2008 9:34 AM
|
Re: D3DImage VideoPlayer
Thanks for the feedback Ken!
Yeah I have a few memory leaks in this version. I suspect it's a COM interface or some D3D stuff I'm not releasing. I'm working a new, clean version that should fix that. Let me know if you see anything in the code that is a obvious leak.
-Jer
By Jeremiah Morrill on
8/19/2008 9:44 AM
|
Re: D3DImage VideoPlayer
Jer,
Great work as usual. Looking forward to the clean version. That will finally convince my boss that we need to be coding for 3.51 and not 3.0! (I suspect my CC issues are going to be much easier to solve now.)
-Eric
By Eric Meyer on
8/20/2008 5:39 AM
|
Re: D3DImage VideoPlayer
Hey Jer,
Didn't get a chance to take a look at your work, just rolled my own. Performance is still not where I'd like it to be. Everybody seems to render on CompositionTarget.Rendering -- for me this gives choppy playback, even when checking RenderingEventArgs.RenderTime for duplicate frame renders, and of course only rendering when the VMR9 Custom A/P has pushed a frame onto the surface for us to hand off.. Better performance seems to come from a simple DispatcherTimer running @ 30ms, but still not quite smooth enough.
By Sichbo on
8/23/2008 12:38 PM
|
Re: D3DImage VideoPlayer
sichbo, just don't update on the rendering event. Update on each frame via the dispatcher. It yields great performance this way.
By Jeremiah Morrill on
8/23/2008 6:48 PM
|
Re: D3DImage VideoPlayer
Would you happen to know how to support interactive menus?
By Brandon on
8/31/2008 2:58 PM
|
Re: D3DImage VideoPlayer
i can't get the VMR9 work in renderless mode when using a dvb-t as source. i think it disables the YUV->RGB Convertor or something... it simply doesn't work...
any suggestions?
By scors.agra on
9/9/2008 8:07 AM
|
Re: D3DImage VideoPlayer
scors.agra,
This is probably because your GPU doen't support YUV on a D3D surface. I have a fix for this in my new project (WPF MediaKit), but this prototype probably isn't supported. Hopefully by the weekend I'll have it up on codeplex.
-Jer
By Jeremiah Morrill on
9/9/2008 8:33 AM
|
Re: D3DImage VideoPlayer
I'm trying to build DVD Player . But when I run your application the application is not displyaing anything as shown in the picture given along with this article. Also when I press the button it starts a new window "ActiveMovie" window. Can you please help me to understand this? I'm trying to build one dvd player app using d3dimage. Please help
By John on
9/14/2008 4:26 PM
|
Re: D3DImage VideoPlayer
About the interactive menus... It seems like the active button does not get highlighted. You mentioned a problem with using SelectionAt with VMR9 in renderless mode, but this is even before any mouse event. Would you have an idea of what could be causing this? I'm trying to integrate a DVD player in my WPF app and keyboard navigation would be fine too.
Thanks! --h
By hanh on
10/28/2008 11:33 PM
|
Re: D3DImage VideoPlayer
The button not getting highlighted is because the subpicture pin is not rendered - probably on purpose because of the issues regarding ActivateButton. Actually, the problem with the SelectAtPosition, etc. and interactive menus crashing are caused by "OnNewAllocatorFrame" calling the Dispatcher.Invoke. Anyway, all is good now. Thanks
By hanh on
10/30/2008 10:13 AM
|
|
|
Text/HTML
|
 |
|
|
|
|
|