@@ -7,6 +7,16 @@ same out of the box features as the octopi raspberry-pi machine image, using doc
7
7
8
8
- ` latest ` , ` 1.4.2 ` , ` 1.4 ` , ` 1 ` ([ Dockerfile] ( Dockerfile ) )
9
9
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
+
10
20
## Usage
11
21
12
22
We recommend you use docker-compose to run octoprint via docker, and have included
@@ -22,7 +32,22 @@ launch of OctoPrint using docker.
22
32
23
33
### Configuration
24
34
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
26
51
27
52
Use the following values in the webcam & timelapse settings screen of the initial setup:
28
53
@@ -32,7 +57,7 @@ Use the following values in the webcam & timelapse settings screen of the initia
32
57
| Snapshot URL | ` http://localhost:8080/?action=snapshot ` |
33
58
| Path to FFMPEG | ` /usr/bin/ffmpeg ` |
34
59
35
- ### Container Environment based configs
60
+ #### Container Environment based configs
36
61
37
62
There are configuration values that you pass using container ` --environment ` options.
38
63
Listed 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
41
66
| variable | default |
42
67
| -------- | ------- |
43
68
| ` 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 ` |
45
71
46
72
** 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
48
74
service, whereas the ` devices ` mapping is used by docker to make sure the container has access to the device.
49
75
50
76
For 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:
84
110
85
111
```
86
112
docker 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
89
114
```
90
115
91
116
[ code-server ] : https://github.com/cdr/code-server
0 commit comments