Re: WPF MediaKit on Codeplex
Just gave it a quick test and it works just fine. Fast loading of my HD videos (all videos plays now).
I will testt it some more soon.
Good work Jer.
/Ken
By Ken on
9/17/2008 2:51 AM
|
Re: WPF MediaKit on Codeplex
Great!
EVR support is the next thing to tackle. I suspect even better performance with that!
By Jeremiah Morrill on
9/17/2008 2:57 AM
|
Re: WPF MediaKit on Codeplex
Also tested running 3 "MediaUriElement" in the same window and loading them with separate HD video's, none stopped or studder, when loading a new HD video. So you solve "multithread video" in the same UI. Great!
A "off topic" question. In VS2008 in develop mode I get error "Assembly 'WPFMediaKit' was not found. Verify that you are not missing an assembly reference."
How can I fix this, I get it on other 3:rd component also. I works when I compile and run the app, it's very irritating as I don't se anything in "design view". Yes, I did "Build All", and "Clean"...
/Ken
By Ken on
9/17/2008 3:21 AM
|
Re: WPF MediaKit on Codeplex
Not sure what that problem is. If you are talking about Cider in VS (the WPF designer), I just turn it off because it is truly worthless and has many issues with XAML in general.
-Jer
By Jeremiah Morrill on
9/17/2008 3:28 AM
|
Re: WPF MediaKit on Codeplex
Jer, how do I use "MediaUriPlayer" in pure code.
I try to add the "MediaUriPlayer" to a grid like this:
MediaUriPlayer _player1 = new MediaUriPlayer(); mediaGrid.Children.Add(_player1);
but get the error: "cannot convert from 'WPFMediaKit.DirectShow.MediaPlayers.MediaUriPlayer' to 'System.Windows.UIElement'"
Suggerstion on how to do? I need to add my player by code.
/Ken
By Ken on
9/17/2008 4:26 AM
|
Re: WPF MediaKit on Codeplex
You want to use a MediaUriElement. The DirectShow is all split up between "players" and "elements". The players are just the raw directshow stuff, isolated within its own thread and dispatcher. Elements are essentially a WPF wrapper for the players.
-Jer
By Jeremiah Morrill on
9/17/2008 4:33 AM
|
Re: WPF MediaKit on Codeplex
OK, got it working with
WPFMediaKit.DirectShow.Controls.MediaUriElement _player1 = new WPFMediaKit.DirectShow.Controls.MediaUriElement();
mediaGrid.Children.Add(_player1); _player1.Source = new Uri(file);
But how do I hook it up with "WPFMediaKit.DirectShow.MediaPlayers.MediaSeekingPlayer" so I get "Duration" and other functions.
/Ken
By Ken on
9/17/2008 4:48 AM
|
Re: WPF MediaKit on Codeplex
MediaUriElement inherits from MediaSeekingElement just as MediaUriPlayer inherits from MediaSeekingPlayer. You want to look at the MediaPosition/MediaDuration property. That will allow you to seek and see the duration.
-Jer
By Jeremiah Morrill on
9/17/2008 4:55 AM
|
Re: WPF MediaKit on Codeplex
How do I connect by code "MediaSeekingElement and MediaUriPlayer" to MediaUriElement ?
/Ken
By Ken on
9/17/2008 5:50 AM
|
Re: WPF MediaKit on Codeplex
Not sure what you mean. If you are coding against the MediaUriElement, your are already using the MediaSeekingElement and MediaUriPlayer, but directly and indirectly.
/* Get position and duration */ double position = mediaUrlElement.MediaPosition; double duration = mediaUriElement.MediaDuration;
/* goto half way */ mediaUriElement.MediaPosition = duration / 2;
By Jeremiah Morrill on
9/17/2008 6:05 AM
|
Re: WPF MediaKit on Codeplex
Sorry, didn't hade my thinking cap on...
"MediaDuration", yes. I was looking for just "Duration"
/Ken
By Ken on
9/17/2008 8:13 AM
|
Re: WPF MediaKit on Codeplex
The sample works really smooth (on HD also).
I'm going to test it in a real project next week.
I will inform you of the results.
Thanks for you great job.
Jordi
By Jordi on
9/17/2008 8:38 PM
|
Re: WPF MediaKit on Codeplex
Hello,
I test the WPFMediaKit and it crash. Error appeared when MediaKit cleaning resources (WPFMediaKit.dll!WPFMediaKit.DirectShow.MediaPlayers.MediaUriPlayer.FreeResources() Line 238 -> pointed to line: Marshal.FinalReleaseComObject(m_graph)) and I get pop-up with title "RaceOnRCWCleanUp".'
Why this happening?
-Jokkeri
By Jokkeri on
9/18/2008 6:21 AM
|
Re: WPF MediaKit on Codeplex
I really like this implementation so far. I have a small issue with the Loop behavior, though. It only checks whether or not to loop every 200ms, which causes a noticeable stutter when I'm looping a relatively short video. Lowering it to 15ms (so potentially >60 FPS) fixes the problem, but I need to carry around my own build of your product. Would you mind updating that value permanently, or making it modifiable?
Also, could you create an xml-ns entry for the assembly? Just being anal about the XAML stuff. :)
By Evan on
9/19/2008 11:24 AM
|
Re: WPF MediaKit on Codeplex
Thanks Evan!
The DispatcherTimer that runs ever n-ms, is kinda a hack at the moment. It's used right now to poll for events on the DShow graph. Normally you can just get events via WindProc messages, but for that I need an hWnd for each graph. I decided to keep it simple for now, but I may get the hWnd route in there sooner or later.
I can lower the default interval of the DispatcherTimer, does take the CPU down any at 15ms?
I'll look into adding an xml-ns. Good idea!
-Jer
By Jeremiah Morrill on
9/19/2008 5:52 PM
|
Re: WPF MediaKit on Codeplex
I'd strongly recommend to use the WndProc notify mechanism instead of continuous polling, which will inform you as soon as new messages are there. It's quite easy to get the window handle and assign a hook procedure to handle custom messages:
IntPtr windowHandle = new WindowInteropHelper(Window.GetWindow(this)).Handle; HwndSource hwndSource = HwndSource.FromHwnd(windowHandle); hwndSource.AddHook(MessageHook);
Then assign the WindowHandle to EventEx interface, with a message ID defined by you (WM_APP + x) and a IntPtr identifying the Graph instance:
EventEx.SetNotifyWindow(windowHandle, WM_GRAPHNOTIFY, instanceHandle);
Now you will be notified in the MessageHook procedure as soon as new events are available...
Keep up the good work! :)
Lukas
By Lukas on
9/20/2008 9:41 AM
|
Re: WPF MediaKit on Codeplex
Lukas's solution is ideal, but to answer your question, a 15ms timer doesn't noticeably impact anything. One thing you could do is have one timer for all running instances of your control, but I'm not sure that'd be really any easier than implementing Lukas's idea.
By Evan on
9/22/2008 8:08 AM
|
Re: WPF MediaKit on Codeplex
Already implemented the hWnd stuff in the latest codebase :) The timer just drives things like the media position now.
By Jeremiah Morrill on
9/22/2008 8:11 AM
|
Re: WPF MediaKit on Codeplex
I downloaded the WpfMediaKit from CodePlex today and built a small app. I have a couple of questions:
1.) No matter what I set the PreferedPositionFormat to, it always shows it in samples. 2.) based on 1, do you know how I could go about calculating the media duration in time using only samples? I didn't see a way to get the bitrate from the element.
Finally. In some cases, I'm getting RCW Race Conditions on cleanup popups coming up when I try to play a media file. Any idea what could cause that?
Thanks though.. IT works really well.
By Dave on
3/26/2009 10:38 AM
|
Re: WPF MediaKit on Codeplex
Is it supporting UDP/RTSP streams like VLC player,.actually i want to play UDP stream in WPF but still i couldn't find any supporting control. ?
Do you have any idea?
Your corperation is appreciated!
By Anushka on
7/1/2009 11:04 AM
|
Re: WPF MediaKit on Codeplex
Anushka,
You will have to create your own DirectShow source filter. It's not too hard if you are already familiar with C++/COM. If you need RTSP the Live555 open-source lib is a good start.
By Jeremiah Morrill on
7/1/2009 11:19 AM
|
Re: WPF MediaKit on Codeplex
Dave,
Does the program crash outside a debugger. The RCW thing is an MDA and may not be a real exception, but set to a break in VS.
The position format is descided by the directshow filters. If it does not accept the prefered format, it defaults to the original format
By TH3~X~Dr3aM on
9/10/2009 10:37 PM
|
WPF MediaKit on Codeplex
I pretend that Im glad you went away. These four walls close in more everyday.. And Im dying inside. And nobody knows it but me.. Like a clown, I put on a show. Pain is hard even nobody knows.. And Im crying inside. And nobody knows it but me.. Why didnt I say?! The things I needed to say.. How could I let my angel get away.
By TH3~X~Dr3aM on
9/10/2009 10:40 PM
|
WPF MediaKit on Codeplex
I pretend that Im glad you went away. These four walls close in more everyday.. And Im dying inside. And nobody knows it but me.. Like a clown, I put on a show. Pain is hard even nobody knows.. And Im crying inside. And nobody knows it but me.. Why didnt I say?! The things I needed to say.. How could I let my angel get away.
By TH3~X~Dr3aM on
9/10/2009 10:42 PM
|
WPF MediaKit on Codeplex
Lukas's solution is ideal, but to answer your question, a 15ms timer doesn't noticeably impact anything. One thing you could do is have one timer for all running instances of your control, but I'm not sure that'd be really any easier than implementing Lukas's idea.
By TH3~X~Dr3aM on
9/10/2009 10:44 PM
|
Re: WPF MediaKit on Codeplex
Jer, how do I use "MediaUriPlayer" in pure code.
I try to add the "MediaUriPlayer" to a grid like this:
MediaUriPlayer _player1 = new MediaUriPlayer(); mediaGrid.Children.Add(_player1);
but get the error: "cannot convert from 'WPFMediaKit.DirectShow.MediaPlayers.MediaUriPlayer' to 'System.Windows.UIElement'"
Suggerstion on how to do? I need to add my player by code.
/Ken
By TH3~X~Dr3aM on
9/10/2009 10:45 PM
|
Re: WPF MediaKit on Codeplex
Jer, how do I use "MediaUriPlayer" in pure code.
I try to add the "MediaUriPlayer" to a grid like this:
MediaUriPlayer _player1 = new MediaUriPlayer(); mediaGrid.Children.Add(_player1);
but get the error: "cannot convert from 'WPFMediaKit.DirectShow.MediaPlayers.MediaUriPlayer' to 'System.Windows.UIElement'"
Suggerstion on how to do? I need to add my player by code.
/Ken
By TH3~X~Dr3aM on
9/10/2009 10:59 PM
|
Re: WPF MediaKit on Codeplex
So, some tip about this issue are welcome and really sorry if my question is very simple. Thanks in advance
By Replica LV Damier Canvas Bag on
1/5/2010 11:41 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:25 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:18 PM
|
Re: WPF MediaKit on Codeplex
Dave,
Does the program crash outside a debugger. The RCW thing is an MDA and may not be a real exception, but set to a break in VS.
The position format is descided by the directshow filters. If it does not accept the prefered format, it defaults to the original format.
By Jeremiah Morrill on
3/26/2009 10:45 AM
|