DietPi version
G_DIETPI_VERSION_CORE=8
G_DIETPI_VERSION_SUB=25
G_DIETPI_VERSION_RC=1
G_GITBRANCH=‘master’
G_GITOWNER=‘MichaIng’
Distro version = bookworm 1
Kernel version = Linux 6.1.21+ #1642 Mon Apr 3 17:19:14 BST 2023 armv6l GNU/Linux
Architecture = armhf
SBC model = RPi Zero W (armv6l)
Power supply used = Raspberry Pi Brand Micro USB
SD card used = Panasonic 16GB
Hello all - I’m running Mjpg-Streamer successfully on an x86 device with Dietpi.
But on my RPi0 W, I seem to hit a issue. Any ideas? It looks like it might be a simple fix. Here’s the result of journalctl -u mjpg-streamer.service
Jan 04 16:24:02 ZEROCAM01 systemd[1]: Started mjpg-streamer.service - mjpg-streamer (DietPi).
Jan 04 16:24:02 ZEROCAM01 mjpg_streamer[393]: MJPG-streamer [393]: starting application
Jan 04 16:24:02 ZEROCAM01 mjpg_streamer[393]: MJPG Streamer Version.: 2.0
Jan 04 16:24:02 ZEROCAM01 mjpg_streamer[393]: ERROR: could not find input plugin
Jan 04 16:24:02 ZEROCAM01 mjpg_streamer[393]: Perhaps you want to adjust the search path with:
Jan 04 16:24:02 ZEROCAM01 mjpg_streamer[393]: # export LD_LIBRARY_PATH=/path/to/plugin/folder
Jan 04 16:24:02 ZEROCAM01 mjpg_streamer[393]: dlopen: input_raspicam.so: cannot open shared object file: No such file or directory
Jan 04 16:24:02 ZEROCAM01 mjpg_streamer[393]: MJPG-streamer [393]: MJPG Streamer Version.: 2.0
Jan 04 16:24:02 ZEROCAM01 mjpg_streamer[393]: MJPG-streamer [393]: ERROR: could not find input plugin
Jan 04 16:24:02 ZEROCAM01 mjpg_streamer[393]: MJPG-streamer [393]: Perhaps you want to adjust the search path with:
Jan 04 16:24:02 ZEROCAM01 mjpg_streamer[393]: MJPG-streamer [393]: # export LD_LIBRARY_PATH=/path/to/plugin/folder
Jan 04 16:24:02 ZEROCAM01 mjpg_streamer[393]: MJPG-streamer [393]: dlopen: input_raspicam.so: cannot open shared object file: No such file or directory
Jan 04 16:24:02 ZEROCAM01 systemd[1]: mjpg-streamer.service: Main process exited, code=exited, status=1/FAILURE
Jan 04 16:24:02 ZEROCAM01 systemd[1]: mjpg-streamer.service: Failed with result 'exit-code'.
Hi Jappe
Thanks for the speedy reply.
Looks like libraspberrypi-dev is already installed to the latest version. I’ll take a look at your edit.
Edit:
No luck with the legacy stack. I am running bullseye dietpi on the x86 device, and that runs Mjpeg-Streamer with no issues at all.
Might it be worth running buster on the Rpi0? The only service I am running on it is Mjpeg-Streamer.
I think running buster nowadays may be even more complicated then fixing this error.
On the github thread they also mentioned this
If you are running a cut down OS it’s possible it doesn’t have the required videocore headers and libraries included. Look for the directories
/opt/vc/lib and /opt/vc/include
You could also check for the plugin with find / -name input_raspicam.so and adjust LD_LIBRARY_PATH to this directory.
If you find nothing I would ask Micha, the current maintainer, how to fix this.
Probably the mjpg-streamer sources require an update.
We do install libraspberrypi-dev automatically on RPi when installing mjpg-streamer with dietpi-software, so it compiles with (legacy) RPi camera module support. But it might then try to use legacy libraries which do not exist anymore since Bullseye. Furthermore with the new Bookworm firmware packages, libraspberrypi-dev and all libraspberrypi libraries are generally deprecated.
Hi MichaIng, really appreciate your help.
I commented out the lines in the dietpi-software file, and purged + reinstalled.
After a reboot, I tried both camera_auto_detect=1 and (again rebooting) =0 in the config.txt.
Neither worked, but each output a slightly different result with journalctl -u mjpg-streamer.service: camera_auto_detect=1
Jan 04 21:27:23 ZEROCAM01 systemd[1]: Started mjpg-streamer.service - mjpg-streamer (DietPi).
Jan 04 21:27:24 ZEROCAM01 mjpg_streamer[399]: MJPG-streamer [399]: starting application
Jan 04 21:27:24 ZEROCAM01 mjpg_streamer[399]: MJPG Streamer Version.: 2.0
Jan 04 21:27:24 ZEROCAM01 mjpg_streamer[399]: ERROR: could not find input plugin
Jan 04 21:27:24 ZEROCAM01 mjpg_streamer[399]: Perhaps you want to adjust the search path with:
Jan 04 21:27:24 ZEROCAM01 mjpg_streamer[399]: # export LD_LIBRARY_PATH=/path/to/plugin/folder
Jan 04 21:27:24 ZEROCAM01 mjpg_streamer[399]: dlopen: input_raspicam.so: cannot open shared object file: No such file or directory
Jan 04 21:27:24 ZEROCAM01 mjpg_streamer[399]: MJPG-streamer [399]: MJPG Streamer Version.: 2.0
Jan 04 21:27:24 ZEROCAM01 mjpg_streamer[399]: MJPG-streamer [399]: ERROR: could not find input plugin
Jan 04 21:27:24 ZEROCAM01 mjpg_streamer[399]: MJPG-streamer [399]: Perhaps you want to adjust the search path with:
Jan 04 21:27:24 ZEROCAM01 mjpg_streamer[399]: MJPG-streamer [399]: # export LD_LIBRARY_PATH=/path/to/plugin/folder
Jan 04 21:27:24 ZEROCAM01 mjpg_streamer[399]: MJPG-streamer [399]: dlopen: input_raspicam.so: cannot open shared object file: No such file or directory
Jan 04 21:27:24 ZEROCAM01 systemd[1]: mjpg-streamer.service: Main process exited, code=exited, status=1/FAILURE
Jan 04 21:27:24 ZEROCAM01 systemd[1]: mjpg-streamer.service: Failed with result 'exit-code'.
And now camera_auto_detect=0
Jan 04 21:29:34 ZEROCAM01 systemd[1]: Started mjpg-streamer.service - mjpg-streamer (DietPi).
Jan 04 21:29:35 ZEROCAM01 mjpg_streamer[375]: MJPG-streamer [375]: starting application
Jan 04 21:29:35 ZEROCAM01 mjpg_streamer[375]: MJPG Streamer Version.: 2.0
Jan 04 21:29:35 ZEROCAM01 mjpg_streamer[375]: MJPG-streamer [375]: MJPG Streamer Version.: 2.0
Jan 04 21:29:35 ZEROCAM01 mjpg_streamer[375]: ERROR: could not find input plugin
Jan 04 21:29:35 ZEROCAM01 mjpg_streamer[375]: MJPG-streamer [375]: ERROR: could not find input plugin
Jan 04 21:29:35 ZEROCAM01 mjpg_streamer[375]: Perhaps you want to adjust the search path with:
Jan 04 21:29:35 ZEROCAM01 mjpg_streamer[375]: MJPG-streamer [375]: Perhaps you want to adjust the search path with:
Jan 04 21:29:35 ZEROCAM01 mjpg_streamer[375]: # export LD_LIBRARY_PATH=/path/to/plugin/folder
Jan 04 21:29:35 ZEROCAM01 mjpg_streamer[375]: dlopen: input_raspicam.so: cannot open shared object file: No such file or directory
Jan 04 21:29:35 ZEROCAM01 mjpg_streamer[375]: MJPG-streamer [375]: # export LD_LIBRARY_PATH=/path/to/plugin/folder
Jan 04 21:29:35 ZEROCAM01 mjpg_streamer[375]: MJPG-streamer [375]: dlopen: input_raspicam.so: cannot open shared object file: No such file or directory
Jan 04 21:29:35 ZEROCAM01 systemd[1]: mjpg-streamer.service: Main process exited, code=exited, status=1/FAILURE
Jan 04 21:29:35 ZEROCAM01 systemd[1]: mjpg-streamer.service: Failed with result 'exit-code'.
@MichaIng
Do you think this might be in any way relevant or useful?
just want to leave a note here in case anybody ends up here. Even for 32 bit it does not build input_raspicam.so because of the moving of the libraries.
The easiest way to solve this is by just modifying the CMakeLists.txt from mjpg-streamer/mjpg-streamer-experimental/plugins/input_raspicam and change all paths “opt/vc” for “usr”.
Having tried the above, I’m now stuck at this point:
pi@ZEROCAM01:~ $ ./mjpg-streamer-1.0.0/mjpg_streamer -o "output_http.so -w ./www" -i "input_raspicam.so"
MJPG Streamer Version.: 2.0
i: fps.............: 5
i: resolution........: 640 x 480
i: camera parameters..............:
Sharpness 0, Contrast 0, Brightness 50
Saturation 0, ISO 0, Video Stabilisation No, Exposure compensation 0
Exposure Mode 'auto', AWB Mode 'auto', Image Effect 'none'
Metering Mode 'average', Colour Effect Enabled No with U = 128, V = 128
Rotation 0, hflip No, vflip No
ROI x 0.000000, y 0.000000, w 1.000000 h 1.000000
ERROR: could not find output plugin output_http.so
Perhaps you want to adjust the search path with:
# export LD_LIBRARY_PATH=/path/to/plugin/folder
dlopen: output_http.so: cannot open shared object file: No such file or directory
pi@ZEROCAM01:~ $ export LD_LIBRARY_PATH=~/mjpg-streamer-1.0.0/plugins/input_raspicam; export LD_LIBRARY_PATH=~/mjpg-streamer-1.0.0/plugins/output_http
pi@ZEROCAM01:~ $ ./mjpg-streamer-1.0.0/mjpg_streamer -o "output_http.so -w ./www" -i "input_raspicam.so"
MJPG Streamer Version.: 2.0
ERROR: could not find input plugin
Perhaps you want to adjust the search path with:
# export LD_LIBRARY_PATH=/path/to/plugin/folder
dlopen: input_raspicam.so: cannot open shared object file: No such file or directory
Can I define the two folders? Both the input LD_LIBRARY_PATH=~/mjpg-streamer-1.0.0/plugins/input_raspicam and the output LD_LIBRARY_PATH=~/mjpg-streamer-1.0.0/plugins/output_http
I have just noticed that there isn’t an output_http.so in the respective folder.
I’m lost!
Oh! I should add - I swapped sdcards and am trying this in RaspiOS, not Dietpi.
thanks Joulinar. Maybe this can help in the future in case MichaIng decides to keep or remove mjpg-streamer from dietpi-software.
Edit:
In the end I used a uv4l_raspicam.service on RaspiOS Bullseye, and configured it to use mjpg. Success!
I don’t know if this might be an easier way to implement mjpg streams with the raspberry pi camera for future dietpi projects @MichaIng
Without libraspberrypi-dev, this RPi camera plugin is not compiled, hence the mjpg-streamer must of course not try to use it. In /etc/systemd/system/mjpg-streamer.service, the line should be hence changed to:
This is the correct module for generic cameras, like USB cams etc, but not sure whether it works with RPi camera modules when the modern camera stack is enabled. There is a large number of /dev/video* devices present in this case, and I never found the time to check what the purpose of all those is, i.e. which one to select as input, or it any of those works at all.
There is “libcamerafy” which somehow allows applications which to not know the modern RPi camera interface to use it with legacy API. This seems to work in case of motionEye, and hence might help here as well.
Thanks MichaIng. But as I’ve already spent 4x the amount of time I wanted to on solving this - as per usual - and I have a working solution with uv4l_raspicam, I’m going to leave this until I feel like playing around again with the RPi0.
Its name sounds like it would just access a /dev/video* device as normal UVC camera, but when the modern camera stack is enabled (default on RPi OS), then there are dozens of such devices, and I am not sure which one serves the correct camera stream.
Hi there. I followed this guide, making a few obvious changes as I went along. As I said in a previous post, I’m using a legacy 32 bit RpiOS image rather than Dietpi as the only service I need running is a webcam http server. edit: I skipped the RTSP section as I am quite happy with a basic mjpg stream, which is then accessed in HA.
Hey MichaIng
I made the line change to the service file as you suggested, but I’m still getting errors:
journalctl -u mjpg-streamer
Mar 09 16:31:25 ZERO2CAM01 systemd[1]: Started mjpg-streamer.service - mjpg-streamer (DietPi).
Mar 09 16:31:25 ZERO2CAM01 mjpg_streamer[2544]: MJPG-streamer [2544]: starting application
Mar 09 16:31:25 ZERO2CAM01 mjpg_streamer[2544]: MJPG-streamer [2544]: MJPG Streamer Version.: 2.0
Mar 09 16:31:25 ZERO2CAM01 mjpg_streamer[2544]: MJPG Streamer Version.: 2.0
Mar 09 16:31:25 ZERO2CAM01 mjpg_streamer[2544]: ERROR: could not find input plugin
Mar 09 16:31:25 ZERO2CAM01 mjpg_streamer[2544]: Perhaps you want to adjust the search path with:
Mar 09 16:31:25 ZERO2CAM01 mjpg_streamer[2544]: # export LD_LIBRARY_PATH=/path/to/plugin/folder
Mar 09 16:31:25 ZERO2CAM01 mjpg_streamer[2544]: dlopen: input_raspicam.so: cannot open shared object file: No such file or directory
Mar 09 16:31:25 ZERO2CAM01 mjpg_streamer[2544]: MJPG-streamer [2544]: ERROR: could not find input plugin
Mar 09 16:31:25 ZERO2CAM01 mjpg_streamer[2544]: MJPG-streamer [2544]: Perhaps you want to adjust the search path with:
Mar 09 16:31:25 ZERO2CAM01 mjpg_streamer[2544]: MJPG-streamer [2544]: # export LD_LIBRARY_PATH=/path/to/plugin/folder
Mar 09 16:31:25 ZERO2CAM01 mjpg_streamer[2544]: MJPG-streamer [2544]: dlopen: input_raspicam.so: cannot open shared object file: No such file or directory
Mar 09 16:31:25 ZERO2CAM01 systemd[1]: mjpg-streamer.service: Main process exited, code=exited, status=1/FAILURE
Mar 09 16:31:25 ZERO2CAM01 systemd[1]: mjpg-streamer.service: Failed with result 'exit-code'.
Mar 09 17:00:44 ZERO2CAM01 systemd[1]: Started mjpg-streamer.service - mjpg-streamer (DietPi).
Mar 09 17:00:44 ZERO2CAM01 mjpg_streamer[2970]: MJPG-streamer [2970]: starting application
Mar 09 17:00:44 ZERO2CAM01 mjpg_streamer[2970]: MJPG Streamer Version.: 2.0
Mar 09 17:00:44 ZERO2CAM01 mjpg_streamer[2970]: MJPG-streamer [2970]: MJPG Streamer Version.: 2.0
Mar 09 17:00:44 ZERO2CAM01 mjpg_streamer[2970]: ERROR: could not find input plugin
Mar 09 17:00:44 ZERO2CAM01 mjpg_streamer[2970]: Perhaps you want to adjust the search path with:
Mar 09 17:00:44 ZERO2CAM01 mjpg_streamer[2970]: # export LD_LIBRARY_PATH=/path/to/plugin/folder
Mar 09 17:00:44 ZERO2CAM01 mjpg_streamer[2970]: dlopen: input_raspicam.so: cannot open shared object file: No such file or directory
Mar 09 17:00:44 ZERO2CAM01 mjpg_streamer[2970]: MJPG-streamer [2970]: ERROR: could not find input plugin
Mar 09 17:00:44 ZERO2CAM01 mjpg_streamer[2970]: MJPG-streamer [2970]: Perhaps you want to adjust the search path with:
Mar 09 17:00:44 ZERO2CAM01 mjpg_streamer[2970]: MJPG-streamer [2970]: # export LD_LIBRARY_PATH=/path/to/plugin/folder
Mar 09 17:00:44 ZERO2CAM01 mjpg_streamer[2970]: MJPG-streamer [2970]: dlopen: input_raspicam.so: cannot open shared object file: No such file or directory
Mar 09 17:00:44 ZERO2CAM01 systemd[1]: mjpg-streamer.service: Main process exited, code=exited, status=1/FAILURE
Mar 09 17:00:44 ZERO2CAM01 systemd[1]: mjpg-streamer.service: Failed with result 'exit-code'.