nunofgs / docker-octoprint

Dockerfile to set up Octoprint with x86, armv6, armv7 and arm64 support!
https://hub.docker.com/r/nunofgs/octoprint/
GNU Affero General Public License v3.0
58 stars 32 forks source link

Mmjpg-streamer error with raspi camera #26

Open plapointe6 opened 5 years ago

plapointe6 commented 5 years ago

Hello,

First, @nunofgs, thanks for appliying modifications to the image to allow the raspi camera to work :)

When I saw that you added the support for it, I've tryed the new image.

Here is the command I issued :

docker run --name octoprint -d \
--restart unless-stopped \
--device /dev/vchiq \
--device /dev/gpiomem \
--device /dev/ttyUSB0 \
--env MJPEG_STREAMER_INPUT='input_raspicam.so -fps 25' \
-p 5000:80 \
-v /home/pi/octoprint:/data \
nunofgs/octoprint

The container run correctly and I am able to access to Octoprint. However, mjpg-streamer does not work. I see these messages in the logs :

2019-08-10 13:55:03,495 INFO supervisord started with pid 1
2019-08-10 13:55:04,503 INFO spawned: 'haproxy' with pid 8
2019-08-10 13:55:04,512 INFO spawned: 'octoprint' with pid 9
2019-08-10 13:55:04,523 INFO spawned: 'mjpeg-streamer' with pid 10
2019-08-10 13:55:04,572 INFO exited: mjpeg-streamer (exit status 1; not expected)
2019-08-10 13:55:05,576 INFO success: haproxy entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2019-08-10 13:55:05,577 INFO success: octoprint entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2019-08-10 13:55:05,582 INFO spawned: 'mjpeg-streamer' with pid 13
2019-08-10 13:55:05,607 INFO exited: mjpeg-streamer (exit status 1; not expected)
2019-08-10 13:55:07,616 INFO spawned: 'mjpeg-streamer' with pid 15
2019-08-10 13:55:07,642 INFO exited: mjpeg-streamer (exit status 1; not expected)
2019-08-10 13:55:10,652 INFO spawned: 'mjpeg-streamer' with pid 16
2019-08-10 13:55:10,676 INFO exited: mjpeg-streamer (exit status 1; not expected)
2019-08-10 13:55:10,677 INFO gave up: mjpeg-streamer entered FATAL state, too many start retries too quickly

There is no messages in the Stderr logs ...

My camera is activated in raspi-config.

Thanks !

nunofgs commented 5 years ago

Hi @plapointe6,

I actually don't have a raspi camera to test with :( I followed the changes in your initial PR. Any chance you could execute mjpeg-streamer directly and check the output?

Ex:

docker run --name octoprint -d \
--restart unless-stopped \
--device /dev/vchiq \
--device /dev/gpiomem \
--device /dev/ttyUSB0 \
--env MJPEG_STREAMER_INPUT='input_raspicam.so -fps 25' \
-p 5000:80 \
-v /home/pi/octoprint:/data \
nunofgs/octoprint
bash

Then, on the prompt try running:

start-mjpg-streamer

You should get some output out of that.

nunofgs commented 5 years ago

FWIW, I ordered a raspberry pi camera module and should be able to test this soon.

Pulpyyyy commented 4 years ago

Hello.

Any progress ?

Here is the output

root@3287ce4905f5:/data# start-mjpg-streamer
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: /usr/local/lib/mjpg-streamer/input_raspicam.so: cannot open shared object file: No such file or directory

There is no input_raspicam.so

root@3287ce4905f5:/usr/local/lib/mjpg-streamer# ls -all
total 172
drwxr-xr-x 2 root root  4096 Aug 27 21:30 .
drwxr-xr-x 1 root root  4096 Aug 27 21:30 ..
-rw-r--r-- 1 root root 13932 Aug 27 21:27 input_file.so
-rw-r--r-- 1 root root 14656 Aug 27 21:28 input_http.so
-rw-r--r-- 1 root root 42692 Aug 27 21:28 input_uvc.so
-rw-r--r-- 1 root root 18820 Aug 27 21:29 output_file.so
-rw-r--r-- 1 root root 31924 Aug 27 21:29 output_http.so
-rw-r--r-- 1 root root 13300 Aug 27 21:29 output_rtsp.so
-rw-r--r-- 1 root root 13724 Aug 27 21:29 output_udp.so
plapointe6 commented 4 years ago

A workaround for this is to use a different docker container for mmjpg-streamer. I run the docker image tdicola/pi_mjpeg_streamer with this command :

docker run --name mmjpg-streamer -d \
--restart unless-stopped \
--device /dev/vchiq \
-p 8080:8080 \
tdicola/pi_mjpeg_streamer \
"input_raspicam.so -fps 25"

Then I run nunofgs/docker-octoprint without camera configuration.

adarazs commented 4 years ago

I have the same problem. The root of the issue seems to be that mjpeg-streamer doesn't have the input_raspicam.so file available in the container. Log from the container startup:

2020-01-23 18:14:44,532 INFO spawned: 'mjpeg-streamer' with pid 10
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: /usr/local/lib/mjpg-streamer/input_raspicam.so: cannot open shared object file: No such file or directory
2020-01-23 18:14:44,621 INFO exited: mjpeg-streamer (exit status 1; not expected)

As far as I see it should be compiled and installed during the make && make install of mjpeg-streamer.

I used this command to start the container:

/usr/bin/docker run -d --name home-octoprint --device=/dev/ttyEnder --device=/dev/vchiq -e MJPEG_STREAMER_INPUT="input_raspicam.so -fps 25" -e CAMERA_DEV=/dev/vchiq -v /opt/volumes/octoprint-data:/data --publish 5001:80 --publish 8080:8080 nunofgs/octoprint:1.3.12

saarsinai commented 4 years ago

Hey, any plans on fixing this issue? having the same error regarding the input_raspicam.sofile not found