Mjpeg-streamer fails to start (perviously worked on same hardware under Buster)

Creating a bug report/issue

I have previously used the same hardware to run mjpeg-streamer for my octoprint. I have recently upgraded to bullseye, and am in the process of migrating my services etc over.
I have been

Required Information

  • DietPi version
    G_DIETPI_VERSION_CORE=8
    G_DIETPI_VERSION_SUB=16
    G_DIETPI_VERSION_RC=2
    G_GITBRANCH=‘master’
    G_GITOWNER=‘MichaIng’
  • Distro version | bullseye
  • Kernel version | Linux DietPi 5.10.0-21-amd64 #1 SMP Debian 5.10.162-1 (2023-01-21) x86_64 GNU/Linux
  • SBC model | Native PC (x86_64)
  • Power supply used | OEM supply
  • SD card used | SATA-SSD

Additional Information (if applicable)

  • Software title | mjpeg-streamer
  • migrated then untinstalled and reinstalled - both didn’t work
  • Can this issue be replicated on a fresh installation of DietPi?
    ← If you sent a “dietpi-bugreport”, please paste the ID here →
  • Bug report ID | 0a9822e5-d2ff-4bfa-ae74-552bd1edadf1

Steps to reproduce

  1. using dell wyse systern (native PC) using USB sony eyetoy camera
  2. install mjpeg-streamer

Expected behaviour

service should start

Actual behaviour

service fails

Extra details

tain from log
journalctl -u mjpg-streamer.service

Apr 09 11:59:46 DietPi systemd[1]: Started mjpg-streamer (DietPi).
Apr 09 11:59:46 DietPi mjpg_streamer[83307]: MJPG-streamer [83307]: starting application
Apr 09 11:59:46 DietPi mjpg_streamer[83307]: MJPG Streamer Version.: 2.0
Apr 09 11:59:46 DietPi mjpg_streamer[83307]: MJPG-streamer [83307]: MJPG Streamer Version.: 2.0
Apr 09 11:59:46 DietPi mjpg_streamer[83307]:  i: Using V4L2 device.: /dev/video0
Apr 09 11:59:46 DietPi mjpg_streamer[83307]: MJPG-streamer [83307]: Using V4L2 device.: /dev/video0
Apr 09 11:59:46 DietPi mjpg_streamer[83307]:  i: Desired Resolution: 640 x 480
Apr 09 11:59:46 DietPi mjpg_streamer[83307]: MJPG-streamer [83307]: Desired Resolution: 640 x 480
Apr 09 11:59:46 DietPi mjpg_streamer[83307]:  i: Frames Per Second.: -1
Apr 09 11:59:46 DietPi mjpg_streamer[83307]: MJPG-streamer [83307]: Frames Per Second.: -1
Apr 09 11:59:46 DietPi mjpg_streamer[83307]:  i: Format............: JPEG
Apr 09 11:59:46 DietPi mjpg_streamer[83307]: MJPG-streamer [83307]: Format............: JPEG
Apr 09 11:59:46 DietPi mjpg_streamer[83307]:  i: TV-Norm...........: DEFAULT
Apr 09 11:59:46 DietPi mjpg_streamer[83307]: MJPG-streamer [83307]: TV-Norm...........: DEFAULT
Apr 09 11:59:46 DietPi mjpg_streamer[83307]:  i: Could not obtain the requested pixelformat: MJPG , driver gave us: GRBG
Apr 09 11:59:46 DietPi mjpg_streamer[83307]:     ... will try to handle this by checking against supported formats.
Apr 09 11:59:46 DietPi mjpg_streamer[83307]: Init v4L2 failed !! exit fatal
Apr 09 11:59:46 DietPi mjpg_streamer[83307]:  i: init_VideoIn failed
Apr 09 11:59:46 DietPi mjpg_streamer[83307]: MJPG-streamer [83307]: init_VideoIn failed
Apr 09 11:59:46 DietPi systemd[1]: mjpg-streamer.service: Main process exited, code=exited, status=1/FAILURE
Apr 09 11:59:46 DietPi systemd[1]: mjpg-streamer.service: Failed with result 'exit-code'.
Apr 09 12:06:54 DietPi systemd[1]: Started mjpg-streamer (DietPi).
Apr 09 12:06:54 DietPi mjpg_streamer[83874]: MJPG-streamer [83874]: starting application
Apr 09 12:06:54 DietPi mjpg_streamer[83874]: MJPG-streamer [83874]: MJPG Streamer Version.: 2.0
Apr 09 12:06:54 DietPi mjpg_streamer[83874]: MJPG Streamer Version.: 2.0
Apr 09 12:06:54 DietPi mjpg_streamer[83874]:  i: Using V4L2 device.: /dev/video0
Apr 09 12:06:54 DietPi mjpg_streamer[83874]:  i: Desired Resolution: 640 x 480
Apr 09 12:06:54 DietPi mjpg_streamer[83874]:  i: Frames Per Second.: -1
Apr 09 12:06:54 DietPi mjpg_streamer[83874]:  i: Format............: JPEG
Apr 09 12:06:54 DietPi mjpg_streamer[83874]:  i: TV-Norm...........: DEFAULT
Apr 09 12:06:54 DietPi mjpg_streamer[83874]:  i: Could not obtain the requested pixelformat: MJPG , driver gave us: GRBG
Apr 09 12:06:54 DietPi mjpg_streamer[83874]:     ... will try to handle this by checking against supported formats.
Apr 09 12:06:54 DietPi mjpg_streamer[83874]: Init v4L2 failed !! exit fatal
Apr 09 12:06:54 DietPi mjpg_streamer[83874]:  i: init_VideoIn failed
Apr 09 12:06:54 DietPi mjpg_streamer[83874]: MJPG-streamer [83874]: Using V4L2 device.: /dev/video0
Apr 09 12:06:54 DietPi mjpg_streamer[83874]: MJPG-streamer [83874]: Desired Resolution: 640 x 480
Apr 09 12:06:54 DietPi mjpg_streamer[83874]: MJPG-streamer [83874]: Frames Per Second.: -1
Apr 09 12:06:54 DietPi mjpg_streamer[83874]: MJPG-streamer [83874]: Format............: JPEG
Apr 09 12:06:54 DietPi systemd[1]: mjpg-streamer.service: Main process exited, code=exited, status=1/FAILURE
Apr 09 12:06:54 DietPi mjpg_streamer[83874]: MJPG-streamer [83874]: TV-Norm...........: DEFAULT
Apr 09 12:06:54 DietPi mjpg_streamer[83874]: MJPG-streamer [83874]: init_VideoIn failed
Apr 09 12:06:54 DietPi systemd[1]: mjpg-streamer.service: Failed with result 'exit-code'.

Checking out the v4l info on the camera:
v4l2-ctl --list-formats-ext

ioctl: VIDIOC_ENUM_FMT
	Type: Video Capture

	[0]: 'GRBG' (8-bit Bayer GRGR/BGBG)
		Size: Discrete 320x240
			Interval: Discrete 0.005s (187.000 fps)
			Interval: Discrete 0.007s (150.000 fps)
			Interval: Discrete 0.007s (137.000 fps)
			Interval: Discrete 0.008s (125.000 fps)
			Interval: Discrete 0.010s (100.000 fps)
			Interval: Discrete 0.013s (75.000 fps)
			Interval: Discrete 0.017s (60.000 fps)
			Interval: Discrete 0.020s (50.000 fps)
			Interval: Discrete 0.027s (37.000 fps)
			Interval: Discrete 0.033s (30.000 fps)
		Size: Discrete 640x480
			Interval: Discrete 0.017s (60.000 fps)
			Interval: Discrete 0.020s (50.000 fps)
			Interval: Discrete 0.025s (40.000 fps)
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.067s (15.000 fps)
	[1]: 'YUYV' (YUYV 4:2:2)
		Size: Discrete 320x240
			Interval: Discrete 0.005s (187.000 fps)
			Interval: Discrete 0.007s (150.000 fps)
			Interval: Discrete 0.007s (137.000 fps)
			Interval: Discrete 0.008s (125.000 fps)
			Interval: Discrete 0.010s (100.000 fps)
			Interval: Discrete 0.013s (75.000 fps)
			Interval: Discrete 0.017s (60.000 fps)
			Interval: Discrete 0.020s (50.000 fps)
			Interval: Discrete 0.027s (37.000 fps)
			Interval: Discrete 0.033s (30.000 fps)
		Size: Discrete 640x480
			Interval: Discrete 0.017s (60.000 fps)
			Interval: Discrete 0.020s (50.000 fps)
			Interval: Discrete 0.025s (40.000 fps)
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.067s (15.000 fps)

I am hoping that it may be a missing package that can be installed or possibly modifying the mjpeg-stramer command, however, I am not sure what I can do.

Hm this shows that your cam only supports GRBG and YUYV. Are you sure that you run it before with MJPG?

Thanks, @Jappe I am not sure what mode I ran mjpeg-streamer on this camera on the old install. I used to run this camera on an old pi3 too. I may need to fork out and get a new camera (with a long USB cable - the reason I am using this one is that it has a nice long USB cable that reaches my printer nicely).

If there is a way to switch mjpeg-streamer to run in GRBG or YUYV that would be an easy fix but I am not sure if that is something that can be done with mjpeg-streamer.

Alright I did a bit testing since I have a cam which supports MJPG and YUYV.
There is a -y flag to start mjpg-streamer in YUYV mode.
You have to edit the service file:

dietpi-servicesmjpg-streameredit
Then nano opens the file, you have to edit [Service] section. Uncomment the #ExecStart= line and add the -y after the video device. Also add another ExecStart= like shown in the example:

ExecStart=
ExecStart=/opt/mjpg-streamer/mjpg_streamer -i 'input_uvc.so -d /dev/video0 -y' -o 'output_http.so -p 8082 -n'

Save the file and restart the service and check via journalctl if it now uses YUYV.
Apr 10 16:32:58 DietPi mjpg_streamer[1186]: MJPG-streamer [1186]: Format............: YUYV

Thanks for following this up - I tried modifying the command to include -y to use the YUYV format but I had no joy.

I managed to get the camera working on motioneye which is a workable solution, although I expect that it is a little more resource intensive than mjpeg-streamer. So this solves my problem.
Thanks again for your assistance.