Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I make it work for my PC webcam? #4

Open
BakingBrains opened this issue Oct 25, 2021 · 18 comments
Open

How can I make it work for my PC webcam? #4

BakingBrains opened this issue Oct 25, 2021 · 18 comments

Comments

@BakingBrains
Copy link

No description provided.

@razier
Copy link

razier commented Oct 25, 2021

@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?

@BakingBrains
Copy link
Author

BakingBrains commented Oct 25, 2021

@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.

@tedd
Copy link
Owner

tedd commented Oct 25, 2021

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?

@BakingBrains
Copy link
Author

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

@razier
Copy link

razier commented Oct 26, 2021

@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

@BakingBrains
Copy link
Author

@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

@razier
Copy link

razier commented Oct 26, 2021

@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

@BakingBrains
Copy link
Author

@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

@razier
Copy link

razier commented Oct 26, 2021

@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

@BakingBrains
Copy link
Author

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

what might be the issue?

@razier
Copy link

razier commented Oct 26, 2021

@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)

@BakingBrains
Copy link
Author

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

@razier
Copy link

razier commented Oct 27, 2021

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

@BakingBrains
Copy link
Author

BakingBrains commented Oct 29, 2021

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

@BakingBrains
Copy link
Author

4

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

@BakingBrains
Copy link
Author

Do I need to enable development platform or anything?

@BakingBrains
Copy link
Author

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?

@razier
Copy link

razier commented Nov 9, 2021

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants