Skip to content

Commit 61e83bb

Browse files
committed
chore(release): merge main into stable for v3.17.2
2 parents 60f5217 + db86825 commit 61e83bb

47 files changed

Lines changed: 13686 additions & 11309 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.agents/skills/build-run/SKILL.md‎

Lines changed: 21 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -1,123 +1,45 @@
11
---
22
name: build-run
3-
description: >
4-
Build, run, and configure rtp2httpd locally. Use this skill whenever the user wants to compile
5-
the project, start the daemon, pass command-line arguments, edit configuration, or troubleshoot
6-
build/runtime issues. Also activate when the user mentions cmake, build directory, rtp2httpd.conf,
7-
web-ui build, pnpm run, vite build, embedded_web_data.h, or asks how to test the service locally.
3+
description: Build, configure, and run rtp2httpd locally, including embedded Web UI builds and build/runtime troubleshooting. Excludes cross-compilation and deployment.
84
---
95

10-
# Building and Running rtp2httpd
6+
# Local Build and Run
117

12-
rtp2httpd is a C daemon (CMake build system) that converts RTP multicast / RTSP / HTTP streams
13-
to HTTP unicast. This skill covers local development builds — not OpenWrt cross-compilation.
8+
Run commands from the repository root. Use the toolchain conventions in [AGENTS.md](../../../AGENTS.md).
149

15-
## Build
10+
Cursor Cloud's startup setup installs locked pnpm dependencies and runs `uv sync --group dev`. Reuse that environment; repeat setup only when dependencies are missing or changed.
1611

17-
Always prefer production builds unless the user explicitly asks for debug.
12+
## Build the needed components
13+
14+
For embedded UI changes, rebuild the frontend before the C binary. C-only changes can use the committed header without Node.js. Follow `package.json` for build scripts and `CMakeLists.txt` for current options.
1815

1916
```bash
20-
# 1. If web-ui/src/ has changed, rebuild the frontend first (generates src/embedded_web_data.h)
21-
pnpm run web-ui:build # production (preferred)
22-
pnpm run web-ui:build:debug # debug: unminified, with source maps
17+
# When Web UI sources or build inputs changed:
18+
pnpm run web-ui:build
2319

24-
# 2. Configure & compile the C binary
2520
cmake -B build -DCMAKE_BUILD_TYPE=Release -DENABLE_AGGRESSIVE_OPT=ON
2621
cmake --build build -j$(getconf _NPROCESSORS_ONLN)
2722
```
2823

29-
The binary lands at `build/rtp2httpd`. Skip step 1 when only C code changed — the generated
30-
`embedded_web_data.h` is committed so Node.js is not required for C-only builds.
24+
Release is the default for normal builds. Use Debug/RelWithDebInfo or `pnpm run web-ui:build:debug` when diagnosis needs symbols or source maps. `ENABLE_AGGRESSIVE_OPT` enables LTO and fast-math and defaults to OFF in CMake; disable it when investigating optimization-sensitive behavior.
3125

32-
### CMake options
26+
The binary is `build/rtp2httpd`. The generated header follows the commit boundary in AGENTS.md.
3327

34-
| Option | Default | Purpose |
35-
|---------------------------|---------|--------------------------------------|
36-
| `CMAKE_BUILD_TYPE` | Release | Debug / Release / RelWithDebInfo |
37-
| `ENABLE_AGGRESSIVE_OPT` | OFF | LTO, fast-math, loop unrolling |
28+
## Run and configure
3829

39-
## Run
30+
Use an unused port, bind a local preview to loopback, and avoid loading a deployed configuration accidentally:
4031

4132
```bash
42-
# Minimal: no config file, verbose, listen on port 8080
43-
./build/rtp2httpd -C -v -v -v -v -l 8080
44-
45-
# With a config file
46-
./build/rtp2httpd -c rtp2httpd.conf
47-
48-
# Override specific settings via CLI
49-
./build/rtp2httpd -c rtp2httpd.conf -l 5140 -m 20 -v -v
33+
./build/rtp2httpd -C -v -v -v -v -l 127.0.0.1:8080
5034
```
5135

52-
### Commonly used CLI flags
53-
54-
| Flag | Short | Purpose |
55-
|--------------------|-------|--------------------------------------------|
56-
| `--noconfig` | `-C` | Skip default config file |
57-
| `--config <file>` | `-c` | Use specific config file |
58-
| `--listen [addr:]port` | `-l` | Bind address/port (default ANY:5140) |
59-
| `--verbose` | `-v` | Increase verbosity (stack up to 4 times) |
60-
| `--maxclients <n>` | `-m` | Max simultaneous clients (default 5) |
61-
| `--help` | `-h` | Show all available options |
62-
63-
Run `./build/rtp2httpd --help` for the complete flag list.
64-
65-
## Configuration
66-
67-
The config file is INI-style with three sections: `[global]`, `[bind]`, `[services]`.
68-
69-
- **Reference config**: `rtp2httpd.conf` in the project root — all options are documented with comments
70-
- **Full docs**: `docs/reference/configuration.md`
71-
72-
When both CLI flags and config file settings are present, CLI flags take precedence.
73-
74-
### Quick config example
75-
76-
```ini
77-
[global]
78-
verbosity = 3
79-
80-
[bind]
81-
* 5140
36+
`-C` skips the default config; `-c <file>` selects a config; `-l [addr:]port` sets the listener. For a config-based reproduction, inspect that file's listeners and upstreams first. Use `./build/rtp2httpd --help` for current flags.
8237

83-
[services]
84-
#EXTM3U
85-
#EXTINF:-1,Channel One
86-
rtp://239.253.64.120:5140
87-
#EXTINF:-1,RTSP Channel
88-
rtsp://10.0.0.50:554/live
89-
#EXTINF:-1,HTTP Channel
90-
http://upstream.example.com/stream
91-
```
92-
93-
## URL formats
94-
95-
Constructing correct URLs is critical when testing rtp2httpd. The path prefix determines the
96-
protocol handler — getting it wrong gives a 404 or unexpected behavior.
97-
98-
| Type | URL pattern | Example |
99-
|---------------|------------------------------------------------------|---------------------------------------------------------------|
100-
| RTP multicast | `/rtp/<mcast_ip>:<port>[?fcc=...&fec=...]` | `/rtp/239.253.64.120:5140` |
101-
| RTSP proxy | `/rtsp/<rtsp_host>:<port>/<path>[?playseek=...]` | `/rtsp/iptv.example.com:554/channel1` |
102-
| HTTP proxy | `/http/<upstream_host>[:<port>]/<path>[?params]` | `/http/upstream.example.com:8080/live/stream.m3u8` |
103-
| Playlist | `/playlist.m3u` | `/playlist.m3u` |
104-
105-
For the full URL reference with all query parameters (fcc, fec, playseek, tvdr, r2h-ifname,
106-
r2h-token, r2h-seek-name, r2h-seek-offset, etc.), read `docs/guide/url-formats.md`.
107-
108-
## Verify it works
109-
110-
```bash
111-
# Status page
112-
curl http://127.0.0.1:5140/status
113-
114-
# M3U playlist (if services configured)
115-
curl http://127.0.0.1:5140/playlist.m3u
116-
117-
# Stream a channel (replace with actual multicast addr)
118-
curl http://127.0.0.1:5140/rtp/239.253.64.120:5140 --max-time 3 -o /dev/null -w "%{http_code}"
119-
```
38+
- For INI settings and `[global]`, `[bind]`, `[services]` examples, read [rtp2httpd.conf](../../../rtp2httpd.conf) and the relevant section of [Configuration Reference](../../../docs/reference/configuration.md). CLI settings take precedence.
39+
- For stream paths and query parameters, read [URL Formats](../../../docs/guide/url-formats.md). The `/rtp/`, `/rtsp/`, and `/http/` prefixes choose different protocol handlers.
40+
- For player scenarios using mock upstreams, use [devlab](../../../tools/devlab/README.md).
41+
- For automated daemon behavior checks, use [e2e](../e2e/SKILL.md).
12042

121-
## Troubleshooting
43+
## Verify the requested behavior
12244

123-
- **Port in use**: change `-l` port or kill the old process
45+
`curl --fail http://127.0.0.1:8080/status` checks basic readiness. Playback, seek, or rendering work also needs the affected stream/player scenario; a status response alone does not verify it. Reuse the chosen listener port in checks, and stop the task's daemon when finished. If a port is occupied, choose another port rather than terminating an unrelated process.

0 commit comments

Comments
 (0)