v4l2loopback | v4l2-loopback device | Video Utils library
kandi X-RAY | v4l2loopback Summary
kandi X-RAY | v4l2loopback Summary
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
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of v4l2loopback
v4l2loopback Key Features
v4l2loopback Examples and Code Snippets
Community Discussions
Trending Discussions on v4l2loopback
QUESTION
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:48You 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:
QUESTION
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:52Well, 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:
QUESTION
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:45Here'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 char
s (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:
QUESTION
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:20Note the parameter "exclusive_caps", necessary to work in Chrome, see my script as an example, it creates three cameras
QUESTION
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:27as your question is titled "How to use stdout.write in python3 when piping to ffmpeg?", I'm going to answer that first:
QUESTION
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:36I 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
QUESTION
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:26You can't: Genymotion does not support virtual cameras. See https://support.genymotion.com/hc/en-us/articles/360002734498-My-webcam-does-not-work-with-Genymotion-Desktop
QUESTION
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:51Use -stream_loop
to loop and -re
for real-time speed since you're streaming (or else it will play super fast):
QUESTION
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:53I found it. I forgot to run sudo modprobe v4l2loopback
. It enables it I think.
QUESTION
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:58the 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
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install v4l2loopback
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
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page