Page 1 of 1

Add webcam to Octoprint

Posted: Tue May 26, 2020 4:48 am
by alaw005
Hi,

I have spent hours trying to work out how to get webcam running on Octoprint. I have worked out that you need to build and install mjpg-streamer from git and I have got this going (just) but I cannot work out how to start automatically and included in Octoprint.

Maybe adding a separate mjpg-streamer software install would be a good alternatively. Unfortunately this is beyond my skill level. The following is what I have managed so far from https://github.com/jacksonliam/mjpg-streamer.

Login as dietpi user on fresh install of DietPi with Octoprint and FFMpeg (under Software Additional):

Code: Select all

sudo apt-get install cmake
git clone https://github.com/jacksonliam/mjpg-streamer.git
cd mjpg-streamer/mjpg-streamer-experimental
make
sudo make install
I can then run mjpg_streamer:

Code: Select all

./mjpg_streamer -i "input_uvc.so" -o "output_http.so -p 5001"
And access stream or snapshot from:
http://dietpi:5001/?action=stream_0
http://dietpi:5001/?action=snapshot

I then go through the configuration steps for Octopi
http://dietpi:5000/

Under "Webcam & Timelapse Recordings": The above at least documents the install steps, which I cannot find anywhere else on the internet.

Re: Add webcam to Octoprint

Posted: Thu Oct 15, 2020 3:26 pm
by priyan776
It works great. have to keep the SSH running. is there a solution for that?

Re: Add webcam to Octoprint

Posted: Thu Oct 15, 2020 3:36 pm
by Joulinar
Hi,

there are a couple of ways how you can put thinks into background. There is quite a good explanation on the following link https://unix.stackexchange.com/question ... disown-and

It describe all the difference between nohup, disown and &

Re: Add webcam to Octoprint

Posted: Fri Oct 16, 2020 7:06 am
by WarHawk
This tutorial uses armbian...but it should work just fine on DietPi

I have it running on an Orange Pi Lite using this method and it works GREAT!

https://www.youtube.com/watch?v=LcA9o6OGfEg

Re: Add webcam to Octoprint

Posted: Fri Oct 16, 2020 9:37 am
by Joulinar
well, DietPi is using Armbian as base image as well for a couple of devices. ;)