![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | DirectShow filtergraph How can I control the DirectShow filtergraph of a video file in a WPF application? What I want to do is create a WPF application with some video playing, and some overlay graphics on top of the video. But I need to decide myself how the DirectShow filtergraph of the video is created. That which filters are included etc. Is there any way to do that?? Do I just use MediaElement? Or do i need to create my own element somehow? -- Best Regards Shogun |
| | #2 (permalink) |
| Guest | Re: DirectShow filtergraph If you need to control over the DShow graph, then you have to build your content/control and then use hwndhost to bring it into your WPF application/content. The Media element does not expose access to the underlying graph. Not clear how mych you are looking to do in the graph, but if it is just to overlay graphics, you can do that directly in WPF (and synchronize the items with timing with the video), with the video int he Media element. -Pablo "Shogun" <Shogun@discussions.microsoft.com> wrote in message news:70471B6A-D319-4F7E-BFD4-00AA26C8965B@microsoft.com... > How can I control the DirectShow filtergraph of a video file in a WPF > application? What I want to do is create a WPF application with some video > playing, and some overlay graphics on top of the video. But I need to > decide > myself how the DirectShow filtergraph of the video is created. That which > filters are included etc. Is there any way to do that?? > Do I just use MediaElement? Or do i need to create my own element somehow? > -- > Best Regards > Shogun |
| | #3 (permalink) |
| Guest | Re: DirectShow filtergraph Hi Pablo, Thank you for the response. In the filtergraph I need to insert my own filter to do some image processing on the video frames. So I need to hardcode the filtergraph with exactly the filters I want to ensure that I use these exact filters. After displaying the video I need also to be able to do some overlay graphics on the video element/control. The overlay graphics could for example be WPF controls, but is this also possible if I write my own video control?? -- Best Regards The Shogun "Pablo Fernicola [MS]" wrote: > If you need to control over the DShow graph, then you have to build your > content/control and then use hwndhost to bring it into your WPF > application/content. > > The Media element does not expose access to the underlying graph. > > Not clear how mych you are looking to do in the graph, but if it is just to > overlay graphics, you can do that directly in WPF (and synchronize the items > with timing with the video), with the video int he Media element. > > -Pablo > "Shogun" <Shogun@discussions.microsoft.com> wrote in message > news:70471B6A-D319-4F7E-BFD4-00AA26C8965B@microsoft.com... > > How can I control the DirectShow filtergraph of a video file in a WPF > > application? What I want to do is create a WPF application with some video > > playing, and some overlay graphics on top of the video. But I need to > > decide > > myself how the DirectShow filtergraph of the video is created. That which > > filters are included etc. Is there any way to do that?? > > Do I just use MediaElement? Or do i need to create my own element somehow? > > -- > > Best Regards > > Shogun > > > |
| | #4 (permalink) |
| Guest | Re: DirectShow filtergraph A couple of suggestions/things to consider: 1 - If the processing you are going to do is CPU based, then I would consider perhaps running everything through the media element and using an image effect (on the other hand, if the processing is hardware accelerated, you would not want to do it this way, because effects are software only for this first release, and then, yes, you would want to do the filtergraph part). 2 - Yes, you can host WPF within your filtergraph. I am pretty sure that I saw a demo of this working over a year ago. If you are thinking of overlaying controls, the tricky thing is going to be routing events (in case the controls are live, but maybe you are doing something like drawing DVD menus, where the controls are not really live). If you have animations as part of your WPF content, the good news is that you can control the clock as well for them. 3 - Let's say you went the route of the hwnd host for your video rendering. You would want to composite your WPF controls as part of your filtergraph, at the DShow level, because when you do the hwnd host you will not be able to overlay them (what we usually refer to as the airspace issue). -Pablo "Shogun" <Shogun@discussions.microsoft.com> wrote in message news:B8309D47-CFE0-42DB-9552-E69FB0839DCF@microsoft.com... > Hi Pablo, > > Thank you for the response. > In the filtergraph I need to insert my own filter to do some image > processing on the video frames. So I need to hardcode the filtergraph with > exactly the filters I want to ensure that I use these exact filters. > After displaying the video I need also to be able to do some overlay > graphics on the video element/control. > The overlay graphics could for example be WPF controls, but is this also > possible if I write my own video control?? > > -- > Best Regards > The Shogun > > > "Pablo Fernicola [MS]" wrote: > >> If you need to control over the DShow graph, then you have to build your >> content/control and then use hwndhost to bring it into your WPF >> application/content. >> >> The Media element does not expose access to the underlying graph. >> >> Not clear how mych you are looking to do in the graph, but if it is just >> to >> overlay graphics, you can do that directly in WPF (and synchronize the >> items >> with timing with the video), with the video int he Media element. >> >> -Pablo >> "Shogun" <Shogun@discussions.microsoft.com> wrote in message >> news:70471B6A-D319-4F7E-BFD4-00AA26C8965B@microsoft.com... >> > How can I control the DirectShow filtergraph of a video file in a WPF >> > application? What I want to do is create a WPF application with some >> > video >> > playing, and some overlay graphics on top of the video. But I need to >> > decide >> > myself how the DirectShow filtergraph of the video is created. That >> > which >> > filters are included etc. Is there any way to do that?? >> > Do I just use MediaElement? Or do i need to create my own element >> > somehow? >> > -- >> > Best Regards >> > Shogun >> >> >> |
| | #5 (permalink) |
| Guest | Re: DirectShow filtergraph 1 - The processing we need to do will not be CPU based preferably. We would like to do the image processing by using pixel shaders. But the reason why we want full control of the filtergraph is also because we want to decide completely which decoder is used, demux (if any), the render.. etc. So I guess this totally rules out using the MediaElement? 2. This sounds interesting to me. If we somehow can build our own filtergraph with the filters we want, and be still able to somehow use WPF to build the UI overlayed on top of the video, this would be cool.. So if I understand you right, would we then be able to build a filtergraph that uses VMR9 as render, ( File->Decoder->Our filter->VMR9), and using the VMR9 mixing engine to mix in WPF content (for doing the overlay graphics)? 3. Do you know where I can find more info on how to composite WPF as part of our filtergraph? -- Best Regards The Shogun "Pablo Fernicola [MS]" wrote: > A couple of suggestions/things to consider: > > 1 - If the processing you are going to do is CPU based, then I would > consider perhaps running everything through the media element and using an > image effect (on the other hand, if the processing is hardware accelerated, > you would not want to do it this way, because effects are software only for > this first release, and then, yes, you would want to do the filtergraph > part). > > 2 - Yes, you can host WPF within your filtergraph. I am pretty sure that I > saw a demo of this working over a year ago. If you are thinking of > overlaying controls, the tricky thing is going to be routing events (in case > the controls are live, but maybe you are doing something like drawing DVD > menus, where the controls are not really live). If you have animations as > part of your WPF content, the good news is that you can control the clock as > well for them. > > 3 - Let's say you went the route of the hwnd host for your video rendering. > You would want to composite your WPF controls as part of your filtergraph, > at the DShow level, because when you do the hwnd host you will not be able > to overlay them (what we usually refer to as the airspace issue). > > -Pablo > > "Shogun" <Shogun@discussions.microsoft.com> wrote in message > news:B8309D47-CFE0-42DB-9552-E69FB0839DCF@microsoft.com... > > Hi Pablo, > > > > Thank you for the response. > > In the filtergraph I need to insert my own filter to do some image > > processing on the video frames. So I need to hardcode the filtergraph with > > exactly the filters I want to ensure that I use these exact filters. > > After displaying the video I need also to be able to do some overlay > > graphics on the video element/control. > > The overlay graphics could for example be WPF controls, but is this also > > possible if I write my own video control?? > > > > -- > > Best Regards > > The Shogun > > > > > > "Pablo Fernicola [MS]" wrote: > > > >> If you need to control over the DShow graph, then you have to build your > >> content/control and then use hwndhost to bring it into your WPF > >> application/content. > >> > >> The Media element does not expose access to the underlying graph. > >> > >> Not clear how mych you are looking to do in the graph, but if it is just > >> to > >> overlay graphics, you can do that directly in WPF (and synchronize the > >> items > >> with timing with the video), with the video int he Media element. > >> > >> -Pablo > >> "Shogun" <Shogun@discussions.microsoft.com> wrote in message > >> news:70471B6A-D319-4F7E-BFD4-00AA26C8965B@microsoft.com... > >> > How can I control the DirectShow filtergraph of a video file in a WPF > >> > application? What I want to do is create a WPF application with some > >> > video > >> > playing, and some overlay graphics on top of the video. But I need to > >> > decide > >> > myself how the DirectShow filtergraph of the video is created. That > >> > which > >> > filters are included etc. Is there any way to do that?? > >> > Do I just use MediaElement? Or do i need to create my own element > >> > somehow? > >> > -- > >> > Best Regards > >> > Shogun > >> > >> > >> > > > |
| | #6 (permalink) |
| Guest | Re: DirectShow filtergraph You would have us render offscreen and then you would composite the result as part of your DShow filter. Let me try to find a sample for you. I thought we had one around. -Pablo "Shogun" <Shogun@discussions.microsoft.com> wrote in message news:1178D0B0-DEF3-424C-B34B-256AFFF559A1@microsoft.com... >1 - The processing we need to do will not be CPU based preferably. We would > like to do the image processing by using pixel shaders. But the reason why > we > want full control of the filtergraph is also because we want to decide > completely which decoder is used, demux (if any), the render.. etc. > So I guess this totally rules out using the MediaElement? > > 2. This sounds interesting to me. If we somehow can build our own > filtergraph with the filters we want, and be still able to somehow use WPF > to > build the UI overlayed on top of the video, this would be cool.. > So if I understand you right, would we then be able to build a filtergraph > that uses VMR9 as render, ( File->Decoder->Our filter->VMR9), and using > the > VMR9 mixing engine to mix in WPF content (for doing the overlay graphics)? > > 3. Do you know where I can find more info on how to composite WPF as part > of > our filtergraph? > > -- > Best Regards > The Shogun > > > "Pablo Fernicola [MS]" wrote: > >> A couple of suggestions/things to consider: >> >> 1 - If the processing you are going to do is CPU based, then I would >> consider perhaps running everything through the media element and using >> an >> image effect (on the other hand, if the processing is hardware >> accelerated, >> you would not want to do it this way, because effects are software only >> for >> this first release, and then, yes, you would want to do the filtergraph >> part). >> >> 2 - Yes, you can host WPF within your filtergraph. I am pretty sure that >> I >> saw a demo of this working over a year ago. If you are thinking of >> overlaying controls, the tricky thing is going to be routing events (in >> case >> the controls are live, but maybe you are doing something like drawing DVD >> menus, where the controls are not really live). If you have animations >> as >> part of your WPF content, the good news is that you can control the clock >> as >> well for them. >> >> 3 - Let's say you went the route of the hwnd host for your video >> rendering. >> You would want to composite your WPF controls as part of your >> filtergraph, >> at the DShow level, because when you do the hwnd host you will not be >> able >> to overlay them (what we usually refer to as the airspace issue). >> >> -Pablo >> >> "Shogun" <Shogun@discussions.microsoft.com> wrote in message >> news:B8309D47-CFE0-42DB-9552-E69FB0839DCF@microsoft.com... >> > Hi Pablo, >> > >> > Thank you for the response. >> > In the filtergraph I need to insert my own filter to do some image >> > processing on the video frames. So I need to hardcode the filtergraph >> > with >> > exactly the filters I want to ensure that I use these exact filters. >> > After displaying the video I need also to be able to do some overlay >> > graphics on the video element/control. >> > The overlay graphics could for example be WPF controls, but is this >> > also >> > possible if I write my own video control?? >> > >> > -- >> > Best Regards >> > The Shogun >> > >> > >> > "Pablo Fernicola [MS]" wrote: >> > >> >> If you need to control over the DShow graph, then you have to build >> >> your >> >> content/control and then use hwndhost to bring it into your WPF >> >> application/content. >> >> >> >> The Media element does not expose access to the underlying graph. >> >> >> >> Not clear how mych you are looking to do in the graph, but if it is >> >> just >> >> to >> >> overlay graphics, you can do that directly in WPF (and synchronize the >> >> items >> >> with timing with the video), with the video int he Media element. >> >> >> >> -Pablo >> >> "Shogun" <Shogun@discussions.microsoft.com> wrote in message >> >> news:70471B6A-D319-4F7E-BFD4-00AA26C8965B@microsoft.com... >> >> > How can I control the DirectShow filtergraph of a video file in a >> >> > WPF >> >> > application? What I want to do is create a WPF application with some >> >> > video >> >> > playing, and some overlay graphics on top of the video. But I need >> >> > to >> >> > decide >> >> > myself how the DirectShow filtergraph of the video is created. That >> >> > which >> >> > filters are included etc. Is there any way to do that?? >> >> > Do I just use MediaElement? Or do i need to create my own element >> >> > somehow? >> >> > -- >> >> > Best Regards >> >> > Shogun >> >> >> >> >> >> >> >> >> |
| |
| |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| DirectShow | teaser | VB Script | 4 | 06-03-2008 09:53 AM |
| Corrupted DirectShow drivers? | Denzil Fernandes | Vista General | 0 | 10-07-2007 11:59 AM |
| DirectShow in DX 10 | Ryan | Vista General | 6 | 06-01-2007 03:41 PM |
| Directshow not working | Archie | Vista General | 0 | 05-30-2007 01:53 AM |
| DirectShow and Vista | Matthew Ireland | Vista General | 0 | 04-11-2007 01:42 PM |