Adding and removing v4l2-loopback devices?

16,286

I don't have an elegant way to remove these devices other than force remove the v4l2loopback module:

sudo modprobe -r v4l2loopback
Share:
16,286

Related videos on Youtube

beenum
Author by

beenum

Updated on September 18, 2022

Comments

  • beenum
    beenum almost 2 years

    I have different lxc containers running on my machine and a webcam is also attached. I want all of the lxc containers to access this camera. I came across 'v4l2-loopback' devices and found a way to add devices using;

    modprobe v4l2loopback devices=3
    

    And I directed the stream from /dev/video0 to the desired virtual video devices. My question is how to add and remove these v4l2loopback devices at runtime? I want to add/remove a device whenever any lxc container is launched/deleted. Any ideas?

    Thanks!

  • Rodrigo Graça
    Rodrigo Graça about 4 years
    After I run this command it gives me no output. I dont know if it removed anything....
  • Marcelo Bittencourt
    Marcelo Bittencourt about 3 years
    You can use v4l2-ctl --list-devices to check your virtual devices