|
Nov
16
Written by:
Jeremiah Morrill
11/16/2008 4:00 PM
I just added the ability to use anything derived from my D3DRenderer class (ie MediaUriElement), to be used as a VisualBrush, on any thread. If you've ever tried using the VisualBrush on these elements from another thread, you'll find that it does not work. This fixes that with a method on D3DRenderer called CloneD3DRenderer. There is also a new DP on the D3DRenderer called IsRenderingEnabled, so if a particular instance of the D3DImage you need to stop rendering to save some processing cycles, this is how you do it ;). Get the new source at: http://www.codeplex.com/WPFMediaKit
Tags:
17 comment(s) so far...
Re: Small feature added to the WPF MediaKit
Jeremiah,
Have you figured out how to auto play the DVDs or interact with the DVD menus?
Thanks
By Chris Kiszka on
11/17/2008 4:25 PM
|
Re: Small feature added to the WPF MediaKit
Hello Jeremiah,
I've successfully being using wpfmediakit to do live tv with timeshifting. it works well for getting direct access to the filter graph.
I am having video tearing problems with WPF in general ( xp and vista ).
The tearing is also happening in wpfmediakit. From what i can tell it uses vrm9, not mediaelements custom renderer.
Have you had success in getting rid of the video tearing? if so how did you do it?
thanks in Advance Anton
By Anton on
11/19/2008 6:35 PM
|
Re: Small feature added to the WPF MediaKit
Do you see video tearing if you use just a MediaElement?
The video tearing you see is most likely related to the GPU/driver you are using. You really should not see any tearing in Vista with Aero interface enabled.
MediaElement uses the EVR renderer with a custom presenter, which essentially does the same thing as the VMR9 renderer with the custom allocator in MediaKit. Even thoughte VMR9 is being used, the rendering is really done by WPF using the D3DImage.
-Jer
By Jeremiah Morrill on
11/19/2008 7:43 PM
|
Re: Small feature added to the WPF MediaKit
Hi Jer,
Your hunch on the driver settings was right. i found a fix. it was with the nvidia settings, not wpf.
It was killing me. hdmi cable to a hdtv and i was getting video tear.
Turns out the auto mode from the nvidia 9500m GS was not correct.
I used a custom display setting and set the video timing setting.
setting it to Coordinated Video Timings (CVT) worked!
Anton
By Anton on
11/20/2008 10:50 PM
|
Re: Small feature added to the WPF MediaKit
Jeremiah,
First of all, congratulation for your excellent and usefull job. I have downloaded your last release of MediaKit and testing on Win XP centrino duo with VS2008 and framework 3.5 SP1. I compile and run your SampeApplication without problems, and it perform is very nice. However, personally I can note that audio is missing during an avi or wmv file are palying. I´m really new in C#, WPF and Directshow stuff. Some aditional data is that the bindiing in audioDevice listbox is working and just after the app run the Windows system audio is missing. (Wave volume in the control pannel is setting as 0) By resetting this control audio is recovered, but troubles returning when I execute application again.
What´s missing for me? I believe that all is in place with your application and mediakit because a lot of people test and comment your wonderfull job.
So, some tip about this issue are welcome and really sorry if my question is very simple. Thanks in advance.
Walter.
By Walter on
12/6/2008 10:02 PM
|
Re: Small feature added to the WPF MediaKit
Outstanding work Jer,
I might have some bugs for you - or an opportunity to be educated. :)
In switching back and forth between to live capture devices, I occasionally see a crash in MediaPlayerBase3.WndProcHook. m_mediaEvent is null. I think this is because m_mediaEvent is set to null in ResetLocalGraphResources() before the hook is removed in RemoveWndProcHook(). My fix was 3 parts. 1) make a hook-local copy of the m_mediaEvent 2) protect against a null on the local copy 3) move the null assignment of m_mediaEvent from ResetLocalGraphResources() to the end of RemoveWndProcHook().
I found this one by inspection: Shouldn't the 'if' and assignment near the call to Marshal.FinalReleaseComObject(m_captureDevice); in MediaPlayers.FreeResources() both use m_captureDevice and not m_renderer?
The next "bug" is a little more tricky. One of my capture device works fine. The other is a Logitech WebCam somehow refuses to honor the desired height/width and always comes up with a square. Niether device responds to the calls in MediaPlayerBase.SetVideoDimensions() - maybe that's normal. I was duly impressed when I first installed this camera because when I started the XAML designer - pow! Live video right in DevStudio, just bad aspect ratio. I'm continuing to play/investigate, but so far there are a lot of differences between the way a WebCam works (direct USB) vs a USB capture device with analog video input.
Hank
By Hank on
12/8/2008 2:06 PM
|
Re: Small feature added to the WPF MediaKit
Outstanding work Jer,
I might have some bugs for you - or an opportunity to be educated. :)
In switching back and forth between to live capture devices, I occasionally see a crash in MediaPlayerBase3.WndProcHook. m_mediaEvent is null. I think this is because m_mediaEvent is set to null in ResetLocalGraphResources() before the hook is removed in RemoveWndProcHook(). My fix was 3 parts. 1) make a hook-local copy of the m_mediaEvent 2) protect against a null on the local copy 3) move the null assignment of m_mediaEvent from ResetLocalGraphResources() to the end of RemoveWndProcHook().
I found this one by inspection: Shouldn't the 'if' and assignment near the call to Marshal.FinalReleaseComObject(m_captureDevice); in MediaPlayers.FreeResources() both use m_captureDevice and not m_renderer?
The next "bug" is a little more tricky. One of my capture device works fine. The other is a Logitech WebCam somehow refuses to honor the desired height/width and always comes up with a square. Niether device responds to the calls in MediaPlayerBase.SetVideoDimensions() - maybe that's normal. I was duly impressed when I first installed this camera because when I started the XAML designer - pow! Live video right in DevStudio, just bad aspect ratio. I'm continuing to play/investigate, but so far there are a lot of differences between the way a WebCam works (direct USB) vs a USB capture device with analog video input.
Hank
By Hank on
12/9/2008 6:51 AM
|
Re: Small feature added to the WPF MediaKit
Sorry about the duplicate post. Note to self: don't use refresh after posting; it reposts.
It occurred to me that a video-info-header SrcRect could easily explain the Logitech Camera capture source behavior, so I went looking for it. No luck; the source rect is all zeros (as is TargetRect). Everything points to 320x240 until the Measure/Arrange. I was able to take the VideoCaptureElement out of the stack and make it size with the window without a problem. Examining the filter graph shows that only in the final connection (to VMR9) has a 320x240 SrcRect and TargetRect.
Another thing I tried was simply rendering the video pin off the Logitech filter in GraphStudio blog.monogram.sk/janos/tools/monogram-graphstudio/ - much nicer than GraphEdit). That works - IE proper aspect ratio.
I'll keep tinkering, but welcome any ideas.
Hank
By Hank on
12/9/2008 7:18 AM
|
Re: Small feature added to the WPF MediaKit
Good work Jer, this is a good inspiration and source of information.
I've written my own implementation of DirectShow/VMR9/Allocator/D3DImage player, based on the Direct Show VMR9 Allocator sample and the D3DImage walkthroughs. With full hardware acceleration on XP, I get about 2.5%-3% higher CPU usage with this solution compared to the Media Element. Both mine and your solution makes use of the VMR9 instead of the EVR, which the Media Element uses.
Have you made any tests or comparisons between these renderers to see if there is any inherent performance difference between them? Or is this performance penalty likely due to how we have to interface with the D3DImage instead of hooking up with WPF directly (like the Media Element might be doing)?
I'm reluctant to implement the EVR presenter, since it's quite a different beast, just to find out that it makes no difference.
Cheers
By UncleRedz on
12/16/2008 7:48 AM
|
Re: Small feature added to the WPF MediaKit
Sound is not working for me on the test software... and if I create the componet in code I can get it to play right away.. I have to issue the play statement in another controll/timer
By Larry Bloom on
1/6/2009 12:23 PM
|
Re: Small feature added to the WPF MediaKit
So, some tip about this issue are welcome and really sorry if my question is very simple. Thanks in advance
By Shared Web Hosting on
12/20/2009 11:13 AM
|
Re: Small feature added to the WPF MediaKit
this is something i have been very interested in lately. thanks.
By Burberry handbags Replica on
1/5/2010 10:57 PM
|
Re: Small feature added to the WPF MediaKit
The video tearing you see is most likely related to the GPU/driver you are using. You really should not see any tearing in Vista with Aero interface enabled.
By Love poetry on
1/17/2010 6:18 AM
|
Re: Small feature added to the WPF MediaKit
I agree with you, I love all of these: gucci handbags gucci shoes for men cheap jordan shoes chi flat irons
By chi straightener irons on
3/8/2010 10:32 PM
|
|
ed hardy
ED Hardy Hoodies ED Hardy Hoodies Ed Hardy Swimwear Ed Hardy Swimwear ed hardy tops ed hardy tops ed hardy shoes ed hardy shoes ed hardy t shirt ed hardy t shirt ed hardy shirts ed hardy shirts christian audigier christian audigier ed hardy kids ed hardy kids Ed Hardy Sunglasses Ed Hardy Sunglasses ED Hardy belts ED Hardy belts ed hardy Bags ed hardy Bags ed hardy purse ed hardy purse ed hardy mens ed hardy mens ed hardy womens d hardy womens ed hardy mens shirts ed hardy mens shirts ed hardy mens tops ed hardy mens tops ed hardy mens hoodies d hardy mens hoodies ed hardy mens swim trunks ed hardy mens swim trunks ed hardy mens shoes ed hardy mens shoes ed hardy womens swimwear ed hardy womens swimwear ed hardy womens t shirt ed hardy womens t shirt ed hardy womens tops ed hardy womens tops ed hardy womens pants ed hardy womens pants ed hardy womens hoodies ed hardy womens hoodies ed hardy womens shoes ed hardy womens shoes ed hardy womens clothing ed hardy womens clothing
By ed hardy on
3/15/2010 9:32 PM
|
cheap nike shox
There are wide variety of Nike Shox for both men and women's selection.The Nike Shox Sale are best selling nowadays.Get your own Cheap Nike Shox now.It's definitely time for you to buy womens nike shox and wens nike shox, Wearing them will keep you in a perfect condition.
By nike shox on
3/16/2010 10:28 PM
|
|
|
|