@@ -7,6 +7,16 @@ same out of the box features as the octopi raspberry-pi machine image, using doc
77
88- ` latest ` , ` 1.4.2 ` , ` 1.4 ` , ` 1 ` ([ Dockerfile] ( Dockerfile ) )
99
10+ - [ OctoPrint-docker] ( #octoprint-docker )
11+ - [ Tags] ( #tags )
12+ - [ Usage] ( #usage )
13+ - [ Configuration] ( #configuration )
14+ - [ Enabling Webcam Support with Docker] ( #enabling-webcam-support-with-docker )
15+ - [ Webcam Setup in OctoPrint] ( #webcam-setup-in-octoprint )
16+ - [ Container Environment based configs] ( #container-environment-based-configs )
17+ - [ Editing Config files manually] ( #editing-config-files-manually )
18+ - [ Without docker-compose] ( #without-docker-compose )
19+
1020## Usage
1121
1222We recommend you use docker-compose to run octoprint via docker, and have included
@@ -22,7 +32,22 @@ launch of OctoPrint using docker.
2232
2333### Configuration
2434
25- #### Initial Setup
35+ #### Enabling Webcam Support with Docker
36+
37+ In order to use the webcam, you'll need to make sure the webcam service is enabled.
38+ This is done by setting the environment variable ` ENABLE_MJPG_STREAMER=true ` in your
39+ ` docker run ` command, or in the ` docker-compose.yml ` file.
40+
41+ You'll also need to add ` --device /dev/video0:/dev/video0 ` to your ` docker run ` , or ensure
42+ it's listed in the ` devices ` array in your ` docker-compose.yml ` .
43+
44+ If you map a video device _ other_ than ` /dev/video0 ` , you will additionally need to set an
45+ environment variable for ` CAMERA_DEV ` to match the mapped device mapping.
46+
47+ See [ container environment based configs] ( #container-environment-based-configs ) for a full
48+ list of webcam configuration options configured with docker.
49+
50+ #### Webcam Setup in OctoPrint
2651
2752Use the following values in the webcam & timelapse settings screen of the initial setup:
2853
@@ -32,7 +57,7 @@ Use the following values in the webcam & timelapse settings screen of the initia
3257| Snapshot URL | ` http://localhost:8080/?action=snapshot ` |
3358| Path to FFMPEG | ` /usr/bin/ffmpeg ` |
3459
35- ### Container Environment based configs
60+ #### Container Environment based configs
3661
3762There are configuration values that you pass using container ` --environment ` options.
3863Listed below are the options and their defaults. These are implicit in example [ docker-compose.yml] ( docker-compose.yml ) ,
@@ -41,10 +66,11 @@ and if you wish to change them, refer to the docker-compose docs on setting envi
4166| variable | default |
4267| -------- | ------- |
4368| ` CAMERA_DEV ` | ` /dev/video0 ` (see [ note] ( #devices_note ) ) |
44- | ` MJPEG_STREAMER_INPUT ` | ` -y -n -r 640x48 ` |
69+ | ` MJPG_STREAMER_INPUT ` | ` -y -n -r 640x48 ` |
70+ | ` ENABLE_MJPG_STREAMER ` | ` false ` |
4571
4672** note:** You will still need to declare the ` device ` mapping in your docker-compose file or docker command,
47- even if you explicitly declare the ` CAMERA_DEV ` . The value of ` CAMERA_DEV ` is used in starting the mjpeg -streamer
73+ even if you explicitly declare the ` CAMERA_DEV ` . The value of ` CAMERA_DEV ` is used in starting the mjpg -streamer
4874service, whereas the ` devices ` mapping is used by docker to make sure the container has access to the device.
4975
5076For example, if you change the ` CAMERA_DEV ` to be ` /dev/video1 ` , you would also need to map ` /dev/video1:/dev/video1 `
@@ -84,8 +110,7 @@ on the host, and then start your container:
84110
85111```
86112docker volume create octoprint
87- docker run -d -v octoprint:/octoprint --device /dev/ttyACM0:/dev/ttyACM0 --device /dev/video0:/dev/video0 -p 80:80 --name octoprint octoprint/octoprint
88-
113+ docker run -d -v octoprint:/octoprint --device /dev/ttyACM0:/dev/ttyACM0 --device /dev/video0:/dev/video0 -e ENABLE_MJPG_STREAMER=true -p 80:80 --name octoprint octoprint/octoprint
89114```
90115
91116[ code-server ] : https://github.com/cdr/code-server
0 commit comments