You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 MediaMtx: C++ replacement for the MediaMTX parts la_mojo uses
New project Projects/MediaMtx, in MediaMTX's module layout (internal/core, conf,
stream, staticsources/rtsp, servers/webrtc, recorder, api, ...):
- RTSP pull of the cameras with live555 (H264, TCP/UDP), reconnect after errors or
when no data arrives for --readTimeout
- WebRTC WHEP on :8889 with libdatachannel, the MediaMTX URLs
(POST /stream_N/whep, PATCH/DELETE /stream_N/whep/<id>), so the dashboard works as is
- recording as fragmented MP4 segments (no transcoding), playable in browsers,
MediaMTX file names; a fragment is flushed every --recordPartDuration
- no mediamtx.yml: command line options + a paths file (SIGHUP reload) + the
v3 paths API (add / patch / replace / delete, written back to the file)
- log lines in the MediaMTX format that kernelHelperMediaMTX parses
Tested with a GStreamer RTSP camera and Chromium (WHEP, recordings), camera
loss / reconnect, API, SIGHUP; ASan + UBSan clean.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0139veDo3XyavMuVhdnHcN16
1 day ago |
|
/*
MediaMtx (C++) - a unit of media data (MediaMTX: internal/unit) One H264 access unit (all NAL units of one picture) with its timestamps.*/#pragma once
#include <cstdint>
#include <memory>
#include <vector>
namespace mtx {
typedef std::vector<uint8_t> Bytes;
struct Unit{ int64_t pts = 0; // presentation time, 90 kHz clock, from the source's RTP timestamps (unwrapped)
int64_t ntpUs = 0; // wall clock of the unit (us since the epoch)
bool idr = false; // contains an IDR picture (random access point)
std::vector<Bytes> nalus; // NAL units without start codes
size_t byteSize() const { size_t n = 0; for (const Bytes & b : nalus) { n += b.size(); } return n; }};
typedef std::shared_ptr<const Unit> UnitPtr;
} // namespace mtx
|