Showing a captured video in multiple windows

Tech-Archive recommends: Fix windows errors by optimizing your registry



Hi,

I'm trying to use a camera to capture video in real time and show it in
more than one window.
All posts that I read about it recommended to use "Infinite Tee" but no
examples.

This code below is all that I got. Just the original video is displayed
in his own window. I want to show one more window with the same video
in real time.

I think that I'm not connecting the pins correctly.

Can anyone help me with it?
If someone has some source code (any language) as example, I will be
very grateful.

Thanks a lot!


Jonatas Bessow

//--------------------------------------------------------------------------------------

public IBaseFilter FindCaptureDevice(){
int hr = 0;
UCOMIEnumMoniker classEnum = null;
UCOMIMoniker[] moniker = new UCOMIMoniker[1];
object source = null;

// Create the system device enumerator
ICreateDevEnum devEnum = (ICreateDevEnum) new CreateDevEnum();

// Create an enumerator for the video capture devices
hr = devEnum.CreateClassEnumerator(FilterCategory.VideoInputDevice,
out classEnum, 0);
DsError.ThrowExceptionForHR(hr);

// The device enumerator is no more needed
Marshal.ReleaseComObject(devEnum);

if (classEnum == null)
throw new ApplicationException("No video capture device was
detected");

int i;
if (classEnum.Next (moniker.Length, moniker, out i) == 0) {
// Bind Moniker to a filter object
Guid iid = typeof(IBaseFilter).GUID;
moniker[0].BindToObject(null, null, ref iid, out source);
}
else { throw new ApplicationException("Unable to access video capture
device!");}

// Release COM objects
Marshal.ReleaseComObject(moniker[0]);
Marshal.ReleaseComObject(classEnum);

// An exception is thrown if cast fail
return (IBaseFilter) source;
}

IVideoWindow GetSecondRenderer() {
IEnumFilters enumFilters;
ArrayList filtersArray = new ArrayList();

IFilterGraph filterGraph = (IFilterGraph)fg;
filterGraph.EnumFilters(out enumFilters);

IBaseFilter[] filters = new IBaseFilter[1];
int fetched;

while(enumFilters.Next(1, filters, out fetched) == 0) {
IVideoWindow ivw = filters[0] as IVideoWindow;
if ( ivw != null ) {
IntPtr outPtr = new IntPtr();
ivw.get_Owner( out outPtr );
if( outPtr == IntPtr.Zero )
return ivw;
}
}
return null;
}

.



Relevant Pages

  • Re: Video snapshot is not captured with bitblt sometimes
    ... the paint window around the screen, the image was only an overlay and was not ... than one DV file and the others do seem to render, ... I don't know how other video hardware handle this situation, ... When you pause are you able to capture ...
    (microsoft.public.win32.programmer.gdi)
  • callback
    ... // Create the capture graph builder ... // Obtain interfaces for media control and Video Window ... // Attach the filter graph to the capture graph ...
    (microsoft.public.win32.programmer.directx.video)
  • Re: The Apprentice 2 - Trials of making my first DV movie
    ... with USB from a camera? ... Video captured that way is never high quality unless ... > my DV camcorder could transfer digital data to my ... > I installed the USB drivers and Imaging capture software ...
    (microsoft.public.windowsxp.moviemaker)
  • Hangs after clicking on "Capture from video device" + other probs
    ... video card, an Angel TV tuner card, and an SB Audigy 2ZS Audio ... problems with WMM right from the beginning. ... This time when I click on "Capture from video device", ... window appears, saying "The video device is currently in use. ...
    (microsoft.public.windowsxp.moviemaker)
  • Re: Capturing from VHS/DVD recorder player
    ... I will be getting that ADS USB device. ... VHS video is copied to and digitalized for the DVD disc. ... For analog capture from either my Cable TV box, DVD player or VCR, the ...
    (microsoft.public.windowsxp.moviemaker)