Click here to Skip to main content
15,888,527 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have created a DirectShow test application which is supposed to show the webcam output in my application's window, using windowless mode but when I run the application, the output is still shown in the video renderer's default window. The code I used to render the webcam image is...

hr = m_pCaptureGraphBuilder->RenderStream(&PIN_CATEGORY_PREVIEW, &MEDIATYPE_Video, pCap, NULL, NULL);


If I play an AVI file with the following code, it appears correctly in my application's window.

hr = m_pGraphBuilder->RenderFile(L"C:\\Temp\\Sample.avi", NULL);


Is there anything different between these rendering methods that might account for the problem? I have very little experience with DirectShow so I am not sure what I might be doing wrong, or what else I could try in order to debug it. I realise that its probably difficult to say what's wrong without seeing the code but there's a lot of code so it may not help much.

Thanks

What I have tried:

I have checked all (I think) HRESULTS and they are all SUCCEEDED. I have also tried passing the video rendering filter into RenderStream() but then no output is shown...

hr = m_pCaptureGraphBuilder->RenderStream(&PIN_CATEGORY_PREVIEW, &MEDIATYPE_Video, pCap, NULL, m_pVmr);
Posted
Updated 4-Apr-22 5:10am
Comments
0x01AA 4-Apr-22 8:15am    
IVMRWindowlessControl::SetVideoClippingWindow should help?
softwaremonkey 4-Apr-22 10:15am    
Thanks, I do have a SetVideoClippingWindow() call in my code and it works when playing an AVI file but not with the webcam (Capture Filter). Its driving me mad!

1 solution

OK, not being one to easily give in, I think I have solved the problem! I have changed the code to use the VRM-9 filter instead of the default (which I think is VRM-7). It all appears to be working now.
 
Share this answer
 
Comments
merano99 7-Apr-22 20:06pm    
You mean VMR, right?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900