1. Home
  2. /
  3. Projects
  4. /
  5. Virtual Camera Driver and Desktop Application Development for Windows OS
Integra Sources home button.

GET IN TOUCH

Virtual Camera Driver and Desktop Application Development for Windows OS

Custom software development Driver development

Background

The consumer electronics and entertainment industries are not standing still, constantly offering new gadgets for various purposes - communication, blogging, marketing, and more.

An Asian company offers a rotation tracking device that helps turn the most ordinary smartphone into a camera for streaming, allowing the author of the videos to be in the frame center all the time, tracking the user's position and rotating around its axis 360 degrees in automatic mode. The mobile application provides the main functionality.

After pairing the device and mobile gadget, everything is ready to go. The user has access to main functions such as selecting the active camera, selecting the tracking mode (face/shape/no tracking), selecting the position of the figure in the frame, and brightness control.

The user has the option to select the face tracking mode. In this case, artificial intelligence will automatically detect the face in the frame and control the object's movement.

The figure-follow mode allows the user to select an object in the frame to follow. In addition, there is a horseback riding tracking mode.

Since the software takes care of all the processing, the gadget is easy and convenient to work with, requiring minimal user participation.

This device will be more than relevant for video conferencing and live broadcasts, especially since it allows the owner to move freely around the location without worrying that he will fall out of the frame.

Application development process

Request

When contacting Integra Sources, the customer already had a working mobile application that provided the main functionality of the system.

Our developers had to create virtual camera drivers (audio and video) and a desktop application.

The user should be able to select this virtual camera device as a video source in any video call application.

The driver is supposed to work with Skype,  Zoom, Google Hangouts, Youtube, Facebook, and dozens of other applications.

Solution

The work on the project consisted of three parallel processes - video driver creation, audio driver creation, and desktop application development.

The audio and video driver for the virtual camera is written in C/C++.

The DirectShow filter accepts video streams from WebRTC as input. The Windows SDK C++ API provides the required functionality.

The video driver provides control of the camera feed via the desktop application:

1. Brightness, contrast, and color control

2. Framerate Control

3. Video Setting Control 

4. Resolution Control

The user can live stream on Facebook, Twitch, and YouTube. An RTMP connection is maintained directly between the mobile app and the video player, ensuring smooth video streaming regardless of bandwidth fluctuations.

5. Video Recording

The user can choose the video encoder, bitrate type, recording format, preset and audio quality.

Desktop application design
Preliminary design of the desktop app

The mobile application, using WebRTC, connects to the developed software using QR code credentials. The mobile app parses the QR code generated by the desktop app. 

The mobile app receives the URL and connects to it, adding its access token to the query parameter. The desktop application then gets an access token and user information for the get-session-data event. 

Data is emitted to the RTC event and can be received by the connected users who listen to it (excluding the client).

Connection establishment (the error case is included)
Сonnection establishment scheme with an error case

Since PC screens may have different sizes, some parts of the video may not fit the screen and may be cut off. To prevent video clipping, we made a responsive video container proportional to the screen size. In this case, no matter how you change the PC screen size, the video container will remain adapted to it.

Major Issues Resolved

Since C / C ++ was used for driver development, our team intended to develop a desktop application with the Qt framework and C++.

It turned out that Qt libraries couldn’t work effectively with the client backend.  Our team tried the solution based on the Electron framework. We connected Node.js (as Electron is based on it) to the backend part, and this connection was successful. 

Since Electron has some specifics, our team had to work hard to fix the demultiplexer issue. The decoding function did not function properly. Electron outputted audio and video in the same buffer, so we had to parse stream media ourselves. 

As a result, we managed to implement all our plans and got a working app version.

The Scope of Work

  • Video driver development
  • Audio driver development
  • Desktop application development

Technologies Used

  • The application is implemented using C++ and JavaScript.
  • We used C/C++ for driver development.
  • Our desktop application runs on Windows.
  • We used the Electron software framework for application development.
  • WiFi and 4G connections are used for networking.
  • We used the WebRTC protocol for video streaming. 
  • Windows Driver Kit is applied for driver development.
  • NSIS (Nullsoft Scriptable Install System) is used to create a Windows installer.

Result

Integra Sources developed a driver and a Windows application to capture WebRTC video from a client's mobile application and transmit it as standard video from a webcam.

The Screen Size

up to 1920X1080

Supports

WebRTC