Code Monkey home page Code Monkey logo

mimic's Introduction

Mimic - A remote IP camera over WebRTC

Build Release

Table of Contents ๐Ÿงพ

What is Mimic ๐Ÿคทโ€โ™€๏ธ

Mimic allows you to use your smartphone or other webcam-enabled device as a webcam for a different computer on Windows. Mimic creates a WebRTC connection between your PC and your other device to stream video to your PC.

Mimic will appear as a standard webcam on your PC just like any other PC. The only requirements are that the host PC is running 64-bit Windows and your device has a webcam and access to a modern web browser.

What is Mimic not?

  • Mimic is not a voice transmitter. Mimic does not capture and send audio, video only.
  • Mimic is not a physical webcam. Mimic mimics (๐Ÿ˜‰) a physical camera in software. This means that sometimes applications won't correctly pick up the camera but it should work for most applications.
  • Mimic is not an iOS or Android application. Mimic connects to the host using the devices pre-installed web browser instead of a native application. That means theres nothing to install on your webcam-enabled devices, just plug-and-play!

How to use โ“

  1. Make sure both devices are on the same network
  2. Install and start Mimic on the host PC (the computer that does not have the camera).
  3. Double click the Mimic icon in the system tray.
  4. Scan the QR code with your smartphone.

Your device is now a webcam for your PC.

Installing ๐Ÿ’ฟ

Using the installer

  1. Download the latest release from the releases tab.
  2. Download setup-mimic-win64.exe for the production build or setup-mimic-debug.exe for the debug build.
    • Only 64-bit Windows is supported.
  3. Follow the steps in the installer
    • Tick "Create a desktop shortcut" if you would like a shortcut placed on your desktop.
    • Tick "Start Mimic when Windows starts" if you would like mimic to automatically start in the background when Windows starts.

Running without the installer

  1. Download the latest release from the releases tab.
  2. Download mimic-win64.zip for the production build or mimic-debug.zip for the debug build.
    • Only 64-bit Windows is supported.
  3. Extract the zip file to a permanent location
  4. Download obs-virtual-cam build 2.0.4
  5. Extract OBS-VirtualCam2.0.4.zip to a permanent location
  6. Install the obs-virtualsource libraries as administrator
    regsvr32 /n /i:1 .\obs-virtualcam\bin\32bit\obs-virtualsource.dll
    regsvr32 /n /i:1 .\obs-virtualcam\bin\64bit\obs-virtualsource.dll

Mimic can now be started using mimic.exe.

โš  If you are unable to connect to Mimic from your device, Windows Firewall may be blocking the connection. See Allowing Mimic through the Windows Firewall

Building from source

  1. Install build requirements
    • Python 3.9+
    • pipenv (installed with pip install pipenv)
    • Inno Setup (installed with choco install InnoSetup if Chocolatey is installed)
  2. Clone the repository
    git clone https://github.com/link00000000/mimic
  3. Install dependencies
    cd mimic
    pipenv install
  4. Build the project
    • Production: pipenv run build
    • Debug: pipenv run build-debug
  5. Build the installer (optional)
    pipenv run installer
  6. Run the installer located at .\dist\setup-mimic-win64.exe

Compiled application is available at .\dist\mimic.

โš  If you opt to not build the installer, runtime dependencies must be installed. See Running without the installer

Uninstalling ๐Ÿ“ค

Using the installer

Mimic can either be uninstalled using Window's built-in uninstall by searching for "Add or remove programs" or by running unins000.exe in the install directory.

โš  The uninstaller will be unable to remove the OBS-VirtualCam directory if the virtual camera is in use in any running application. Either make sure that all applications that might use the virtual camera are closed before uninstalling or manually delete the directory after closing all applications and uninstalling.

Uninstalling without the uninstaller

  1. Uninstall the obs-virtualsource libraries as administrator in the folder the library was placed in during installation.
    regsvr32 /u .\obs-virtualcam\bin\32bit\obs-virtualsource.dll
    regsvr32 /u .\obs-virtualcam\bin\64bit\obs-virtualsource.dll
  2. Delete temporary files at %localappdata%\mimic.
  3. Delete any remaining Mimic files.
    • Mimic install directory
    • OBS-VirtualCam library directory

โš  If you set a rule in the Windows Firewall, be sure to remove it. See Removing firewall rule.

โš  If you setup Mimic to automatically start with Windows, be sure to remove the startup shortcut. See Starting Mimic when Windows starts.

Allowing Mimic through the Windows Firewall ๐Ÿ”ฅ๐Ÿงฑ

Only perform these steps if you cannot connect to Mimic from your other device and you are on the same network.

  1. Open the windows firewall by searching for or executing wf.msc
  2. Click on inbound connections in the left panel
  3. Click new rule in the right panel
  4. Add the new firewall rule
    1. Select Program
    2. Click Next
    3. Click "Browse..."
    4. Select the location of mimic.exe
    5. Click Next
    6. Click Next
    7. Click Next
    8. Enter "Mimic" for the name
    9. Click Finish.

Removing firewall rule

  1. Open the windows firewall by searching for or executing wf.msc
  2. Click on inbound connections in the left panel
  3. Highlight all instances of "Mimic" in the Inbound Rules panel
  4. Click Delete in the right panel
  5. Click Yes

Starting Mimic when Windows starts ๐Ÿ

To start Mimic when windows starts, a shortcut to mimic.exe must be placed in the startup folder.

To access the startup folder

  1. Press Win+R to open the run dialog.
  2. Type "shell:startup"
  3. Click OK

โš  Be sure to only place shortcuts in shell:startup and not a copy of the binary .exe.

Stop Mimic from starting when Windows starts

To prevent Mimic from automatically starting with Windows, remove the shortcut from shell:startup.

Help! My web browser says that my connection is not safe! โ€ผ

Mimic uses SSL/HTTPS to transmit traffic between your device and your PC. Because all traffic remains on the local network, the SSL certificates must be generated on your PC instead of from a certificate authority which will result in false positives on your device. The solution is to ignore the warning and proceed anyway.

Advanced Usage โš™

Using with ngrok

Mimic does work with ngrok. On the host machine, a Mimic can be exposed using the command ngrok http https://<your_local_ip_address_here>:8080. On your webcam-enabled device, navigate to the HTTPS URL generated by ngrok to connect to Mimic.

Using with a VPN

It has not been tested but Mimic should work on devices that are not on the same local network if they are both on the same VPN connection (depending on the VPN). Connect both devices to the same VPN before starting the host application and connecting with you webcam-enabled device.

For contributors ๐Ÿ‘ฉโ€๐Ÿ’ป

Automated builds ๐Ÿ”จ

Builds are automatically created on commit using GitHub Actions. Build artifacts for Windows x64 and Windows x64 Debug are available under GitHub actions.

Automated Releases

If a commit is tagged with the format vX.X.X, production and debug builds will be created and a release will be made with the build artifacts attached.

pyvirtualcam ๐ŸŽฅ

pyvirtualcam was giving issues with trying to create a shared memory buffer while a previous one was in use. Instead we are using a patched fork of pyvirtualcam. For more details, see here.

mimic's People

Contributors

link00000000 avatar unknwonwarlock avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

mimic's Issues

pyvirtualcam breaking changes

letmaik/pyvirtualcam had an update earlier this week that introduced breaking changes. letmaik/pyvirtualcam has dropped support for CatxFish/obs-virtual-cam, which is what requires those DLLs to be installed. letmaik/pyvirtualcam uses an actual installation of OBS instead. This is an issue because that would require that users install OBS before installing our application. The installation also cannot be automated with scripts like the DLLs.

To fix this, we need to make sure we are using the old v0.3.2 version of pyvirtualcam. This needs to be reflected in the Pipfile because pipenv will just blindly install the latest version. pyvirtualcam v0.3.2 is still available on pypi as pyvirtualcam==0.3.2.

Write log files to local app data

Currently log files are written to the current working directory. This will not work if we install the application to directories that require privileged access (ie. C:\Program Files). Log files should instead be written to local app data.

pyvirtualcam sometimes fails to start if camera device is open

If the camera device is open in something like Discord and the camera is closed and opened again, this will result in

OBSVirtualVideo handle exists already
shared_queue_check() failed

Interestingly though, if the device is opened before the initial pyvirtualcam is opened, the video stream will change from no video to the initial stream without a problem. If you then try to close and open the camera again, it will result in the same error.

If you close all consumers of the virtual camera before restarting pyvirtualcam, there will be no error. I wonder if pyvirtualcam needs time to free the HWND handle before starting a new camera.

Firewall blocks webserver connection

Windows firewall blocks incoming traffic of the webserver. Right now, the application needs to be allowed through the firewall or the firewall needs to be disabled entirely. Maybe we can find a way to prompt for access through the firewall or manually allowing the application through.

High CPU usage

The application is doing nothing but idling and using roughly 10-20% CPU usage on my system.

Use back facing camera

Right now we only stream the front facing camera. Might be useful to add support to switch to back facing camera.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.