Skip to content

SrgWhoopsie/webcam_install

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 

Repository files navigation

webcam install and streaming to octorpint/klipper guide

Installing mjpg_streamer

open terminal and input

sudo apt-get install cmake libjpeg8-dev
wget https://github.com/jacksonliam/mjpg-streamer/archive/master.zip
unzip master.zip
rm -rf master.zip
cd mjpg-
cd mjpg-*
make
sudo make install

start service with

mjpg_streamer -i "/usr/local/lib/mjpg-streamer/input_uvc.so -n -f 10 -r 1280x720" -o "/usr/local/lib/mjpg-streamer/output_http.so -p 8090 -w /usr/local/share/mjpg-streamer/www"

goto web browser and enter ip address of hosting machine followed by :8090 to test stream,

return to terminal and ctrl+c to close running stream.

SETTING UP TO RUN ON STARTUP OF OCTOPRINT OR KLIPPER

in terminal input

cd /etc/systemd/system
sudo nano video0.service

in next window input

for octoprint
[Unit] After=octoprint.service

[Service] ExecStart=/usr/local/bin/video0.sh

[Install] WantedBy=default.target

for klipper
[Unit] After=klipper.service

[Service] ExecStart=/usr/local/bin/video0.sh

[Install] WantedBy=default.target

ctrl+s to save, crtl+x to exit

cd /usr/local/bin
sudo nano video0.sh

in next window input

#!/bin/bash

mjpg_streamer -i "/usr/local/lib/mjpg-streamer/input_uvc.so -n -f 10 -r 1280x720" -o "/usr/local/lib/mjpg-streamer/output_http.so -p 8090 -w /usr/local/share/mjpg-streamer/www"

ctrl+s to save, crtl+x to exit

SET PERMISSIONS FOR BOTH

sudo chmod 744 /usr/local/bin/video0.sh
sudo chmod 664 /etc/systemd/system/video0.service

enable service with

sudo systemctl daemon-reload
sudo systemctl enable video0.service

check camera options with

v4l2-ctl --list-devices
v4l2-ctl --all --device /dev/video0
v4l2-ctl --list-ctrls-menus
v4l2-ctl --list-formats-ext --device /dev/video0

camera options for amazon camera
User Controls

                 brightness 0x00980900 (int)    : min=-64 max=64 step=1 default=0 value=0
                   contrast 0x00980901 (int)    : min=0 max=64 step=1 default=32 value=32
                 saturation 0x00980902 (int)    : min=0 max=128 step=1 default=64 value=64
                        hue 0x00980903 (int)    : min=-40 max=40 step=1 default=0 value=0
    white_balance_automatic 0x0098090c (bool)   : default=1 value=1
                      gamma 0x00980910 (int)    : min=72 max=500 step=1 default=100 value=100
                       gain 0x00980913 (int)    : min=0 max=100 step=1 default=0 value=0
       power_line_frequency 0x00980918 (menu)   : min=0 max=2 default=1 value=1 (50 Hz)
                            0: Disabled
                            1: 50 Hz
                            2: 60 Hz
  white_balance_temperature 0x0098091a (int)    : min=2800 max=6500 step=1 default=4600 value=4600 flags=inactive
                  sharpness 0x0098091b (int)    : min=0 max=10 step=1 default=9 value=9
     backlight_compensation 0x0098091c (int)    : min=0 max=2 step=1 default=1 value=1

Camera Controls

              auto_exposure 0x009a0901 (menu)   : min=0 max=3 default=3 value=3 (Aperture Priority Mode)
                            1: Manual Mode
                            3: Aperture Priority Mode
     exposure_time_absolute 0x009a0902 (int)    : min=1 max=5000 step=1 default=157 value=157 flags=inactive
 exposure_dynamic_framerate 0x009a0903 (bool)   : default=0 value=1

    Type: Video Capture

    [0]: 'MJPG' (Motion-JPEG, compressed)
            Size: Discrete 1920x1080
                    Interval: Discrete 0.033s (30.000 fps)
                    Interval: Discrete 0.040s (25.000 fps)
                    Interval: Discrete 0.050s (20.000 fps)
                    Interval: Discrete 0.067s (15.000 fps)
                    Interval: Discrete 0.100s (10.000 fps)
                    Interval: Discrete 0.200s (5.000 fps)
            Size: Discrete 1280x1024
                    Interval: Discrete 0.033s (30.000 fps)
                    Interval: Discrete 0.040s (25.000 fps)
                    Interval: Discrete 0.050s (20.000 fps)
                    Interval: Discrete 0.067s (15.000 fps)
                    Interval: Discrete 0.100s (10.000 fps)
                    Interval: Discrete 0.200s (5.000 fps)
            Size: Discrete 1280x960
                    Interval: Discrete 0.033s (30.000 fps)
                    Interval: Discrete 0.050s (20.000 fps)
                    Interval: Discrete 0.067s (15.000 fps)
                    Interval: Discrete 0.100s (10.000 fps)
                    Interval: Discrete 0.200s (5.000 fps)
            Size: Discrete 1280x720
                    Interval: Discrete 0.033s (30.000 fps)
                    Interval: Discrete 0.040s (25.000 fps)
                    Interval: Discrete 0.050s (20.000 fps)
                    Interval: Discrete 0.067s (15.000 fps)
                    Interval: Discrete 0.100s (10.000 fps)
                    Interval: Discrete 0.200s (5.000 fps)
            Size: Discrete 1024x768
                    Interval: Discrete 0.033s (30.000 fps)
                    Interval: Discrete 0.050s (20.000 fps)
                    Interval: Discrete 0.067s (15.000 fps)
                    Interval: Discrete 0.100s (10.000 fps)
                    Interval: Discrete 0.200s (5.000 fps)
            Size: Discrete 848x480
                    Interval: Discrete 0.033s (30.000 fps)
                    Interval: Discrete 0.040s (25.000 fps)
                    Interval: Discrete 0.050s (20.000 fps)
                    Interval: Discrete 0.067s (15.000 fps)
                    Interval: Discrete 0.100s (10.000 fps)
                    Interval: Discrete 0.200s (5.000 fps)
            Size: Discrete 800x600
                    Interval: Discrete 0.033s (30.000 fps)
                    Interval: Discrete 0.040s (25.000 fps)
                    Interval: Discrete 0.050s (20.000 fps)
                    Interval: Discrete 0.067s (15.000 fps)
                    Interval: Discrete 0.100s (10.000 fps)
                    Interval: Discrete 0.200s (5.000 fps)
            Size: Discrete 640x480
                    Interval: Discrete 0.033s (30.000 fps)
                    Interval: Discrete 0.040s (25.000 fps)
                    Interval: Discrete 0.050s (20.000 fps)
                    Interval: Discrete 0.067s (15.000 fps)
                    Interval: Discrete 0.100s (10.000 fps)
                    Interval: Discrete 0.200s (5.000 fps)
            Size: Discrete 640x400
                    Interval: Discrete 0.033s (30.000 fps)
                    Interval: Discrete 0.040s (25.000 fps)
                    Interval: Discrete 0.050s (20.000 fps)
                    Interval: Discrete 0.067s (15.000 fps)
                    Interval: Discrete 0.100s (10.000 fps)
                    Interval: Discrete 0.200s (5.000 fps)
            Size: Discrete 352x288
                    Interval: Discrete 0.033s (30.000 fps)
                    Interval: Discrete 0.040s (25.000 fps)
                    Interval: Discrete 0.050s (20.000 fps)
                    Interval: Discrete 0.067s (15.000 fps)
                    Interval: Discrete 0.100s (10.000 fps)
                    Interval: Discrete 0.200s (5.000 fps)
            Size: Discrete 320x240
                    Interval: Discrete 0.033s (30.000 fps)
                    Interval: Discrete 0.040s (25.000 fps)
                    Interval: Discrete 0.050s (20.000 fps)
                    Interval: Discrete 0.067s (15.000 fps)
                    Interval: Discrete 0.100s (10.000 fps)
                    Interval: Discrete 0.200s (5.000 fps)
            Size: Discrete 176x144
                    Interval: Discrete 0.033s (30.000 fps)
                    Interval: Discrete 0.040s (25.000 fps)
                    Interval: Discrete 0.050s (20.000 fps)
                    Interval: Discrete 0.067s (15.000 fps)
                    Interval: Discrete 0.100s (10.000 fps)
                    Interval: Discrete 0.200s (5.000 fps)
            Size: Discrete 160x120
                    Interval: Discrete 0.033s (30.000 fps)
                    Interval: Discrete 0.040s (25.000 fps)
                    Interval: Discrete 0.050s (20.000 fps)
                    Interval: Discrete 0.067s (15.000 fps)
                    Interval: Discrete 0.100s (10.000 fps)
                    Interval: Discrete 0.200s (5.000 fps)
    [1]: 'YUYV' (YUYV 4:2:2)
            Size: Discrete 1920x1080
                    Interval: Discrete 0.200s (5.000 fps)
            Size: Discrete 1280x1024
                    Interval: Discrete 0.200s (5.000 fps)
            Size: Discrete 1280x960
                    Interval: Discrete 0.200s (5.000 fps)
            Size: Discrete 1280x720
                    Interval: Discrete 0.100s (10.000 fps)
                    Interval: Discrete 0.200s (5.000 fps)
            Size: Discrete 1024x768
                    Interval: Discrete 0.200s (5.000 fps)
            Size: Discrete 848x480
                    Interval: Discrete 0.200s (5.000 fps)
            Size: Discrete 800x600
                    Interval: Discrete 0.200s (5.000 fps)
            Size: Discrete 640x480
                    Interval: Discrete 0.200s (5.000 fps)
            Size: Discrete 640x400
                    Interval: Discrete 0.200s (5.000 fps)
            Size: Discrete 352x288
                    Interval: Discrete 0.200s (5.000 fps)
            Size: Discrete 320x240
                    Interval: Discrete 0.200s (5.000 fps)
            Size: Discrete 176x144
                    Interval: Discrete 0.200s (5.000 fps)
            Size: Discrete 160x120
                    Interval: Discrete 0.200s (5.000 fps)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published