Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8015

Camera board • Re: RaspberryPi2B+, imx219 NoIR V2 camera, libcamera-hello: OK, localhost:8081: UNABLE TO OPEN VIDEO DEVICE

$
0
0
Motion tries to use the old v4l2 camera interface, but Raspberry Pi OS Bookworm uses the libcamera interface.

You can get around that by starting motion with libcamerify which adds a translation layer to the interface.

Just put "libcamerify" in front of your motion command, like this:

Code:

rpdom@cam1:~ $ libcamerify motion
and motion should work.

You may need to install libcamera-tools with apt to get the libcamerify command.

If you have motion running as a service, you can add libcamerify to the service file. Copy /usr/lib/systemd/system/motion.service to /etc/systemd/system/motion.service and edit the ExecStart line like this

Code:

ExecStart=/usr/bin/libcamerify /usr/bin/motion
As you're using a NoIR camera (the same as me), you'll also need to tell it to use the NoIR turning file using an environment variable.

Here's my full /etc/systemd/system/motion.conf which works for me on a Pi 2B and a 3A+, both with the NoIR V2 cameras.

Code:

[Unit]Description=Motion detection video capture daemonDocumentation=man:motion(1)[Service]Type=simpleUser=motionEnvironment="LIBCAMERA_RPI_TUNING_FILE=/usr/share/libcamera/ipa/rpi/vc4/imx219_noir.json"ExecStart=/usr/bin/libcamerify /usr/bin/motion[Install]WantedBy=multi-user.target
Incidentally, there is no "+" version of the Pi 2B.

Statistics: Posted by rpdom — Fri Mar 28, 2025 9:54 am



Viewing all articles
Browse latest Browse all 8015

Trending Articles