I have configured the device for my webcam (/dev/video1) for the container. Yet somehow only ffmpeg through v4l2 format works. Firefox, cheese, and chromium (so far I tested) fails to detect the camera.
My profile for the container:
config:
boot.autostart: "false"
cloud-init.vendor-data: |
#cloud-config
users:
- name: chicken
groups: wheel, video
sudo: ['ALL=(ALL) NOPASSWD:ALL']
write_files:
- path: /etc/profile
append: true
content: |
export WAYLAND_DISPLAY=wayland-1
export XDG_SESSION_TYPE=wayland
export QT_QPA_PLATFORM=wayland
export XDG_RUNTIME_DIR=/run/user/1000
mkdir -p /run/user/1000
chown chicken:chicken /run/user/1000
ln -sf /mnt/.sockets/wayland-1 /run/user/1000/wayland-1
ln -sf /mnt/.sockets/pipewire-0 /run/user/1000/pipewire-0
description: Configures Wayland
devices:
graphics:
gid: "1000"
type: gpu
uid: "1000"
pipewire:
path: /mnt/.sockets/pipewire-0
shift: "true"
source: /run/user/1000/pipewire-0
type: disk
wayland:
path: /mnt/.sockets/wayland-1
shift: "true"
source: /run/user/1000/wayland-1
type: disk
webcam-1:
source: /dev/video1
type: unix-char
name: gui
used_by:
- /1.0/instances/qarch-apps
project: default
What I have tried:
- Checking camera on host is working (all apps)
- running
ffmpeg -f v4l2 -i /dev/video1 -t 5 test1.mp4
on the container works - running
ffplay /dev/video1
works - using firefox, chromium, and cheese cannot detect the camera.
- i have set the groups of my user
- i’ve ran the commands on both the user and root of the container
Here’s my host detail:
$ ls -la /dev/video*
crw-rw----+ 1 root video 81, 1 Mar 26 20:23 /dev/video1
crw-rw----+ 1 root video 81, 2 Mar 26 20:23 /dev/video2
$ v4l2-ctl --device /dev/video1 --list-devices
Integrated Camera: Integrated C (usb-0000:06:00.3-3):
/dev/video1
/dev/video2
/dev/media0
On my container:
[root@qarch-apps ~]# ls /dev/video*
/dev/video1 /dev/video2
[root@qarch-apps ~]# groups chicken
chicken : chicken wheel video
[root@qarch-apps ~]# groups
root
[root@qarch-apps ~]# v4l2-ctl --device /dev/video1 --all
Driver Info:
Driver name : uvcvideo
Card type : Integrated Camera: Integrated C
Bus info : usb-0000:06:00.3-3
Driver version : 6.12.16
Capabilities : 0x84a00001
Video Capture
Metadata Capture
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04200001
Video Capture
Streaming
Extended Pix Format
Priority: 2
Video input : 0 (Camera 1: ok)
Format Video Capture:
Width/Height : 1280/720
Pixel Format : 'YUYV' (YUYV 4:2:2)
Field : None
Bytes per Line : 2560
Size Image : 1843200
Colorspace : sRGB
Transfer Function : Rec. 709
YCbCr/HSV Encoding: ITU-R 601
Quantization : Default (maps to Limited Range)
Flags :
Crop Capability Video Capture:
Bounds : Left 0, Top 0, Width 1280, Height 720
Default : Left 0, Top 0, Width 1280, Height 720
Pixel Aspect: 1/1
Selection Video Capture: crop_default, Left 0, Top 0, Width 1280, Height 720, Flags:
Selection Video Capture: crop_bounds, Left 0, Top 0, Width 1280, Height 720, Flags:
Streaming Parameters Video Capture:
Capabilities : timeperframe
Frames per second: 10.000 (10/1)
Read buffers : 0
User Controls
brightness 0x00980900 (int) : min=0 max=255 step=1 default=128 value=128
contrast 0x00980901 (int) : min=0 max=255 step=1 default=32 value=32
saturation 0x00980902 (int) : min=0 max=100 step=1 default=64 value=64
hue 0x00980903 (int) : min=-180 max=180 step=1 default=0 value=0
white_balance_automatic 0x0098090c (bool) : default=1 value=1
gamma 0x00980910 (int) : min=90 max=150 step=1 default=120 value=120
power_line_frequency 0x00980918 (menu) : min=0 max=2 default=1 value=1 (50 Hz)
0: Disabled
1: 50 Hz
2: 60 Hz
white_balance_temperature 0x0098091a (int) : min=2800 max=6500 step=1 default=4600 value=4600 flags=inactive
sharpness 0x0098091b (int) : min=0 max=7 step=1 default=3 value=3
backlight_compensation 0x0098091c (int) : min=0 max=2 step=1 default=1 value=1
Camera Controls
auto_exposure 0x009a0901 (menu) : min=0 max=3 default=3 value=3 (Aperture Priority Mode)
1: Manual Mode
3: Aperture Priority Mode
exposure_time_absolute 0x009a0902 (int) : min=4 max=1250 step=1 default=157 value=157 flags=inactive
exposure_dynamic_framerate 0x009a0903 (bool) : default=0 value=1
TL;DR: Video input only works on ffmpeg with v4l2 format