Add webcam to Octoprint Topic is solved

Suggestions for features and software you would like to see in DietPi, goes here.
Post Reply
alaw005
Posts: 1
Joined: Tue May 26, 2020 3:48 am

Add webcam to Octoprint

Post 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.
priyan776
Posts: 1
Joined: Thu Oct 15, 2020 3:21 pm

Re: Add webcam to Octoprint

Post by priyan776 »

It works great. have to keep the SSH running. is there a solution for that?
User avatar
Joulinar
Posts: 2297
Joined: Sat Nov 16, 2019 12:49 am

Re: Add webcam to Octoprint

Post 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 &
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
User avatar
WarHawk
Posts: 621
Joined: Thu Jul 20, 2017 8:55 am

Re: Add webcam to Octoprint

Post 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
User avatar
Joulinar
Posts: 2297
Joined: Sat Nov 16, 2019 12:49 am

Re: Add webcam to Octoprint

Post by Joulinar »

well, DietPi is using Armbian as base image as well for a couple of devices. ;)
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Post Reply