Mjpg-steamer parallel install denied by apparmor VL4

This is a re-post of a subject I put on askubuntu hoping for answer here. Ubuntu 22 parallel install of mjpg-streamer.

My computer in the shop has two ubs cameras attached and working fine. Now I am trying to use mjpg-streamer to send both cameras feed to zoneminder on a second computer in the house. I have two installs of snap mjpg-streamer mjpg-streamer_exper the original one can send either of the streams (video0 and video2) and zoneminder displays them. The second install fails with a syslog message that ERROR opening V4L interface: Permission denied mjpg-streamer_exper.mjpg-streamer-service[10960]: Init v4L2 failed !! exit fatal init_VideoIn failed snap.mjpg-streamer_exper.mjpg-streamer-service.service: Main process exited, code=exited, status=1/FAILURE apparmor=“DENIED” operation=“open” class=“file” profile=“snap.mjpg-streamer_exper.mjpg-streamer-service” name="/dev/video2" pid=10960 comm=“mjpg_streamer” requested_mask=“wr” denied_mask=“wr” fsuid=0 ouid=0

Thanks Jim

Not sure what resolved this issue but both cameras are now streaming. Both mjpg-streamer’s are out putting and are visible in a browser on different ports. Messing with apparmor may have corrected this but not sure.

You shouldn’t need to touch any apparmor bits at all, just make sure that both snaps have the camera interface connected and that you picked the correct video device and different port numbers in the respective config files under /var/snap/<snapname>/current/config (and indeed set DAEMON=true for both of them)

ogra Now that the cameras are both working I have seen a new issue. One camera caused a buffer overflow at the zoneminder end but research said the frame count should be reduced at the mjpg end. Is there any where that frame count can be changed with in the snap mjpg-streamer?

Thanks Jim

The first line in the above config file holds the commandline options the daemon is started with… IIRC there is one to set the frame rate