Been messing about getting a webcam feed running in Octoprint. At first I started with an R-Pi Zero W + R-Pi Camera but due to some complications I quickly abandoned that route in favor of a quality Logitech webcam.
Octoprint is running on a Pi Zero W itself while I’ve got the C920 plugged into a Cubox-i4-Pro running Armbian 5.31 that I use for general light server duties (SMB, DLNA, OpenVPN, etc). The Cubox is streaming via VLC MJPEG (I wanted to stream the h.264 output of the camera, but seems that isn’t possible in a web browser? Works fine in Potplayer/MXplayer of course) that Octoprint can see and forward just fine.
What I cannot figure out is how to get snapshots/Timelapse working. I figure I need to be running a process on the Cubox to accomplish this but I can’t seem to find any proper instructions on any of the sites I’ve cobbled terminal commands from.
Here is the terminal command for the Cubox that gets the stream up and running:
cvlc -d v4l2:///dev/video0 --v4l2-width 1920 --v4l2-height 1080 --v4l2-chroma MJPG --v4l2-hflip 1 --v4l2-vflip 1 --sout ‘#standard{access=http{mime=multipart/x-mixed-replace;boundary=–7b3cc56e5f51db803f790dad720ed50a},mux=mpjpeg,dst=LOCAL_IP_HERE:8554/}’ -I dummy
Only way I’ve figured to kill it is to find the process ID then run Kill #, though I’m pretty certain this isn’t the best way to kill off the daemon.
I had originally planned on using another R-Pi Zero W and MotionEyeOS to host the camera but the Cubox is within USB cord distance and already running. I did try using Motion on the Cubox but had limited success, plus the h.264 streaming I couldn’t quite figure out if I want the extra quality.
My Gear:
Monoprice Maker Select V2.1
Octoprint 1.3.5 on Raspberry Pi Zero W
Logitech C920 attached to Cubox-i4-Pro running Armbian 5.31