ffmpeg – Inappropriate ioctl for device in zoneminder – zmc_dvideo0

I recently needed to rebuild my zoneminder local camera system, running on an RPi. I switched OS from Debian to Ubuntu and now I’m struggling to get video4linux to decode the video input. The result is either a black or green screen depending on the compression palette I select.

I’m using /dev/video0 as my input.

v4l2-ctl --list-devices

unicam (platform:fe801000.csi):
        /dev/video0
        /dev/media3

In the logs I’m getting:

zmc_dvideo0 10907   ERR Unable to query control: Inappropriate ioctl for device 

I don’t understand the function of the /dev/media3 device, presumably created by the bcm2835-v4l2 module. This site suggests that /dev/video0 needs to extract the ioctl from or link in some way to /dev/media3. Perhaps a red herring.

If I select /dev/media3 as the source, I get:

: FAT [zmc_dmedia3] [Failed to query video device: Inappropriate ioctl for device]
: ERR ['zmc -d /dev/media3' exited abnormally, exit status 255]

I’m using

  • PAL60 encoding
  • YUV422p compression
  • 1280 x 720 Capture Resolution
# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 24.04 LTS
Release:        24.04
Codename:       noble

# uname -a
Linux ubuntu 6.8.0-1005-raspi #5-Ubuntu SMP PREEMPT_DYNAMIC Wed May 22 15:01:35 UTC 2024 aarch64 aarch64 aarch64 GNU/Linux

Using ffmpeg from the cli, I get a similar output, resulting in a green display. This happens both with and without the hardware acceleration flag.

sudo -u www-data ffmpeg -f v4l2 -pix_fmt yuyv422 -framerate 30 -video_size 1280x720 -i /dev/video0 -codec:v h264_v4l2m2m video0_out.mp4

Read more here: Source link