Docker-compose container and ffmpeg not cooperating with each other /dev/video0 file or directory not found but manually running ffmpeg -i /dev/video0 ~/test.mpeg works fine

I am not sure what’s going on it worked fine on Garuda Linux.

Linux Mulder 6.6.1-zen1 #1-NixOS ZEN SMP PREEMPT_DYNAMIC Tue Jan 1 00:00:00 UTC 1980 x86_64 GNU/Linux
system: “x86_64-linux”, multi-user?: yes, version: nix-env (Nix) 2.18.1, channels(root): “nixgl, nixos-23.11-small”, nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos
[root@Mulder:/home/dgraham]# fastfetch --pipe
root@Mulder

OS: NixOS 23.11.2134.cd2fef8ebbf4 (Tapir) x86_64
Host: OptiPlex 7010 (01)
Kernel: 6.6.1-zen1
Uptime: 38 mins
Packages: 1270 (nix-system), 106 (nix-user), 106 (nix-default)
Shell: bash 5.2.15
Display (Sceptre F27): 1920x1080
Terminal: /dev/pts/0
CPU: Intel(R) Core™ i5-3470 (4) @ 3.20 GHz
GPU 1: Intel Xeon E3-1200 v2/3rd Gen Core processor Graphics Controller
GPU 2: AMD Radeon 540/540X/550/550X / RX 540X/550/550X
Memory: 3.18 GiB / 15.52 GiB (20%)
Swap: 0 B / 17.08 GiB (0%)
Disk (/): 26.19 GiB / 898.51 GiB (3%) - ext4
Local IP (eno1): 192.168.4.60/22 *
Locale: en_US.UTF-8

Hey, welcome! :wave:

Does your system not have a /dev/video0 device? Given that you have two GPUs apparently, you might also have /dev/video1 I guess. At least I do on this dual GPU laptop.

Edit: If the device is there, it might be a permissions problem. Like so often.



Confirmed the device exists and matches my camera

157.499375] usb 3-1: USB disconnect, device number 2
[ 160.043844] usb 3-1: new high-speed USB device number 4 using xhci_hcd
[ 160.740455] usb 3-1: New USB device found, idVendor=046d, idProduct=0892, bcdDevice= 0.19
[ 160.740462] usb 3-1: New USB device strings: Mfr=0, Product=2, SerialNumber=1
[ 160.740464] usb 3-1: Product: HD Pro Webcam C920
[ 160.740465] usb 3-1: SerialNumber: B9565F1F
[ 160.741125] gspca_main: vc032x-2.14.0 probing 046d:0892
[ 160.741938] gspca_vc032x: reg_r err -32
[ 160.741946] vc032x: probe of 3-1:1.0 failed with error -32
[ 160.741987] usb 3-1: Found UVC 1.00 device HD Pro Webcam C920 (046d:0892)

I’m wondering if the problem lies with either the device since I do see an error with it. Or maybe there is a problem between the device and docker?

Well I’d say check two things:

  1. Does the device work without docker? If so, it is most likely okay.

  2. Check your docker configuration and ensure that docker, however you are running that (rootful, rootless) has the right permissions to actually access the device.

Eureka! Found how to resolve it! Access /dev/ttyUSB0 from homebridge docker · Issue #297 · homebridge/docker-homebridge · GitHub
You have to add a devices: section to the configuration. Then run docker up -d to reload the.yawl file


1 Like