Skip to content

ajatoledo/mjpeg_stream_webcam

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mjpeg_stream_webcam

Webcam Streamer for Octoprint

I made this script for streaming an usb webcam to mjpeg suitable for OctoPrint on a mac, but it will probably work on linux and windows too.

Tested on python 3.7

Installation:

  • install homebrew from https://brew.sh/
  • from console run brew install python to get python 3.7
  • pip install virtualenv to install virtualenv
  • clone/download the repository on your drive
  • cd on the folder and run
virtualenv -p python3.7 .env
source .env/bin/activate
pip install -r requirements.txt
  • run the script with python mjpegsw.pyor .env/bin/python mjpegsw.py

optional params: python mjpegsw.py --camera 1 --port 5001 --ipaddress 0.0.0.0

on octoprint you can use http://localhost:5001/cam.mjpg for stream url and http://localhost:5001/snap.jpg for snapshot url.

MacOs Yosemite:

you need to use opencv-python==4.0.0.21

pip install -r requirements.yosemite.txt

OpenCv Segmentation fault

sometimes opencv crashes, for this you can use start.sh script that loops until you block it with CTRL-C

About

Webcam Streamer for Octoprint MacOs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 97.6%
  • Shell 2.4%