fix: for Homebase 3 & S3 Pro cameras#16
Conversation
Update getNALTypeName() to use accurate H.264/AVC NAL unit type names: - Type 1: "Non-IDR Slice" (was incorrectly "P-slice") - Type 2-4: Data Partition A/B/C (was missing) - Type 5: "IDR Slice" (was "IDR-slice") - Type 14: "Prefix NAL" (was incorrectly "Data Partitioning") - Added missing types: 0, 10-13, 15, 19, 20 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Fix SPS/PPS caching to store only individual NAL units instead of entire buffers, preventing "missing picture in access unit" errors - Add -err_detect ignore_err to FFmpeg to tolerate non-fatal H.264 parsing errors (e.g., oversized SEI payloads) - Add keyframe interval tracking to help diagnose prebuffer sync issues 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Increase FFmpeg analyzeduration/probesize from 5s to 15s to handle slow keyframe intervals (Eufy cameras can have 9+ second intervals) - Add +genpts fflags for proper timestamp generation - Cache last IDR keyframe and send to new clients immediately - This prevents "Unable to find sync frame in rtsp prebuffer" errors - Remove duplicate client connect/disconnect log messages 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
The stream-service FFmpeg config was updated to use 15000000 (15s) for analyzeduration and probesize to handle Eufy battery cameras with long keyframe intervals, but the unit test was still asserting the old 5000000 value. Update the test expectations to match. Co-Authored-By: Paperclip <noreply@paperclip.ing>
PR Review: fix for Homebase 3 & S3 Pro camerasThanks for the detailed PR, @nguyening! The fixes here are genuinely useful and address real issues with battery-powered cameras. Here's a thorough review: What works well✅ NAL type name corrections ( ✅ SPS/PPS caching fix ( ✅ Cached IDR keyframe for new clients — Sending SPS + PPS + last IDR to new clients is the right approach for cameras with slow keyframe intervals. The order (SPS → PPS → IDR) is correct for decoder initialization. ✅ Keyframe interval diagnostics — The ✅ Issues blocking merge❌ Merge conflicts — PR needs rebase onto current ❌ const inputFormat = FFmpegUtils.toFFmpegFormat(eufyCodec); // "h264" or "hevc"The PR replaces this with a hardcoded ❌ H.265 SPS/PPS caching has the same bug but is not addressed ❌ IDR keyframe caching is H.264-only (type 5) Minor concerns
Suggested next steps
The core ideas here are solid and worth integrating. Happy to collaborate on a rebased version that covers H.265 too. |
|
Closing as stale - the stream handling improvements from this PR are already incorporated in main via the audio stream PR (#21) and other fixes. The main branch now includes:
If specific issues remain with S330 cameras, please open a new issue with fresh logs. |
I have a Homebase 3 and a few S3 Pro cameras which have not been working particularly well with the native Eufy <> Homekit bridge. With this Scrypted plugin, I'm able to take snapshots from these cameras but streams didn't seem to work until I fixed the NAL type names & bumped the analysis time.
I'm happy to adjust the branch if this is desirable on the mainline, but I'm mainly putting this out there to help others with these battery-powered cameras.