v4l2loopback | v4l2-loopback device | Video Utils library

 by   umlaeute C Version: v0.12.7 License: GPL-2.0

kandi X-RAY | v4l2loopback Summary

kandi X-RAY | v4l2loopback Summary

v4l2loopback is a C library typically used in Video, Video Utils, Nodejs applications. v4l2loopback has no bugs, it has a Strong Copyleft License and it has medium support. However v4l2loopback has 1 vulnerabilities. You can download it from GitHub.

This module allows you to create "virtual video devices". Normal (v4l2) applications will read these devices as if they were ordinary video devices, but the video will not be read from e.g. a capture card but instead it is generated by another application. This allows you for instance to apply some nifty video effects on your Skype video…​ It also allows some more serious things (e.g. I’ve been using it to add streaming capabilities to an application by the means of hooking GStreamer into the loopback devices).
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              v4l2loopback has a medium active ecosystem.
              It has 3218 star(s) with 470 fork(s). There are 105 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 46 open issues and 372 have been closed. On average issues are closed in 590 days. There are 3 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of v4l2loopback is v0.12.7

            kandi-Quality Quality

              v4l2loopback has 0 bugs and 0 code smells.

            kandi-Security Security

              v4l2loopback has 1 vulnerability issues reported (0 critical, 0 high, 1 medium, 0 low).
              v4l2loopback code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              v4l2loopback is licensed under the GPL-2.0 License. This license is Strong Copyleft.
              Strong Copyleft licenses enforce sharing, and you can use them when creating open source projects.

            kandi-Reuse Reuse

              v4l2loopback releases are not available. You will need to build from source code and install.
              Installation instructions, examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of v4l2loopback
            Get all kandi verified functions for this library.

            v4l2loopback Key Features

            No Key Features are available at this moment for v4l2loopback.

            v4l2loopback Examples and Code Snippets

            No Code Snippets are available at this moment for v4l2loopback.

            Community Discussions

            QUESTION

            Unable to compile kernel module: no .ko file output
            Asked 2022-Feb-25 at 21:48

            I've built an android kernel (source code), now I'm trying to cross-compile a kernel module for it, v4l2loopback to be precise. I've used this toolchain to build the kernel (kernel version is 4.9).

            Here on github you can see that someone actually succeeded in compiling the module, and I've been trying to replicate their success myself. But in the last stage of actually building the kernel module I don't get a .ko file output. Here is what I get:

            ...

            ANSWER

            Answered 2022-Feb-25 at 16:48

            You seem to be building incorrectly. With make -C ../kernel you are completely ignoring the Makefile that is in the repository of the module you are trying to build and using the kernel Makefile alone. You should take a look at the Makefile inside v4l2loopback and notice the following lines at the beginning of the file:

            Source https://stackoverflow.com/questions/71268470

            QUESTION

            Using a video device in 2 applicatrions simoultaneously with Gstreamer
            Asked 2021-May-26 at 22:52

            I am trying to use the camera feed on my Jetson Nano (running headless over SSH) in 2 different applications.

            From the command line, I am able to run

            ...

            ANSWER

            Answered 2021-May-26 at 22:52

            Well, I managed to figure it out thanks to both commentors, here is my solution on my Jetson Nano, but it can be tweaked for any Gstreamer application.

            First, use v4l2loopback to create 2 virtual devices like so:

            Source https://stackoverflow.com/questions/67645546

            QUESTION

            Transform ASCII Art to OpenCV Mat
            Asked 2021-Apr-27 at 17:45

            I've recently started to work on a small project that consist of getting my camera input and transforming it into a virtual camera output as an Ascii art.

            In order to do so, I've decided to use OpenCV to get my camera input and v4l2loopback for the virtual camera output.

            In between, I've made a simple program that transform my OpenCV Mat into a grayscale Mat and then a function that transform my grayscale mat into an Ascii art

            Unfortunately I've found myself stuck at the moment where i want to transform my Ascii art into a new mat. I've had a look at openCV putText function source code (l.2256) in order to reproduce the same effect myself but I'm not able to fully understand it.

            Here is a sample code if you want to try some thing on your own (Make sure to have openCV installed)

            If anyone has an idea on how to do so I would really appreciate the help. Also, this is just a POC to learn how to do so, I do plan to rework it.

            Any help would be appreciate. Thanks by advance.

            ...

            ANSWER

            Answered 2021-Apr-27 at 17:45

            Here's a small proof of concept for converting a char matrix into an OpenCV Mat, using cv::putText. The idea is that you start with a matrix of chars (here, defined using std::vector) and you loop through each item. You extract the char, create a cell (an empty BGR Mat with a defined size), and you concatenate each cell into a bigger Mat. First you create columns (horizontal concatenation) and then you create rows (vertical concatenation), here's the code:

            Source https://stackoverflow.com/questions/67220643

            QUESTION

            Google chrome cannot detect v4l2loopback device
            Asked 2021-Feb-06 at 01:12

            I'm trying to transmit my screen using ffmpeg and v4l2loopback, more when running the commands:

            sudo modprobe v4l2loopback devices=1 video_nr=2 card_label="Camera Loopback"

            and

            ffmpeg -f x11grab -framerate 30 -video_size 1366x768 -i :0.0 -f v4l2 /dev/video2

            chrome does not detect the device in: /dev/video2, I tried everything to make it work, but chrome does not detect it, I tried to add the filter:

            -vf format=pix_fmts=yuv420p

            but still nothing.

            Chrome: 87.0.4280.66 (64bit)
            OS: LinuxMint 19.3
            v4l2loopback: 0.12.3

            If anyone can help me, thank you in advance!.

            ...

            ANSWER

            Answered 2021-Feb-04 at 14:20

            Note the parameter "exclusive_caps", necessary to work in Chrome, see my script as an example, it creates three cameras

            Source https://stackoverflow.com/questions/65514730

            QUESTION

            How to use stdout.write in python3 when piping to ffmpeg?
            Asked 2020-Dec-10 at 21:27

            My main goal for this project I'm working on is to use a python script to get any webcam footage, edit it with opencv, and then pipe the edited video frames with ffmpeg to a dummy webcam from v4l2loopback. Here's the sample code I made that runs exactly as I want to on python 2.7:

            ...

            ANSWER

            Answered 2020-Dec-10 at 21:27
            How to use stdout.write in python3 when piping to ffmpeg?

            as your question is titled "How to use stdout.write in python3 when piping to ffmpeg?", I'm going to answer that first:

            Source https://stackoverflow.com/questions/64849040

            QUESTION

            Stream static image to v4l2loopback using obs with v4l2 plugin, ffmpeg or gstreamer
            Asked 2020-Dec-10 at 21:23

            I want to stream a static image to the android studio emulator. To do that I created a virtual camera using v4l2loopback v.12.5 in linux ubuntu 20.04. The virtual camera is created in /dev/video2. I can stream there using obs and a plugin, ffmpeg or gstreamer but I've got different issues with each one. I don't care which software works... I always use an image with the resolution 1920x1080 to test this.

            OBS: I installed the obs plugin following this tutorial here. It explains how to install v4l2loopback and add the plugin to obs. The plugin is called obs-v4l2sink. I start v4l2loopback using this command:

            ...

            ANSWER

            Answered 2020-Dec-04 at 09:36

            I just tried it with Android Studio Emulator API 28 (Google X86_ARM) and it works. So it seems that it is related to the CPU Architecture of the emulator and x86 64 does not work. I needed arm though and thankfully Google added Arm translation to an image in Api 28.

            It seems that only images with resolution 1920x1080 work, but maybe it is only related to the ratio.

            Obs does not work now for some reason but this command works perfectly: ffmpeg -loop 1 -re -i licensePlate2.png -f v4l2 -vcodec rawvideo -pixfmt nv12 -vf transpose=4 /dev/video2

            Source https://stackoverflow.com/questions/65130397

            QUESTION

            How can I send a virtual camera to Genymotion or Android Studio Emulator in Ubuntu?
            Asked 2020-Dec-04 at 05:20

            I created a virtual camera using v4l2loopback and ffmpeg. The command I use for ffmpeg is: ffmpeg -re -l oop 1 -i vin.png -vf format=yuv420p -f v4l2 /dev/video2

            vin.png is the image I want to stream to the webcam and /dev/video2 is the virtual webcam I created with v4l2loopback. The virtual webcam works and I can see it e.g. with onlinemicetest.com/webcam-test. I'm using the Genymotion emulator with the newest Android API (I tried 7.0, 8.1 and 10.0) on Ubuntu 20.40. Genymotion detects the virtual camera but only displays a dummy image: Wrong dummy Image from Genymotion I also tried (and would prefer to use) the android studio emulator. But I can only select Webcam0 in the configuration of the device camera and that points to the real integrated camera and not to my virtual webcam.

            I don't need to use ffmpeg, but I do need to use a tool that lets me control which image to stream from the command line.

            Is there a way to solve this? Many thanks in advance!

            Update 17.11.2020: The Genymotion support answered me, that they plan to support virtual cameras in the future. They might be ready to add this in mid 2021.

            ...

            ANSWER

            Answered 2020-Nov-25 at 15:26

            QUESTION

            ffmpeg: chroma key (greenscreen filter) a short video continuosly loopling into a live video
            Asked 2020-Nov-13 at 17:08

            I know how to chroma key / greenscreen filter a background of a video stream and replace it by an image using v4l2loopback. After running

            ...

            ANSWER

            Answered 2020-Nov-05 at 20:51

            Use -stream_loop to loop and -re for real-time speed since you're streaming (or else it will play super fast):

            Source https://stackoverflow.com/questions/64704735

            QUESTION

            v4l2loopback "format not support" error in OBS Studio
            Asked 2020-Nov-11 at 12:04

            I keep getting a weird error in OBS Studio while trying to enable my virtual camera, "format not support". This is after installing packages in Manjaro 19.0.2:

            ...

            ANSWER

            Answered 2020-Aug-06 at 17:53

            I found it. I forgot to run sudo modprobe v4l2loopback. It enables it I think.

            Source https://stackoverflow.com/questions/63287704

            QUESTION

            When using ffmpeg as producer I cannot see v4l2loopback device in chrome
            Asked 2020-Oct-07 at 21:58

            I am able to see my v4l2loopback video device in chrome when using this command to produce a video stream:

            gst-launch-0.10 -v videotestsrc ! "video/x-raw-yuv,width=640,height=360,framerate=30/1,format=(fourcc)I420" ! v4l2sink device=/dev/video0

            But I am attempting to use ffmpeg to take an NDI stream and output it to a v4l2loopback device with a command like this:

            ffmpeg -f libndi_newtek -extra_ips "10.4.0.86" -i "ME-NDI002 (TEST)" -f v4l2 /dev/video0

            When I am using ffmpeg as a producer I am able to see the device in Firefox and Zoom but not in Chrome. Is there something I need to do to get ffmpeg to play nice with the exclusive_caps option?

            I am using v4l2loopback driver version 0.12.5

            Linux kernel is: Linux dva 3.10.0-1062.1.2.el7.x86_64 #1 SMP Mon Sep 30 14:19:46 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

            And Release information is: LSB Version: :core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch Distributor ID: CentOS Description: CentOS Linux release 7.7.1908 (Core) Release: 7.7.1908 Codename: Core

            ...

            ANSWER

            Answered 2020-Oct-07 at 21:58

            the problem is most likely, that some software (probably including chrome) is a bit picky about the supported colour format.

            your ffmpeg command doesn't specify any colour format, so I guess it will take one that is easiest to convert to from the NDI stream. NDI supports a number of different formats (including rather exotic ones like P216) and it might well be that it picks an output format that is not usable by chrome.

            otoh, your gstreamer-pipeline uses a very specific format (I420). try enforcing the same format when using ffmpeg, e.g. using something like -vf format=pix_fmts=yuv420p

            see also https://github.com/umlaeute/v4l2loopback/wiki/Colorspace-Issues

            Source https://stackoverflow.com/questions/64217549

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install v4l2loopback

            To build the kernel module, run:. This should give you a file named "v4l2loopback.ko", which is the kernel module.
            You cannot load a module built for a specific version of the kernel into another version of the kernel. So, if you have successfully built the module previously and have updated your kernel (and the matching headers) In the meantime, you really must clean the build before re-compiling the module. So run this before starting the build again:.
            To install the module, run "make install" (you might have to be root to have all necessary permissions to install the module).
            The most up-to-date version of this module can be found at http://github.com/umlaeute/v4l2loopback/.

            Support

            If you have a secure-boot enabled kernel, you might not be able to simply build a kernel module and insert it. (You will get SSL errors when building the module.) This is actually a security feature (as it prevents malicious code to be inserted into kernel-space). If you are not allowed to insert the kernel module (running modprobe, or insmod), you have a few options (consult your distribution’s documentation on how to perform any of these steps): - disable secure-boot and reboot - sign the module binary with a whitelisted key (this probably only applies if you are creating a distribution). You could also just try building the module [via DKMS](#DKMS), and hope that it does all the magic for you.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/umlaeute/v4l2loopback.git

          • CLI

            gh repo clone umlaeute/v4l2loopback

          • sshUrl

            git@github.com:umlaeute/v4l2loopback.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link