Configure HKSV acceleration per camera and forward RTP limits#257
Conversation
|
instead of implementing an automatic software fallback, we should look into why these hksv errors happen in the first place and fix them. we shouldn't add an automatic software fallback here, instead we could solve it through the camera settings schema with a flag... are you running into hksv errors yourself? |
|
Thanks for the feedback. Yes, I am seeing this on a TP-Link Tapo D235. Its main RTSP stream is HEVC, while my other cameras provide H.264. In production I observed 734 HKSV recording starts and 571 I agree that silently switching decoding modes is not appropriate. I have removed the automatic software fallback and the plugin-specific Go2RTC source selection. Instead, the branch now adds an explicit per-camera The per-camera failure isolation remains: after repeated Separately, I found a concrete live-stream issue: HomeKit negotiated 1280x720 at 299 kbit/s, but the negotiated height and bitrate were not forwarded to node-av. That produced 2,372 reported lost RTP packets in about 11 seconds. I split that correction into the corresponding SDK/core changes rather than solving it with a Go2RTC workaround. |
|
The RTP bitrate option used by this branch is exposed in cameraui/sdk#37 and applied by cameraui/camera.ui#519. |
|
yeah that direction is much better, though i'm not too happy with implementing a report function and restarting the fmp4 session... there seems to be a bug here where resources aren't being released on the FMP4Session and/or node-av side, which i want to look into first and it would be important to understand what your camera produces for hksv would it be possible to record the stream with ffmpeg, and maybe also what the data looks like after FMP4Session |
|
Thanks — I was able to capture both the raw D235 stream and the output produced through The D235 source is HEVC Main, 2560x1920 at 20 fps with mono PCMA at 8 kHz. The raw RTSP capture also reports unset packet timestamps. When decoding the HEVC source, node-av/FFmpeg repeatedly logs: More importantly, I found why HomeKit receives the suspiciously small fragments. Depending on the stream path, node-av delivers This exactly matches the production behavior: The 804–824 byte values correspond to standalone I implemented a generic core fix that assembles split https://github.com/JxnLexn/camera.ui/tree/dev/fix/fmp4-split-box-assembly It includes regression tests for combined fragments, split fragments, orphaned boxes, and incomplete-fragment replacement. I also removed |
|
The generic core fix is now available as cameraui/camera.ui#521. That PR assembles split As noted above, I removed |
|
if we pass the height as well, streams with an aspect ratio of e.g. 8:3 get forced into a 16:9 aspect ratio and look "stretched" |
Summary
Use Hardware Acceleration for HKSVsettingScope
The automatic software fallback, HomeKit-specific Go2RTC source selection, failure-report function, and automatic FMP4 session restart have been removed following review. This PR no longer attempts to recover HKSV by restarting recording sessions.
The underlying split-fragment issue discovered during the investigation is fixed generically in cameraui/camera.ui#521.
The RTP bitrate option used here is exposed by cameraui/sdk#37 and applied by cameraui/camera.ui#519.