Skip to content

Commit 1fde6c7

Browse files
committed
fix formatting issues
Signed-off-by: Phill Kelley <[email protected]>
1 parent fbbd77f commit 1fde6c7

File tree

1 file changed

+41
-40
lines changed

1 file changed

+41
-40
lines changed

docs/Containers/MJPEG-Streamer.md

Lines changed: 41 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ If you have a Raspberry Pi Ribbon Camera, prepare your system like this:
3535
``` console
3636
$ grep "VERSION_CODENAME" /etc/os-release
3737
```
38-
38+
3939
The answer should be one of "buster", "bullseye" or "bookworm".
4040

4141
2. Configure camera support:
@@ -45,7 +45,7 @@ If you have a Raspberry Pi Ribbon Camera, prepare your system like this:
4545
``` console
4646
$ sudo raspi-config nonint do_camera 0
4747
```
48-
48+
4949
Buster pre-dates *LibCamera* so this is the same as enabling the *legacy* camera system. In this context, `0` means "enable" and `1' means "disable".
5050

5151
* if your system is running Bullseye or Bookworm, run these commands:
@@ -54,17 +54,17 @@ If you have a Raspberry Pi Ribbon Camera, prepare your system like this:
5454
$ sudo raspi-config nonint do_camera 1
5555
$ sudo raspi-config nonint do_legacy 0
5656
```
57-
57+
5858
The first command is protective and turns off the *LibCamera* subsystem, while the second command enables the *legacy* camera system.
59-
59+
6060
> When executed from the command line, both the `do_camera` and `do_legacy` commands are supported in the Bookworm version of `raspi-config`. However, neither command is available when `raspi-config` is invoked as a GUI in a Bookworm system. This likely implies that the commands have been deprecated and will be removed, in which case this documentation will break.
6161

6262
3. Reboot your system:
6363

6464
``` console
6565
$ sudo reboot
6666
```
67-
67+
6868
4. Make a note that your ribbon camera will be accessible on `/dev/video0`.
6969

7070
## Third-party cameras
@@ -77,20 +77,20 @@ The simplest approach is:
7777
``` console
7878
$ ls -l /dev/v4l/by-id
7979
```
80-
80+
8181
This is an example of the response with a LogiTech "C920 PRO FHD Webcam 1080P" camera connected:
82-
82+
8383
```
8484
lrwxrwxrwx 1 root root 12 Oct 23 15:42 usb-046d_HD_Pro_Webcam_C920-video-index0 -> ../../video1
85-
lrwxrwxrwx 1 root root 12 Oct 23 15:42 usb-046d_HD_Pro_Webcam_C920-video-index1 -> ../../video2
85+
lrwxrwxrwx 1 root root 12 Oct 23 15:42 usb-046d_HD_Pro_Webcam_C920-video-index1 -> ../../video2
8686
```
87-
87+
8888
In general, the device at `index0` is where your camera will be accessible, as in:
89-
89+
9090
```
9191
/dev/v4l/by-id/usb-046d_HD_Pro_Webcam_C920-video-index0
9292
```
93-
93+
9494
If you don't get a sensible response to the `ls` command then try disconnecting and reconnecting your camera, and rebooting your system.
9595

9696
## Container variables
@@ -130,41 +130,41 @@ To initialise your environment, begin by using a text editor (eg `vim`, `nano`)
130130
3. Define the **external** device path to your camera. Two examples have been given above:
131131

132132
* a ribbon camera:
133-
133+
134134
```
135135
MJPG_STREAMER_EXTERNAL_DEVICE=/dev/video0
136136
```
137-
137+
138138
* a Logitech C920 USB camera:
139-
139+
140140
```
141141
MJPG_STREAMER_EXTERNAL_DEVICE=/dev/v4l/by-id/usb-046d_HD_Pro_Webcam_C920-video-index
142142
```
143143

144144
4. If you know your camera supports higher resolutions, you can also set the size. Examples:
145145

146146
* the ribbon camera can support:
147-
147+
148148
```
149149
MJPG_STREAMER_SIZE=1152x648
150150
```
151-
151+
152152
* the Logitech C920 can support:
153-
153+
154154
```
155155
MJPG_STREAMER_SIZE=1920x1080
156156
```
157-
157+
158158
5. If the `mjpg-streamer` and `motioneye` containers are going to be running on:
159159

160160
* the **same** host, you can consider increasing the frame rate:
161-
161+
162162
```
163163
MJPG_STREAMER_FPS=30
164164
```
165-
165+
166166
Even though we are setting up a *web* camera, the traffic will never leave the host and will not traverse your Ethernet or WiFi networks.
167-
167+
168168
* **different** hosts, you should probably leave the rate at 5 frames per second until you understand the impact on network traffic.
169169

170170
6. Save your work.
@@ -227,19 +227,19 @@ Error response from daemon: error gathering device information while adding cust
227227
$ cd ~/IOTstack
228228
$ docker-compose up -d mjpg-streamer
229229
```
230-
230+
231231
The first time you do this triggers a fairly long process. First, a basic operating system image is downloaded from DockerHub, then a Dockerfile is run to add the streamer software and construct a local image, after which the local image is instantiated as your running container. Subsequent launches use the local image so the container starts immediately. See also [container maintenance](#maintenance).
232-
232+
233233
2. Once the container is running, make sure it is behaving normally and has not gone into a restart loop:
234234

235235
``` console
236236
$ docker ps -a --format "table {{.Names}}\t{{.RunningFor}}\t{{.Status}}"
237237
```
238-
238+
239239
> The `docker ps` command produces a lot of output which generally results in line-wrapping and can be hard to read. The `--format` argument reduces this clutter by focusing on the interesting columns. If you have [IOTstackAliases](https://github.com/Paraphraser/IOTstackAliases) installed, you can use `DPS` instead of copy/pasting the above command.
240-
240+
241241
If the container is restarting, you will see evidence of that in the STATUS column. If that happens, re-check the values set in the `.env` file and "up" the container again. The container's log (see below) may also be helpful.
242-
242+
243243
3. Check the container's log:
244244

245245
``` console
@@ -255,11 +255,11 @@ Error response from daemon: error gathering device information while adding cust
255255
o: username:password....: streamer:oNfDG-d1kgzC
256256
o: commands.............: enabled
257257
```
258-
258+
259259
Many of the values you set earlier using environment variables show up here so viewing the log is a good way of making sure everything is being passed to the container.
260-
260+
261261
Note:
262-
262+
263263
* The `/dev/video0` in the first line of output is the **internal** device path (inside the container). This is **not** the same as the **external** device path associated with `MJPG_STREAMER_EXTERNAL_DEVICE`. The container doesn't know about the **external** device path so it has no way to display it.
264264

265265
## Connecting the camera to MotionEye
@@ -272,29 +272,29 @@ Error response from daemon: error gathering device information while adding cust
272272
5. If the `motioneye` and `mjpg-streamer` containers are running on:
273273

274274
* the **same** host, the URL should be:
275-
275+
276276
```
277277
http://mjpg-streamer:80/?action=stream
278278
```
279-
279+
280280
Here:
281-
281+
282282
- `mjpg-streamer` is the name of the **container**. Technically, it is a **host** name (rather than a domain name); and
283283
- port 80 is the **internal** port that the streamer process running inside the container is listening to. It comes from the *right* hand side of the port mapping in the service definition:
284-
284+
285285
``` yaml
286286
ports:
287287
- "8980:80"
288-
```
289-
288+
```
289+
290290
* **different** hosts, the URL should be in this form:
291-
291+
292292
```
293293
http://«name-or-ip»:8980/?action=stream
294294
```
295-
295+
296296
Here:
297-
297+
298298
- `«name-or-ip»` is the domain name or IP address of the host on which the `mjpg-streamer` container is running. Examples:
299299

300300
```
@@ -304,11 +304,12 @@ Error response from daemon: error gathering device information while adding cust
304304
```
305305

306306
- port 8980 is the **external** port that the host where the `mjpg-streamer` container is running is listening on behalf of the container. It comes from the *left* hand side of the port mapping in the service definition:
307-
307+
308308
``` yaml
309309
ports:
310310
- "8980:80"
311-
```
311+
```
312+
312313
6. Enter the Username ("streamer" in this example).
313314
7. Enter the Password ("oNfDG-d1kgzC" in this example).
314315
8. Click in the Username field again. This causes MotionEye to retry the connection, after which the camera should appear in the Camera field.

0 commit comments

Comments
 (0)