Home > Archive (Community help, from old helpdesk) > VirtualCamera SDK - Sample Source Code converted to VB.NET

VirtualCamera SDK - Sample Source Code converted to VB.NET

Avatar image
Aug 24, 2015
Archive Agent wrote
Hi,

We’re considering buying the Virtual Camera SDK product of yours, but before we do that we wanted to have a trial run with it to see if it would suit our needs. The included sample code that you provided worked like a charm, but our solutions runs in VB.NET so we figured it wouldn’t be hard to get this running after converting the code from C# to VB.NET.

That however has turned out to be more problematic than we anticipated.

When running the code we now get a “COMException was unhandled” error message. The message itself says; “No combination of intermediate filters could be found to make the connection” – but that renders us rather clueless. After doing some debugging we did however find the source for this error.

hr = captureGraphSource.RenderStream(Nothing, Nothing, sourceVideoFilter, sourceEffectsFilter, videoSinkFilter)
DsError.ThrowExceptionForHR(hr)

This code generates the error, and in particular the error is in the “videoSinkFilter”. If we remove that and put in “Nothing” instead, then the rendering starts, but it pops up as an own video window. So it’s clear that something isn’t right with that filter. The converted code for this is called in this manner:

videoSinkFilter = FilterGraphTools.AddFilterFromClsid(filterGraphSource, New Guid(Consts.CLSID_VFVirtualCameraSink), "VisioForge Virtual Camera Sink - Video")
sourceSinkIntf = CType(videoSinkFilter, IVFVirtualCameraSink)
sourceSinkIntf.set_license("TRIAL")

So here we are, wondering what it is that we are doing wrong. What we want to accomplish is that we have a range of inputs that we want to generate virtual camera entries for; this so that we can control overlay text/images during live broadcasts.… more

Kjell Arne Brudvik on October 24, 2013 10:10
Completed
0
Vote
Reply
8 Answers
Aug 24, 2015
Archive Agent agent wrote
Roman Minyaylov

We agreed, we'll made VB.Net demo application within several days.

on October 24, 2013 10:13 AM
Aug 24, 2015
Archive Agent agent wrote
Kjell Arne Brudvik

That is great news Roman, if I could be as bold to ask if it would also be possible to get a best-practice sample code on how to operate multiple VirtualCameras with a way to name them, then that would also be perfect. I'd suspect that others that would like to buy this product of yours have similar needs as we do; that we have videocards with several inputs; and want to create a "proxy" between the input, and output to control what is being displayed.

Input Device #1 -> Our Virtual Camera #1 -> Add/remove filters -> Output
Input Device #2 -> Some other Virtual Camera -> Add/remove filters -> Output

This way, you can thus gain control of all your video input devices and for instance place "pause graphics" and similar on all inputs at the same time.

on October 24, 2013 10:29 AM
Aug 24, 2015
Archive Agent agent wrote
Roman Minyaylov

After purchase we'll made a build of filters with a name that you prefer.

on October 24, 2013 10:48 AM
Aug 24, 2015
Archive Agent agent wrote
Kjell Arne Brudvik

I am a bit unsure what you're saying here; does that imply that it's not possible to have VirtualCamera SDK programatically set different names for different cameras after we've acquired the license needed obviously?

Spesifically, why we are looking into your product is because - the sample code - shows that for a single input it works great, and offer the functionality we need. Our problem is that we usually work with video cards with 2-4 inputs.

Our initial test with your product we just fired up 1 input source;

VisioForge Virtual Cam -> C# Filter (added overlay image) -> Used as source in Adobe Flash Media Live Encoder (FMLE).

That works great, but as stated, we never just have 1 source, we have between 2 and 4. It would be quite hard to configure if we in FMLE only see 4 "VIsioForge Virtual Camera" inputs; sure it's not a deal breaker, but it would be far more convenient for us during configuration stage that we can see; "VisioForge VC - Room #1" - "VisioForge VC - Room #2" - "VisioForge VC - Room #3" and so on. I guess you can see how that would be much easier for the technicians to perform configuration.

Would just be annoying for the technicians having to test every instance of "VisioForge Virtual Camera" in the device list to find the one that have the camera attached that we want to use with that setup.

Hopefully you understand what I am asking? :-)

on October 24, 2013 11:00 AM
Aug 24, 2015
Archive Agent agent wrote
Roman Minyaylov

Currently not possible, it's a problem because require filter COM-registration for an each name. So, easily to made 4 filtters with different names/GUIDs and use them as required. On-the-fly name change for video input device is not possible as I know.

on October 24, 2013 11:03 AM
Aug 24, 2015
Archive Agent agent wrote
Kjell Arne Brudvik

Ah, so we'd require X different DLL files for this? Well that is of course dooable, not the optimal solution of course, but we can live with that - though, would that then require X purchases? Where X is the number of input devices we at maximum (which currently is 4) we need?

on October 24, 2013 11:08 AM
Aug 24, 2015
Archive Agent agent wrote
Roman Minyaylov

One purchase only, don't worry.

Yes, multiple small DLL's, each registered as independent virtual device/directshow filter.

on October 24, 2013 11:15 AM
Aug 24, 2015
Archive Agent agent wrote
Roman Minyaylov

Please download updated SDK build, VB.Net demo application with full source code now availble.

on October 24, 2013 4:47 PM