Add disk management, SD card replay/download, and alarm search#396
Open
lorek123 wants to merge 7 commits intoQuantumEntangledAndy:masterfrom
Open
Add disk management, SD card replay/download, and alarm search#396lorek123 wants to merge 7 commits intoQuantumEntangledAndy:masterfrom
lorek123 wants to merge 7 commits intoQuantumEntangledAndy:masterfrom
Conversation
- Add MSG_ID_HDD_INFO_LIST (102) and MSG_ID_HDD_INIT_LIST (103) in bc/model - Add HddInfoList, HddInfo, FormatExpandCfg, HddInitList, HddInit XML types - Add bc_protocol/disk.rs: get_hdd_list(), format_disk(init_ids, full_format) - Add disk subcommand: 'neolink disk [list]' and 'neolink disk format --disk N [--full]' - Default subcommand is list when omitted - Fix UnintelligibleReply/UnintelligibleXml display and unused_assignments warnings - Fix BcSubscription and MqttReplyRef lifetime elision warnings
Implement SD card replay and download for E1/E320 cameras: - New `replay` subcommand with search, list, download, and play modes - BC protocol replay flow (MSG 5/7/8/13-16/123) with BcMedia stream parsing - GStreamer-based MP4 muxing with per-frame PTS for variable frame rate - Fix E1 decryption: always read payload_offset for v2 protocol packets - Fix over-decryption: only decrypt [encryptPos, encryptPos+encryptLen) - Enhanced Wireshark dissector with replay message types and encryption fields - BcMedia format documentation (BCMEDIA_REPLAY_FORMAT.md) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The camera's recordType field carries AI detection labels (people, vehicle, face, dog_cat, package, visitor, etc.) alongside trigger types (md, sched, manual, pir). These are now embedded as MP4 tags: - GStreamer: Keywords (AI tags), Comment (full recordType), Description (start/end time), Title (camera name), Encoder (neolink replay) - ffmpeg fallback: -metadata comment and description flags - File listing: AI detections highlighted with [AI: ...] suffix Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Tag events sent via appsrc.send_event() don't reliably propagate to the muxer. Use mp4mux's TagSetter interface (set before Playing state) to write tags directly into the MP4 udta/meta atoms. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Recordings triggered only by AI detection (without md/sched) were missed because the default record_type was "manual,sched,md". Now defaults to all known types. Adds --ai-filter to `replay files` for client-side filtering by AI detection tag (e.g. --ai-filter people,vehicle,dog_cat). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Implements the findAlarmVideo protocol (MSG 175 / 0xAF) which allows searching recordings by alarm/detection type on the camera itself. Adds FindAlarmVideo and EventAlarmType XML types, alarm_video_search_start and alarm_video_search_next protocol methods, and the `alarm-search` CLI subcommand with --alarm-types filtering. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix MSG 14 regression: separate FILE_SEARCH_RECORD_TYPES (manual, sched,md,pir,io) from ALL_RECORD_TYPES. E1 cameras reject unknown AI-specific tags in file search with error 400. - Handle MSG 14 error 400 gracefully as "no files for this day" - Handle MSG 175 error 405 gracefully as "not supported" - Downgrade per-packet replay logs from info to debug - Remove E1 strip diagnostic logging from replay stream - Reduce binary progress logging from every 20 to every 200 packets - Fix file size display: show KB for files under 1MB - Remove debug eprintln! from main.rs replay dispatch Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
neolink disk <camera> listanddisk formatto inspect and format SD cardsreplay alarm-searchNew subcommands
Details
--ai-filterfor client-side filteringencryptPos/encryptLenfrom Extension XML; protocol v2 payload_offset for continuation packets (class 0x698d)FILE_SEARCH_RECORD_TYPES(manual,sched,md,pir,io) for MSG 14 — E1 cameras reject AI-specific tags in file search requestsreplay downloadinsteadbaichuan.luawith replay message ID decodingTested on
disk list,days,files,download(MP4 with H.264 + AAC) all workingalarm-searchgracefully reports "not supported"download-by-timegracefully reports "not supported" (MSG 143 not implemented on E1)Test plan
neolink disk <camera> listshows SD card infoneolink replay <camera> days --start <date>lists recording daysneolink replay <camera> files --date <date>lists files with AI tags and correct sizesneolink replay <camera> download --name <file> --output test.mp4produces playable MP4replay alarm-searchreturns results or "not supported" messagereplay download-by-timereturns clear error on cameras that don't support MSG 143