Skip to content

Commit 3b31acb

Browse files
committed
consistent use of mjpg-streamer
1 parent d645c29 commit 3b31acb

File tree

6 files changed

+15
-15
lines changed

6 files changed

+15
-15
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ RUN make install
7272
# Copy services into s6 servicedir and set default ENV vars
7373
COPY root /
7474
ENV CAMERA_DEV /dev/video0
75-
ENV MJPEG_STREAMER_INPUT -y -n -r 640x480
75+
ENV MJPG_STREAMER_INPUT -y -n -r 640x480
7676
ENV PIP_USER true
7777
ENV PYTHONUSERBASE /octoprint/plugins
7878

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ launch of OctoPrint using docker.
3535
#### Enabling Webcam Support with Docker
3636

3737
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_MJPEG_STREAMER=true` in your
38+
This is done by setting the environment variable `ENABLE_MJPG_STREAMER=true` in your
3939
`docker run` command, or in the `docker-compose.yml` file.
4040

4141
You'll also need to add `--device /dev/video0:/dev/video0` to your `docker run`, or ensure
@@ -66,11 +66,11 @@ and if you wish to change them, refer to the docker-compose docs on setting envi
6666
| variable | default |
6767
| -------- | ------- |
6868
| `CAMERA_DEV` | `/dev/video0` (see [note](#devices_note)) |
69-
| `MJPEG_STREAMER_INPUT` | `-y -n -r 640x48` |
70-
| `ENABLE_MJPEG_STREAMER` | `false` |
69+
| `MJPG_STREAMER_INPUT` | `-y -n -r 640x48` |
70+
| `ENABLE_MJPG_STREAMER` | `false` |
7171

7272
**note:** You will still need to declare the `device` mapping in your docker-compose file or docker command,
73-
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
7474
service, whereas the `devices` mapping is used by docker to make sure the container has access to the device.
7575

7676
For example, if you change the `CAMERA_DEV` to be `/dev/video1`, you would also need to map `/dev/video1:/dev/video1`
@@ -110,7 +110,7 @@ on the host, and then start your container:
110110

111111
```
112112
docker volume create octoprint
113-
docker run -d -v octoprint:/octoprint --device /dev/ttyACM0:/dev/ttyACM0 --device /dev/video0:/dev/video0 -e ENABLE_MJPEG_STREAMER=true -p 80:80 --name octoprint octoprint/octoprint
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
114114
```
115115

116116
[code-server]: https://github.com/cdr/code-server

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ services:
1414
# uncomment the lines below to ensure camera streaming is enabled when
1515
# you add a video device
1616
#environment:
17-
# - ENABLE_MJPEG_STREAMER=true
17+
# - ENABLE_MJPG_STREAMER=true
1818

1919
####
2020
# uncomment if you wish to edit the configuration files of octoprint
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/usr/bin/with-contenv bash
22

3-
: "${ENABLE_MJPEG_STREAMER:=false}"
3+
: "${ENABLE_MJPG_STREAMER:=false}"
44

55
# disable mjpg-streamer service if not enabled
6-
if ! $ENABLE_MJPEG_STREAMER; then
6+
if ! $ENABLE_MJPG_STREAMER; then
77
rm -rf /etc/services.d/mjpg-streamer
88
fi

root/etc/disabled.services.d/.gitkeep

Whitespace-only changes.

root/etc/services.d/mjpg-streamer/run

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
#!/usr/bin/with-contenv sh
22

3-
if [ -n "$STREAMER_FLAGS" ]; then
4-
echo "Deprecation warning: the environment variable '\$STREAMER_FLAGS' was renamed to '\$MJPEG_STREAMER_INPUT'"
3+
if [ -n "$MJPEG_STREAMER_INPUT" ]; then
4+
echo "Deprecation warning: the environment variable '\$MJPEG_STREAMER_INPUT' was renamed to '\$MJPG_STREAMER_INPUT'"
55

6-
MJPEG_STREAMER_INPUT=$STREAMER_FLAGS
6+
MJPG_STREAMER_INPUT=$MJPEG_STREAMER_INPUT
77
fi
88

9-
if ! expr "$MJPEG_STREAMER_INPUT" : ".*\.so.*" > /dev/null; then
10-
MJPEG_STREAMER_INPUT="input_uvc.so $MJPEG_STREAMER_INPUT"
9+
if ! expr "$MJPG_STREAMER_INPUT" : ".*\.so.*" > /dev/null; then
10+
MJPG_STREAMER_INPUT="input_uvc.so $MJPG_STREAMER_INPUT"
1111
fi
1212

1313
exec mjpg_streamer \
14-
-i "/usr/local/lib/mjpg-streamer/$MJPEG_STREAMER_INPUT -d $CAMERA_DEV" \
14+
-i "/usr/local/lib/mjpg-streamer/$MJPG_STREAMER_INPUT -d $CAMERA_DEV" \
1515
-o "/usr/local/lib/mjpg-streamer/output_http.so -w /usr/local/share/mjpg-streamer/www -p 8080"

0 commit comments

Comments
 (0)