Skip to main content
added [v4l2loopback] tag
Link
umläute
  • 6.7k
  • 2
  • 30
  • 54
Source Link
beenum
  • 91
  • 1
  • 1
  • 2

Adding and removing v4l2-loopback devices?

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!