Metadata-Version: 2.1
Name: webcamd
Version: 1.0.1
Summary: A minimalist service for streaming a webcam over HLS
Home-page: https://github.com/dmitri-mcguckin/webcamd
Author: Igor Maculan
Maintainer: Dmitri McGuckin
Maintainer-email: hello@dmitrimcguckin.com
License: GPL-3.0
Project-URL: Documentation, https://github.com/dmitri-mcguckin/webcamd/blob/main/README.md
Project-URL: Bug Tracking, https://github.com/dmitri-mcguckin/webcamd/issues
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Operating System :: OS Independent
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Classifier: Topic :: Software Development :: User Interfaces
Classifier: Topic :: System :: Monitoring
Classifier: Topic :: System :: Networking :: Monitoring :: Hardware Watchdog
Requires-Python: >=3.9.0
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: opencv-python (==4.5.3.56)
Requires-Dist: PIL-Tools (==1.1.0)
Provides-Extra: dev
Requires-Dist: setuptools ; extra == 'dev'
Requires-Dist: wheel ; extra == 'dev'
Requires-Dist: flake8 ; extra == 'dev'
Requires-Dist: twine ; extra == 'dev'
Requires-Dist: sphinx ; extra == 'dev'
Requires-Dist: sphinx-rtd-theme ; extra == 'dev'

# OctoPrint Stuff

This is a collection of bits and bobs that make running Octoprint a tad easier.

The most notable component is webcamd which is a minimalist drop-in replacement for `mjpeg_streamer`.

* Octoprint appends a seemingly-random session ID to the camera URI, which confuses the hell out of `mjpg-streamer`
* `mjpg-streamer` doesn't appear to be capable of handle multiple simultaneous streams, resulting in the infuriating `403: Forbidden! frame already sent` error
* `mjpg-streamer` itself is complete overkill here

`webcamd` is based on Igor Maculan’s *“Simple Python Motion Jpeg”* [daemon](https://gist.github.com/n3wtron/4624820). It has been reworked to run under python-3.x, accept command-line arguments, to fine-tune the webcam streaming experience.

### Note!

The user running `webcamd` must have sufficient access to the webcam device. On most Linux systems, this is as simple as adding the user to the `video` group. Otherwise the daemon will have to be run as root, which is **NOT** recommended.

webcam@.service is a systemd unit file for webcam.py.

haproxy.cfg is a configuration file for haproxy that actually works with non-ancient versions of haproxy, and enforces SSL connections to Octoprint.

***

# `webcamd` Quickstart

### Install Locally

`$` `pip install .`


### Run the module directly

`$` `python3 -m webcamd`

### Help and Usage

`$` `webcamd --help`


### Create a SystemD Service

Open the following file and copy these contents:

```
/etc/systemd/system/webcamd.service
___________________________________
[Unit]
Description=Webcam Daemon. A minimalist webcam streaming service.
After=network.online.target
Wants=network.online.target

[Service]
Type=simple
User=octoprint
Group=octoprint
ExecStart=/usr/bin/webcamd
ExecStop=killall -u webcam webcamd

[Install]
WantedBy=multi-user.target
```

Then restart the systemd daemon loader:

`$` `sudo systemctl daemon-reload`

And enable the service, to allow the service to start automatically on boot:

`$` `sudo systemctl enable webcamd.service`

***

# Development

### Install Locally with `dev` dependencies

`$` `pip install -e .[dev]`


