Giter Club home page Giter Club logo

vcam's Introduction

vcam: Virtual camera device driver for Linux

This Linux module implements a simplified virtual V4L2 compatible camera device driver with raw framebuffer input.

Prerequisite

The following packages must be installed before building vcam.

In order to compile the kernel driver successfully, package versions of currently used kernel, kernel-devel and kernel-headers need to be matched.

$ sudo apt install linux-headers-$(uname -r)

Since vcam is built with V4L2 (Video4Linux, second version), v4l-utils is necessary for retrieving more information and function validation:

$ sudo apt install v4l-utils

Build and Run

After running make, you should be able to generate the following files:

  • vcam.ko - Linux kernel module;
  • vcam-util - Sample utility to configure virtual camera device(s);

Before loading this kernel module, you have to satisfy its dependency:

$ sudo modprobe videobuf2_vmalloc videobuf2_v4l2

The module can be loaded to Linux kernel by runnning the command:

$ sudo insmod vcam.ko

Expectedly, two device nodes will be created in /dev:

  • videoX - V4L2 device;
  • vcamctl - Control device for virtual camera(s), used by control utility vcam-util;

In /proc directory, device file fbX will be created.

The device if initialy configured to process 640x480 RGB24 image format. By writing 640x480 RGB24 raw frame data to /proc/fbX file the resulting video stream will appear on corresponding /dev/videoX V4L2 device(s).

Run vcam-util --help for more information about how to configure, add or remove virtual camera devices. e.g. list all available virtual camera device(s):

$ sudo ./vcam-util -l

You should get:

Available virtual V4L2 compatible devices:
1. vcamfb0(640,480,rgb24) -> /dev/video0

You can use this command to check if the driver is ok:

$ sudo v4l2-compliance -d /dev/videoX -f

It will return a bunch of test lines, with 1 failed and 0 warnings at the end.

You can check if all configured formats and emulated controls are ok with this command:

$ sudo v4l2-ctl -d /dev/videoX --all

You will get information as following:

Driver Info:
	Driver name   : vcam
	Card type     : vcam
	Bus info      : platform: virtual
	Driver version: 4.15.18
	Capabilities  : 0x85200001
		Video Capture
		Read/Write
		Streaming
		Extended Pix Format
		Device Capabilities

Related Projects

License

vcam is released under the MIT License. Use of this source code is governed by a MIT License that can be found in the LICENSE file.

vcam's People

Contributors

jserv avatar waynelin1992 avatar pingsutw avatar

Forkers

wenfei6316

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.