Skip to content

/dev/videoX video source not wokring #315

@davidus-sk

Description

@davidus-sk

I have an RTSP camera which I convert into a virtual video device on RPi 4B+:

Linux PI1 6.12.62+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.12.62-1+rpt1 (2025-12-18) aarch64 GNU/Linux

modprobe v4l2loopback video_nr=99 card_label="VirtualCam" exclusive_caps=1

I then stream into this device via FFMPEG:

ffmpeg -i "rtsp://192.168.xxx.xxx/axis-media/media.amp" -f v4l2 -pix_fmt yuyv422 /dev/video99

FFMPEG does not complain and streaming into /dev/video99 does work. Some output:

v4l2-ctl -d /dev/video99 --list-formats

Produces:

ioctl: VIDIOC_ENUM_FMT
        Type: Video Capture

        [0]: 'YUYV' (YUYV 4:2:2)

cat /sys/devices/virtual/video4linux/video99/format

Produces:

YUYV:1920x1080@30

I can aslso grab a frame from /dev/video99 using python via cap = cv2.VideoCapture(99). It works.

Now when I do this:

./pi-webrtc-v1.2.2 --camera=v4l2:99 --v4l2-format yuyv --fps=15 --width=1920 --height=1080 --hw-accel --no-audio --use-mqtt --mqtt-host=XXXXXXXXX --mqtt-port=8883 --mqtt-username=XXXXXX --mqtt-password=XXXXXXXXX --uid=XXXXX --stun-url=stun:XXXXXXX:3478 --turn-url=turn:XXXXXX:3478 --turn-username=XXXXXXXX--turn-password=XXXXXX --rotation 0

I get this:

Using V4L2, ID: 99
V4L2 format: yuyv
[conductor] Use v4l2 capturer.
[v4l2_utils] Error: fd(16) set ctrl(9963810): Invalid argument
[v4l2_capturer] Error: Unable to set the rotation angle
[v4l2_utils] Error: fd(16) set ext ctrl(10029519): Invalid argument
[v4l2_capturer] Error: Unable to set video bitrate
[v4l2_utils] Error: fd(16) query buffer: Invalid argument

GPU mem vcgencmd get_mem gpu:

gpu=256M

Any ideas how to get it working? I tried various other formats than yuyv. No dice.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions