Home > Forum > Getting an Access Violation trying to capture a virtual web cam

Getting an Access Violation trying to capture a virtual web cam

Oct 13 (2 days ago)
Todd Niec wrote
I have a test app that uses the capture SDK to capture from a web cap (chosen from a drop down) and displays the video on the screen (preview control I think its called). That works fine when capturing from my laptops web cam.

I downloaded the virtual camera SDK and I am trying to use the C# sample in it. But ot gives me a lot of error when I try. However, I seem to be able to start the virtual web cam showin my lap tops actual web cam. Not sure the rest works after that.

When I start the virtual web cam and run my capture test program I see the virtual web cam listed in the drop down. so that is a good sign.

But when I try to capture from the virtual web cam I get the exception

An unhandled exception of type 'System.AccessViolationException'
occurred in VisioForge.Core.dll

Attempted to read or write protected memory. This is often an
indication that other memory is corrupt.

I am not able to debug this to even know where it is occurring.
Reply
4 Answers
Oct 13 (2 days ago)
Roman Miniailov agent wrote
Hi Todd,

Please provide more details.

Tell me (screenshot better) which errors you have in the Virtual Camera SDK sample.

You can also use the Virtual_Camera_Output_Enabled property of VideoCaptureCore in any video capture sample instead of Virtual Camera SDK sample usage.
Oct 13 (2 days ago)
Todd Niec wrote
Can you tell me more about

Virtual_Camera_Output_Enabled

Like what class is it on? It sort f sounds like all I need. (After creating the "composite" video using the text and image overlays in the capture SDK I just need to sent that composite video out again.)

Is there SDK class documentation somewhere? i could use that. I have been figuring things out from the samples and guesses.

Otherwise, I can try to recreate those errors a little later...

Thanks!
Oct 13 (44 hours ago)
Roman Miniailov agent wrote
VideoCaptureCore class has Virtual_Camera_Output_Enabled property.

You can use this sample to start and set property to true before VideoCaptureCore StartAsync method call - https://github.com/visioforge/.Net-SDK-s-samples/tree/master/Video%20Capture%20SDK/WPF/CSharp/Simple%20Video%20Capture

Documentation - https://www.visioforge.com/help/docs/dotnet/videocapture/
yesterday 11:37 (29 hours ago)
Todd Niec wrote
I changed that sample to turn on the virtual camera at the start of the btStart_Click handler.

That seems to run okay and it does create the virtual camera, but I do get the errors

[ComHelper][LoadModule] Unable to load filter module, file does not exists: VisioForge_Virtual_Camera_x64.ax

[FilterGraphTools][AddFilterFromRedist] Unable to create filter (from file): VisioForge Virtual Camera Sink. Please check Deployment on the product page.

[FilterGraphTools][AddFilterFromClsidOrFile] Unable to add filter from file VisioForge Virtual Camera Sink. Trying to add using CLSID.

[ComHelper][LoadModule] Unable to load filter module, file does not exists: VisioForge_Virtual_Audio_Card_x64.ax

[FilterGraphTools][AddFilterFromRedist] Unable to create filter (from file): VisioForge Virtual Audio Card Sink. Please check Deployment on the product page.

[FilterGraphTools][AddFilterFromClsidOrFile] Unable to add filter from file VisioForge Virtual Audio Card Sink. Trying to add using CLSID.


However, these errors have no visible effect (that I can see) in the sample.


BUT, when I run my test program and try to use the virtual camera as the capture source, then I do get an erro in my program.

ln this case, when I select the virtual camera as the capture source I get the errors.

[ComHelper][LoadModule] Unable to load filter module, file does not exists: VisioForge_Virtual_Camera_x64.ax

[FilterGraphTools][AddFilterFromRedist] Unable to create filter (from file): VisioForge Virtual Camera Source. Please check Deployment on the product page.

[FilterGraphTools][AddFilterFromClsidOrFile] Unable to add filter from file VisioForge Virtual Camera Source. Trying to add using CLSID.


(I must have some sort of common error regarding filters. Like a path issue?)

But the program si still able to run. But when I start the capture then I get a fatal exception

An unhandled exception of type 'System.AccessViolationException' occurred in VisioForge.Core.dll

Attempted to read or write protected memory. This is often an indication that other memory is corrupt.


Oh. I now see I am also getting the error (through the SDH's OnError callback) of

[DSVideoCaptureSource][SetVideoFormat] Bad video capture format.

But I do set the capture format to a valid enry for the (virtual) cam. Its "1024x768 YUY2, 16 bit"