Tedd.VirtualNetworkCam icon indicating copy to clipboard operation
Tedd.VirtualNetworkCam copied to clipboard

How can I make it work for my PC webcam?

Open BakingBrains opened this issue 4 years ago • 18 comments

BakingBrains avatar Oct 25 '21 13:10 BakingBrains

@BakingBrains probably need more details on this, maybe you can tell us what you are working on and how far did you manage to get so far?

razier avatar Oct 25 '21 15:10 razier

@razier, thanks for the reply

Yeah, The drivers are successfully registered. Screenshot 2021-10-25 211506

The testcase is also passed. Screenshot 2021-10-25 211626

Now I want to get the frames from my webcam through the running client IP.

When I checked the log file, it showed something like this:

[2021-10-25 21:17:43]Is64BitProcess: True
[2021-10-25 21:17:43]Listening to TCP port 9090
[2021-10-25 21:17:45]Accepting new client: 127.0.0.1:51457
[2021-10-25 21:17:45]Client: 127.0.0.1:51457
[2021-10-25 21:17:47]Reading client socket	System.Net.Sockets.SocketException (0x80004005): An existing connection was forcibly closed by the remote host
   at Tedd.VirtualNetworkCam.NetworkCamServerClient.ReadThreadLoop() in D:\Tedd.VirtualNetworkCam-master\Tedd.VirtualNetworkCam-master\src\Tedd.VirtualNetworkCam\NetworkCamServerClient.cs:line 152
[2021-10-25 21:17:47]Client disconnect.

Instead of using kinect, I want to use the frames from my webcam.

BakingBrains avatar Oct 25 '21 15:10 BakingBrains

The camera driver is only listening while the camera is in use. Do you have the camera active in an application while attempting to connect to it?

tedd avatar Oct 25 '21 18:10 tedd

After installing the driver, if I open the camera, the log file shows something like this.

[2021-10-26 00:30:55]VirtualCamFilter.Ctr()
[2021-10-26 00:30:55]Is64BitProcess: True
[2021-10-26 00:30:55]Listening to TCP port 9090
[2021-10-26 00:30:55]GetMediaType: iPosition: 0, FormatType: 00000000-0000-0000-0000-000000000000, SubType: 00000000-0000-0000-0000-000000000000
[2021-10-26 00:30:55]GetMediaType: vih.BmiHeader: BitCount: 24, Compression: 0, Width: 1920, Height: 1080

BakingBrains avatar Oct 25 '21 19:10 BakingBrains

@BakingBrains seems like the webcam server started fine after you open the camera, had you worked on the client to capture the frames from your camera (then I assume process it) and send frames to the virtual camera?

If you need a sample of a python client that captures the frame from your camera and stream it to the virtual camera, you can check out https://github.com/razier/TeddVirtualNetworkCamClient

razier avatar Oct 26 '21 01:10 razier

@razier @tedd Thanks for the support.

Yeah I have checked https://github.com/razier/TeddVirtualNetworkCamClient it as well, but it is unable to get the HTTP response

BakingBrains avatar Oct 26 '21 04:10 BakingBrains

@BakingBrains this isn't running on http, and the virtual webcam does seem to be running correctly; but anyway lets try to check certain things

  1. After installing driver, start webex / zoom / skype or anything that uses a webcam
  2. Select the virtual webcam, make sure the webcam shows a black screen here
  3. Once you had selected the webcam, the application would listen to the tcp port 9090, you should now send the frames to this webcam

The next step is that if you are using the python client I made

  1. python Sample-OpenCVToVirtualCam.py
  2. The python script would connect to the virtual webcam via port 9090
  3. Capture the actual webcam [if its not capturing the right one, adjust the cv2.VideoCapture(0) to cv2.VideoCapture(1) etc]
  4. You should both see a opencv dialog showing your captured webcam frame
  5. Go back to webex / zoom / skype and see your webcam

Do copy us the log and show us screenshot of the webcam client you are using (zoom/skype etc) as well as the python output

razier avatar Oct 26 '21 06:10 razier

@razier Step1 : Done setp2: Done 2

I am using python client which you made

Once I run the python script, it shows the below message: Unable to Connect : [WinError 10061] No connection could be made because the target machine actively refused it

I adjusted the webcam in cv2.VideoCapture as well.

The log file is still the same

[2021-10-26 12:06:39]VirtualCamFilter.Ctr()
[2021-10-26 12:06:39]Is64BitProcess: True
[2021-10-26 12:06:39]Listening to TCP port 9090
[2021-10-26 12:06:39]GetMediaType: iPosition: 0, FormatType: 00000000-0000-0000-0000-000000000000, SubType: 00000000-0000-0000-0000-000000000000
[2021-10-26 12:06:39]GetMediaType: vih.BmiHeader: BitCount: 24, Compression: 0, Width: 1920, Height: 1080

BakingBrains avatar Oct 26 '21 06:10 BakingBrains

@BakingBrains Seems like the webcam driver was not installed properly, you are suppose to be seeing "Tedd.VirtualNetworkCam" on the list like this.

My suggestion is to probably try and run cmd as administrator or run the batch file as administrator.

image

razier avatar Oct 26 '21 07:10 razier

Oh!! still its not showing Tedd.VirtualNetworkCam. I ran the batch file in cmd as administrator.

what might be the issue?

BakingBrains avatar Oct 26 '21 09:10 BakingBrains

@BakingBrains After compiling, go to the debug/release folder (src\Tedd.VirtualNetworkCam\bin\Debug\net4.8) and Try to create a newinstall.bat with this and run it.

@echo off set FRAMEWORKDIR=%windir%\Microsoft.NET\Framework\v4.0.30319 %FRAMEWORKDIR%\ngen.exe install System.Buffers.dll %FRAMEWORKDIR%\ngen.exe install System.IO.Pipelines.dll %FRAMEWORKDIR%\ngen.exe install System.Memory.dll %FRAMEWORKDIR%\ngen.exe install System.Numerics.Vectors.dll %FRAMEWORKDIR%\ngen.exe install System.Runtime.CompilerServices.Unsafe.dll %FRAMEWORKDIR%\ngen.exe install System.Threading.Tasks.Extensions.dll %FRAMEWORKDIR%\RegAsm.exe Tedd.VirtualNetworkCam.dll /nologo /codebase /tlb: Tedd.VirtualNetworkCam.tlb

Also help to make sure that the %windir%\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe exist, after running it on mine a UAC dialog appears (make sure you allow it to be run)

razier avatar Oct 26 '21 10:10 razier

Still, I am facing the same issue. It's not at all showing "Tedd.VirtualNetworkCam"

BakingBrains avatar Oct 27 '21 06:10 BakingBrains

@BakingBrains Possible for you to see the virtual webcam in Discord? also what's the architecture that you build / compile the project on?

razier avatar Oct 27 '21 06:10 razier

windows 10, 64 bit, and using vs studio 19. I am still unable to see the Virtual cam

BakingBrains avatar Oct 29 '21 04:10 BakingBrains

4

After Debug I am unable to find System.IO.Pipelines.dll in the directory, might this be the problem??

BakingBrains avatar Oct 29 '21 04:10 BakingBrains

Do I need to enable development platform or anything?

BakingBrains avatar Oct 29 '21 06:10 BakingBrains

What is this error?

Microsoft (R) CLR Native Image Generator - Version 4.8.4320.0
Copyright (c) Microsoft Corporation.  All rights reserved.
Error: The specified assembly is not installed.

Although it says driver is registered, but at the begining it is throwing this error.

@tedd @razier any suggestions?

BakingBrains avatar Nov 08 '21 10:11 BakingBrains

Not sure what else, perhaps there's a specific .net framework that is not installed? Possible for you to try and install the runtime for .net framework 4.8?

I had install this on both machine that I have and on both machine it appears as a camera accordingly (both machine are on windows 10).

razier avatar Nov 09 '21 04:11 razier