October 21

Setting up a spoofing call system

The information is for informational purposes only.

To install the system you will need:

1) The main PC on which the Deepfake software will be launched

2) A PC/Laptop on which the call will take place

3) 2 phones (Pixel is best)

4) 2 USB/TYPEC cables (supporting data transfer)

5) Microphone

6) Smartphone Holders

Programs

The Spoofing call system uses the following programs:

1) DeepLiveCam (https://github.com/hacksider/Deep-Live-Cam)

2) BlueStacks (https://www.bluestacks.com/)

System

The essence of the system/the big picture/explanation

In our system, there is a PC on which the software is launched (hereinafter referred to as PC1), which reads the face of a real person and replaces it with the desired face in real time. There is a PC/Laptop on which a call with an operator takes place (hereinafter referred to as PC2). Pixel phones will be used as web cameras (since they are easy to connect and they produce the required image quality). Also, when working with PC2, an external microphone will be required so that our voice is correctly transmitted to BlueStacks. Well, for more convenient positioning and installation of the entire system, smartphone holders will be needed.

Figure 1

Figure 1 shows a schematic representation of the system construction.

The Pixel smartphone is shown in blue, which will record the face of a real person and transmit it to DeepLiveCam. Then, the DeepLiveCam output with the already modified face will be stretched to the full screen on the PC1 monitor. The Pixel smartphone is shown in red, which records the PC1 monitor and transmits it to PC2. The microphone connected to PC2 is shown in green.

Figure 2

Figure 2 demonstrates the functionality of the system.

Explanation of the equipment and system setup

PC1 for DeepFaceLive:

To obtain the optimal result of the system, a powerful PC with a high-performance video card is required. Our tests were conducted on 3060 and 4090 video cards, and on both of these cards, the output was 25-35 fps in the standard mode of the DeepFaceLive program. Launching DeepFaceLive in the enhanced quality mode (Face Enhancer) on these video cards, unfortunately, gave a maximum of 20 fps. However, as practice has shown, such image quality and speed are suitable for performing ordinary tasks.

Monitor for PC1:

When choosing a monitor, the main indicator to consider is PPI (pixels per inch). Due to the fact that we are shooting the monitor screen with a phone camera, when using a regular monitor with a low PPI, a pixel grid will be visible. The best monitors are those with a PPI of 250 and above, preferably 300-350. The second factor that would greatly facilitate the system's operation is the matte finish of the monitor - if it is matte, you will not have to deal with unnecessary glare by setting the correct light.

Smartphones/Webcams:

Why are cameras used to transmit images? The fact is that perfect software for creating deepfakes does not yet exist - the output image will in any case contain some irregularities, mask overlay bugs. The software that we will consider in this example is optimal at the time of writing the manual, it produces the best picture of currently existing software. And nevertheless, its output still contains minor flaws. If you transmit the DeepLiveCam output directly to the call, the interlocutor will be able to discern signs of mask overlay.

Cameras solve this problem: The camera we use to shoot the DeepLiveCam output (PC1) is specially selected not of the best quality to hide the defects of the mask overlay.

We use Pixel smartphones in our system as cameras because they are easy to set up and have good cameras for their money. In order to shoot a person and their face, Pixel 7,8, etc. are used (Blue phone in Figure 2). In order to shoot the monitor, Pixel 6,6a is used (Red phone in Figure 2). The "blue" Pixel, which shoots a person, must have a good camera so that when a piece of paper with text or plastic (which usually glares a lot) appears in the frame, each letter is visible. The "red" Pixel, on the contrary, must have a worse camera in order to hide the defects of the monitor shooting (pixel grid, glare).

However - if you need to transfer the original DeepLiveCam output to a call in BlueStacks - I have prepared an alternative way to transfer the image from PC1 to PC2, which you can read about below.

Microphone for PC2

The microphone is used only to prevent BlueStacks from taking sound from the Pixel device, because if you do not specify a separate microphone in the program - as a result, your interlocutor will hear noise and crackling in the call. Any one that meets your expectations about the sound quality will do.

System setup

System setup includes:

  • Installing DeepLiveCam on your main PC
  • Installing BlueStacks on your PC/Laptop for Calls
  • Connecting Pixel Phones to Computers
  • Setting Up DeepLiveCam
  • Setting Up Bluestacks

Installing DeepLiveCam on your main PC

On the GitHub page (https://github.com/hacksider/Deep-Live-Cam) there is a quick installation for Windows and step-by-step instructions for manual installation. Both methods are absolutely working - here choose what is more convenient for you.

I use Chocolatey to install this software, so I also attach instructions for installing the software through it:

1- Install Choco

Open Powershell as administrator and run:

Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))

2- Install Python, git, ffmpeg

choco install python --version=3.10.0
choco install git
choco install ffmpeg

3- Install Visual Studio from https://visualstudio.microsoft.com/visual-cpp-build-tools/

4- "git clone https://github.com/hacksider/Deep-Live-Cam.git" and "cd Deep-Live-Cam"

5- Download 2 models from https://huggingface.co/hacksider/deep-live-cam/tree/main and place them in Deep-Live-Cam\models folder

6- "cd Deep-Live-Cam" and "pip install -r requirements.txt"

7- If you are running on CPU, run python run.py

For GPU:
8- Install CUDA Toolkit 11.8 from https://developer.nvidia.com/cuda-11-8-0-download-archive

9- Install dependencies:

pip uninstall onnxruntime onnxruntime-gpupip install onnxruntime-gpu==1.16.3


10- Launch:

python run.py --execution-provider cuda

Installing BlueStacks on a PC/laptop for calls

Go to the official BlueStacks website (https://www.bluestacks.com/) and install any version of the program.

Connecting Pixel phones to computers

Now I will answer the question - why Pixel? Pixel smartphones have a built-in webcam mode. That is, pixel smartphones, basically, with factory settings and without additional programs, can be used as webcams. Well, and an important point is the quality of the cameras of Pixel smartphones themselves, they produce the best picture among their analogues. You can use other smartphones, webcams and regular cameras in your work, if you want. Just specifically in this guide, we will consider working with Pixel devices.

In order to connect a Pixel smartphone as a webcam to a PC, you need a TypeC cable. Be careful when choosing a TypeC cable, they can be with or without a file transfer function. We need a cable that supports the file transfer function. Usually, the cables that come with phones have this function.

1) Connect Pixel to PC with TypeC cable

2) Call the top menu

3) Open the "Charging via USB" tab that appears (this tab will only appear if you are using a cable that supports file transfer)

4) In the list, select the "WebCam" mode

5) After this, the smartphone will reconnect to the PC itself, and by calling the top menu you will see a new tab "WebCam"

6) Click on the "WebCam" tab and now our smartphone is used as a Web Camera, Done!

Setting up DeepLiveCam

As I said earlier - on the PC1 monitor we need to display a full-screen DeepFake image. The DeepLiveCam program has a built-in function for stretching the image to full screen, in order to enable this function, you need to run the program with an additional parameter: "--live-resizable"

That is, if the normal launch of the program looks like:

"python run.py --execution-provider cuda"

Then the launch with the enabled function looks like:

"python run.py --execution-provider cuda --live-resizable"

You can find more details on the official GitHub page.

After launching the program, you will see a window:

Select the desired face and, to begin with, I recommend setting the following settings:

Before starting, make sure that the webcam/Pixel is connected to PC1, then click the "Live" button:

We see the camera output with the face already changed, which we can stretch to the entire screen. To close it, just click the cross.

But in this case, if a second, third, etc. Face appears in the frame, the mask will fail and jump from one face to another. In what situations is this inconvenient?
For example, you are DiCaprio and you want to make a call on behalf of Elon Musk, and you have "documents" with Elon Musk's face. In this case, as soon as a second face (even a card with your or another face) gets into the frame with your face, the Mask will start to fail.
In order to solve this problem, there is a MapFaces function, in which you can set a replacement for each individual face with a separate face.

We put a tick and click Live:

A window opens in front of us, in which we can add the faces used in the frame. So, let's set up the program for the situation described above. Click Add:

In the right column, select "the person we will replace" and in the left column, "the person we will replace with"

Also, remember that we have a "document" with Elon's face and we need the mask on his face to not fail. So we add a new line by clicking the Add button and add Elon's face on both sides:

In this case, the program will replace our face with Elon's face, And Elon's face on the card will be replaced with his (i.e. it won't be).

To improve the quality of the picture, there is a Face Enhancer function:

But this function is incredibly demanding and requires a very powerful PC.

Bluestacks setup

Connect the Microphone and Pixel to PC2, open the Bluestacks app player, open the settings:

In the "Devices" tab, in the "Microphone" section, we specify our external microphone, in the "Camera" section, we specify our Pixel (it will be displayed as Android Webcam).

"Save changes" and Done! Now, when you open any application on BlueStacks that uses the camera, our image from DeepLiveCam will be displayed.

Alternative way to transfer image from DeepLiveCam(PC1) to BlueStacks(PC2)

As I mentioned above, this approach will not hide mask overlay defects. However, in some tasks that do not require hiding defects, this method may be more convenient.

In this alternative method, we will use image transfer using third-party programs over the network. Also, this method is convenient in many ways because PC1, on which DeepLiveCam is running, can be located at the other end of the world from PC2, and still transfer the desired image to BlueStacks on PC2.

This method considers two approaches: the first is suitable only for PC2 on NVIDIA, the second - for PC2 on both NVIDIA and AMD.

Approach for PC2 on NVIDIA:

Programs:

1) Logitech Capture (https://www.logitech.com/en-gb/software/capture.html)

2) OBS (latest version) (https://obsproject.com/)

3) BlueStacks (any version) (https://www.bluestacks.com/)

4) DeepLiveCam (https://github.com/hacksider/Deep-Live-Cam)

5) Vdo Ninja (https://vdo.ninja/)

Settings:

1) Install and configure DeepLiveCam on PC1 as explained in the previous points

2) Install and configure OBS on PC1

Install the latest version of OBS from the official website (https://obsproject.com/) on PC1

When you first start OBS, it will ask you about the desired settings. Select the item "I will only use a virtual camera" Because we do not need additional settings for image quality/recording parameters, etc.

Launch DeepLiveCam and select the DeepLiveCam output window as the image source in OBS (select window capture):

In the OBS preview window, stretch the selected window so as to hide the frames on the sides:

Open the OBS virtual camera settings:

Select Output Type - Source, Output Tool - Window Capture:

Launch the OBS Virtual Camera:

Now OBS uses the DeepLiveCam output image, and the PC sees our OBS as a Virtual Camera.

3) Setting up Vdo Ninja on PC1

After you have enabled the OBS virtual camera, open the official Vdo Ninja website (https://vdo.ninja/) and add our camera:

Here you can adjust the quality of the transmitted image, select the devices used and set a password for the stream. (You can not turn on the audio transmission, because in the end the sound from another microphone will be used in the call)

Then click "Start" and copy the link to the direct stream:

By opening this link on any device anywhere in the world, we will receive the broadcast stream from OBS on PC1.

4) Installing and configuring Logitech Capture on PC2

Install the Logitech Capture program on PC2 from the official website (https://www.logitech.com/en-gb/software/capture.html)

Open the link from VDO ninja in the PC2 browser and expand the image to full screen:

Open Logitech Capture and select Capture Source 1:

Select a browser window with a Direct Stream from Vdo Ninja:

To remove the Logitech watermark, go to the third tab and uncheck the box:

5) Install and configure BlueStacks on PC2

Install any version of Bluestacks from the official website (https://www.bluestacks.com/)

Open the program and configure it exactly as explained earlier, but as a camera, select not Android Webcam, but Logi Capture

Now open any application that uses the camera in BlueStacks, open the Browser Page with the Direct Stream from Vdo Ninja again, expand the image to full screen and open BlueStacks ON TOP OF THIS WINDOW:

Now the image from BlueStacks camera on PC2 is used as the image output from DeepLiveCam on PC1.

Approach for PC2 on NVIDIA/AMD:

Programs:

1) OBS (latest version) (for PC1) (https://obsproject.com/)

2) OBS 27.2.4 (for PC2) (https://github.com/obsproject/obs-studio/releases/tag/27.2.4)

3) OBS Virtualcam 2.0.5 Plugin (for PC2)(https://obsproject.com/forum/resources/obs-virtualcam.949/)
4) BlueStacks 5.10 (https://support.bluestacks.com/hc/en-us/articles/10877586285197-BlueStacks-5-10-Release-Notes)

5) DeepLiveCam (https://github.com/hacksider/Deep-Live-Cam)

6) Vdo Ninja (https://vdo.ninja/)

Setting:

Download OBS 27.2.4 from the official page GitHub(https://github.com/obsproject/obs-studio/releases/tag/27.2.4)

Scroll down and download the configuration suitable for your PC

Install, open OBS 27.2.4, when you first open it, a window will appear to select settings - select the item "I will only use a virtual camera" Because we do not need additional settings.

Download and install OBS Virtualcam 2.0.5 Plugin(https://obsproject.com/forum/resources/obs-virtualcam.949/)

Download it, install it, then restart OBS 27.2.4.

After restarting OBS 27.2.4, in the top panel select the "tools" tab, and in it "virtual camera".

Check the box "automatic start" and click "Start"

In the "Sources" window, add the "Browser" source:

In the window that appears, insert the link to the stream from the VDO Ninja website (how to get this link is shown in the previous steps):

After this we stretch the image:

Download and install BlueStacks 5.10 (https://support.bluestacks.com/hc/en-us/articles/10877586285197-BlueStacks-5-10-Release-Notes)

Open BlueStacks 5.10, open settings:

This time in devices as a web camera

we select OBS-CAMERA and NOT OBS Virtual Camera:

We launch any program that uses a web camera and see our image broadcast from Vdo Ninja: