Earlier edits rewrote these files with LF endings, which made the diff
show every line as changed. Content is unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0139veDo3XyavMuVhdnHcN16
Add lib/data/media/mtx sources/headers and streamLiveEncoder to the
SlickEdit project and link -ldatachannel in all configs except
LRF_Proxy_ONLY (same as the makefile).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0139veDo3XyavMuVhdnHcN16
- Move reusable MediaMtx code (logger, codecs, stream, httpp, recorder,
webrtc server) to lib/data/media/mtx; add ServerConf, MediaPath/
PathProvider and H264Feeder. Standalone Projects/MediaMtx builds against it.
- kernelModuleEmbedVideo hosts a WHEP server (:8889/stream_<node>/whep)
and one MediaPath per camera stream with fMP4 segment recording.
- streamHandler feeds each path either with camera H264 passthrough
(videoAVLIBSource / videoLive555AVLibSource forward encoded NALs) or
with re-encoded processed frames incl. overlays (streamLiveEncoder),
selected by module_eve.live_mode (optional columns, defaults apply).
- kernelHelperMediaMTX: external mediamtx.service is stopped, segment
indexing of the scratch folder is kept.
- live555 watch variable type deduced so old and new live555 build.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0139veDo3XyavMuVhdnHcN16
The control API now uses the JsonCpp 1.8.4 of dr_frucht (lib/include/json,
lib/data/json), which the makefile compiles in, like la_mojo does.
nlohmann/json is no longer needed; the README also no longer lists it as a
libdatachannel dependency (it is only used by libdatachannel's examples).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0139veDo3XyavMuVhdnHcN16
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
watchDogDaemon (kernel.cpp)
- Client lines are assembled in a buffer. readLine() on the non-blocking
socket dropped the bytes of a line that had only partly arrived.
- EOF (client closed or crashed without "-1") ends the monitoring of that
client. Before, EOF read as "no data", and after the deadline kill(9) went
to a PID that may belong to another process by then.
- The handler record is zeroed. "finished" was uninitialized (malloc), so
the accept loop could pthread_join() a live handler and block.
- Finished handlers are joined, freed and erased correctly. erase()
inside the for loop skipped the next one, and the records were never
freed. A record whose thread could not be created is freed.
pthread_create() returns an error number, not -1.
- The bind() result is checked.
- The log says which PID is watched or stopped, and for a stall how long
ago the last update was ("WD update STALLED! (PID n, last update N ms
ago)").
kernelPrototype
- Sends getpid() as the PID to kill (was gettid(): the same value only in
the main thread).
Tested with the rebuilt daemon: the kernel scenarios as before (normal,
6 s step: not killed; hang: killed). A client that closes without "-1":
its process isn't killed later. An update split into 3 pieces, 6 times
with a 4 s deadline: understood, not killed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0139veDo3XyavMuVhdnHcN16
Standalone example of the Darknet C++ API (hank-ai Darknet/YOLO V3+):
load a network (cfg / names / weights), set the detection and NMS
thresholds, run Darknet::predict() on OpenCV frames, print the
detections (class, confidence, box) and draw them with
Darknet::annotate().
- Input: an image (annotated copy saved as <name>_output.jpg), a video
file or a camera index (shown in a window; without a display the
result is written to output.avi).
- Build: make (g++ -std=c++17 ... opencv4 ... -ldarknet); README covers
build, model files, usage and how it works.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0139veDo3XyavMuVhdnHcN16
- kernelEventFilterYOLO.h:
* Darknet V3+ (hank-ai) declares load_network(), load_network_custom()
and free_network_ptr() only when DARKNET_INCLUDE_ORIGINAL_API is
defined before darknet.h ("was not declared in this scope"): define it.
* Darknet installs the header as <prefix>/include/darknet.h, not
darknet/darknet.h: include <darknet.h>, fall back to
<darknet/darknet.h>, clear #error if neither exists.
* m_pNET was DarknetNetworkPtr * (void **) although DarknetNetworkPtr is
already void *: "invalid conversion from void* to void**".
- makefile / la_mojo.vpj: -ldarknet was only linked in Release86; the
build script uses Debug86. Added to Debug86 and Debug (the .vpj too,
so a SlickEdit regeneration keeps it).
- kernelEventFilterYOLO::initFilter(): load the settings first
(validate()); m_sYOLOFilterData was still zero, so fileExist("") made
initFilter() always fail. Logs why it fails, frees a previously loaded
network, logs the network dimensions. Destructor stops the thread
before freeing the network.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0139veDo3XyavMuVhdnHcN16