| name | build-run |
| description | Build, run, and configure rtp2httpd locally. Use this skill whenever the user wants to compile the project, start the daemon, pass command-line arguments, edit configuration, or troubleshoot build/runtime issues. Also activate when the user mentions cmake, build directory, rtp2httpd.conf, web-ui build, pnpm run, vite build, embedded_web_data.h, or asks how to test the service locally.
|
Building and Running rtp2httpd
rtp2httpd is a C daemon (CMake build system) that converts RTP multicast / RTSP / HTTP streams
to HTTP unicast. This skill covers local development builds — not OpenWrt cross-compilation.
Build
Always prefer production builds unless the user explicitly asks for debug.
pnpm run web-ui:build
pnpm run web-ui:build:debug
cmake -B build -DCMAKE_BUILD_TYPE=Release -DENABLE_AGGRESSIVE_OPT=ON
cmake --build build -j$(getconf _NPROCESSORS_ONLN)
The binary lands at build/rtp2httpd. Skip step 1 when only C code changed — the generated
embedded_web_data.h is committed so Node.js is not required for C-only builds.
CMake options
| Option | Default | Purpose |
|---|
CMAKE_BUILD_TYPE | Release | Debug / Release / RelWithDebInfo |
ENABLE_AGGRESSIVE_OPT | OFF | LTO, fast-math, loop unrolling |
Run
./build/rtp2httpd -C -v -v -v -v -l 8080
./build/rtp2httpd -c rtp2httpd.conf
./build/rtp2httpd -c rtp2httpd.conf -l 5140 -m 20 -v -v
Commonly used CLI flags
| Flag | Short | Purpose |
|---|
--noconfig | -C | Skip default config file |
--config <file> | -c | Use specific config file |
--listen [addr:]port | -l | Bind address/port (default ANY:5140) |
--verbose | -v | Increase verbosity (stack up to 4 times) |
--maxclients <n> | -m | Max simultaneous clients (default 5) |
--help | -h | Show all available options |
Run ./build/rtp2httpd --help for the complete flag list.
Configuration
The config file is INI-style with three sections: [global], [bind], [services].
- Reference config:
rtp2httpd.conf in the project root — all options are documented with comments
- Full docs:
docs/reference/configuration.md
When both CLI flags and config file settings are present, CLI flags take precedence.
Quick config example
[global]
verbosity = 3
[bind]
* 5140
[services]
rtp://239.253.64.120:5140
rtsp://10.0.0.50:554/live
http://upstream.example.com/stream
URL formats
Constructing correct URLs is critical when testing rtp2httpd. The path prefix determines the
protocol handler — getting it wrong gives a 404 or unexpected behavior.
| Type | URL pattern | Example |
|---|
| RTP multicast | /rtp/<mcast_ip>:<port>[?fcc=...&fec=...] | /rtp/239.253.64.120:5140 |
| RTSP proxy | /rtsp/<rtsp_host>:<port>/<path>[?playseek=...] | /rtsp/iptv.example.com:554/channel1 |
| HTTP proxy | /http/<upstream_host>[:<port>]/<path>[?params] | /http/upstream.example.com:8080/live/stream.m3u8 |
| Playlist | /playlist.m3u | /playlist.m3u |
For the full URL reference with all query parameters (fcc, fec, playseek, tvdr, r2h-ifname,
r2h-token, r2h-seek-name, r2h-seek-offset, etc.), read docs/guide/url-formats.md.
Verify it works
curl http://127.0.0.1:5140/status
curl http://127.0.0.1:5140/playlist.m3u
curl http://127.0.0.1:5140/rtp/239.253.64.120:5140 --max-time 3 -o /dev/null -w "%{http_code}"
Troubleshooting
- Port in use: change
-l port or kill the old process