Embed MediaMTX (WebRTC live view + recording) in kernelModuleEmbedVideo #28
Closed
ClaudeAI
wants to merge 0 commits from feature/embed-video-webrtc into master
Loading…
Reference in new issue
There is no content yet.
Delete Branch 'feature/embed-video-webrtc'
Deleting a branch is permanent. It CANNOT be undone. Continue?
Summary
Brings the MediaMTX functionality into la_mojo itself:
kernelModuleEmbedVideonow serves the WebRTC live view and records video, so the externalmediamtxservice is no longer needed. Includes the standalone C++ MediaMtx project fromfeature/mediamtx-cpp.Live view and recording
kernelModuleEmbedVideohosts a WHEP server (:8889/stream_<node>/whep, same URLs as MediaMTX, so the dashboard works unchanged) and one media path per camera stream, with fMP4 segment recording.module_eve.live_modeselects what is streamed:streamLiveEncoder)live_*columns, optional, with defaults).lib/data/media/mtx(codecs, stream, HTTP, recorder, WebRTC server).Projects/MediaMtxbuilds against it as a standalone replacement.kernelHelperMediaMTXstops the externalmediamtx.serviceand keeps indexing recorded segments.Embed video fixes
module_everow changes. Before, this check was unreachable, and a reload stopped the streams without restarting them.cv::putText.Alarm clips: video recorded only once
live_modeon andlive_record = 1), alarm clips come from the recorder's fMP4 segments, and the old encoder is not started.<scratch>/stream_<node>. Left-overs from a crash are deleted at start-up, and stopping the recording deletes everything. Reports/History gets H264.mp4clips, which Mojo_Web already plays. The event is bound to its segment with the frame offset.live_record = 0, the old encoder makes the clips as before.VIDEO_SEGMENT_INFOinEVT_CAPTURE_DONEis now a heap copy that the receiver (mojoKernel) deletes. Before, it was amemcpyof a struct withstd::vectormembers, and the copy leaked.m_mEncodedProtector: it was unlocked every frame without being locked.Build and DB
makefileandla_mojo.vpjget the new sources and-ldatachannel(all configs except LRF_Proxy_ONLY).Distro/database/db_tools.phpcreates thelive_*columns on fresh installs. Existing databases are upgraded by Mojo_Weblib/upgrade_database.php(companion PR in Mojo_Web, branchfeature/eve-live-columns).Testing
CFG=Debug86against libdatachannel and live555.videos/events_2_videosrows. Segments without an alarm are deleted about 7 s after they close; after a graceful stop (SIGTERM) /dev/shm/argus/video_scratch is empty, and left-overs of a killed run are deleted at the next start. Withlive_record = 0the old encoder path still delivers its clip. la_mojo stops cleanly.Notes
kernelModuleEmbedVideo.handserverConf.hchanged layout, and the makefile does not track header dependencies: do a clean rebuild (make -B).Generated with Claude Code
https://claude.ai/code/session_0139veDo3XyavMuVhdnHcN16