BIG docs refactoring

This commit is contained in:
Alex X
2026-02-06 20:43:50 +03:00
parent 5bf5327a45
commit d01b99d105
67 changed files with 2104 additions and 1916 deletions
+39 -11
View File
@@ -1,13 +1,19 @@
# MJPEG
# Motion JPEG
- This module can provide and receive streams in MJPEG format.
- This module is also responsible for receiving snapshots in JPEG format.
- This module also supports streaming to the server console (terminal) in the **animated ASCII art** format.
## MJPEG Client
**Important.** For a stream in MJPEG format, your source MUST contain the MJPEG codec. If your stream has the MJPEG codec, you can receive an **MJPEG stream** or **JPEG snapshots** via the API.
You can receive an MJPEG stream in several ways:
- some cameras support MJPEG codec inside [RTSP stream](#source-rtsp) (ex. second stream for Dahua cameras)
- some cameras have an HTTP link with [MJPEG stream](#source-http)
- some cameras have an HTTP link with snapshots - go2rtc can convert them to [MJPEG stream](#source-http)
- you can convert an H264/H265 stream from your camera via [FFmpeg integration](#source-ffmpeg)
- some cameras support MJPEG codec inside [RTSP stream](../rtsp/README.md) (ex. second stream for Dahua cameras)
- some cameras have an HTTP link with [MJPEG stream](../http/README.md)
- some cameras have an HTTP link with snapshots - go2rtc can convert them to [MJPEG stream](../http/README.md)
- you can convert an H264/H265 stream from your camera via [FFmpeg integration](../ffmpeg/README.md)
With this example, your stream will have both H264 and MJPEG codecs:
@@ -18,18 +24,22 @@ streams:
- ffmpeg:camera1#video=mjpeg
```
## API examples
## MJPEG Server
**MJPEG stream**
### mpjpeg
Output a stream in [MJPEG](https://en.wikipedia.org/wiki/Motion_JPEG) format. In [FFmpeg](https://ffmpeg.org/), this format is called `mpjpeg` because it contains HTTP headers.
```
http://192.168.1.123:1984/api/stream.mjpeg?src=camera1
ffplay http://192.168.1.123:1984/api/stream.mjpeg?src=camera1
```
**JPEG snapshots**
### jpeg
Receiving a JPEG snapshot.
```
http://192.168.1.123:1984/api/frame.jpeg?src=camera1
curl http://192.168.1.123:1984/api/frame.jpeg?src=camera1
```
- You can use `width`/`w` and/or `height`/`h` parameters.
@@ -40,10 +50,14 @@ http://192.168.1.123:1984/api/frame.jpeg?src=camera1
- A cached snapshot will be used if its time is not older than the time specified in the `cache` parameter.
- The `cache` parameter does not check the image dimensions from the cache and those specified in the query.
## Stream as ASCII to Terminal
### ascii
Stream as ASCII to Terminal. This format is just for fun. You can boast to your friends that you can stream cameras even to the server console without a GUI.
[![](https://img.youtube.com/vi/sHj_3h_sX7M/mqdefault.jpg)](https://www.youtube.com/watch?v=sHj_3h_sX7M)
> The demo video features a combination of several settings for this format with added audio. Of course, the format doesn't support audio out of the box.
**Tips**
- this feature works only with MJPEG codec (use transcoding)
@@ -78,3 +92,17 @@ streams:
% curl "http://192.168.1.123:1984/api/stream.ascii?src=gamazda&back=8&text=%20%20"
% curl "http://192.168.1.123:1984/api/stream.ascii?src=gamazda&text=helloworld"
```
### yuv4mpegpipe
Raw [YUV](https://en.wikipedia.org/wiki/Y%E2%80%B2UV) frame stream with [YUV4MPEG](https://manned.org/yuv4mpeg) header.
```
ffplay http://192.168.1.123:1984/api/stream.y4m?src=camera1
```
## Streaming ingest
```shell
ffmpeg -re -i BigBuckBunny.mp4 -c mjpeg -f mpjpeg http://localhost:1984/api/stream.mjpeg?dst=camera1
```