fix(video): stream canonical remux with bounded memory (#580) - #582
shobhitagnihotri69 wants to merge 1 commit into
Conversation
|
|
Closing on first-PR-wins: #581 opened 44 minutes earlier and is in review. For the record, this branch's tree is byte-identical to #581's across all four files, so there is nothing here that merging #581 would not already deliver. If that is not what you expected, say so and I will take another look. Open good first issues: https://github.com/Hebbian-Robotics/hflow/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22 |
Summary
Fixes #580. Eliminates full-video memory materialization in
Episode.video()by streaming canonical H.264 access units directly intoffmpegstdin with bounded memory.Key Changes
self.channel(topic)andb"".join(units)withself.iter_decoded_batches().estimate_fps_from_streaming_log_timesbacked by a temporary SQLite table to preserve the exact delta median without buffering millions of timestamps in memory._PictureCodingScannerto scan slice headers access-unit by access-unit during streaming.tests/test_video_streaming.pyvalidating incremental consumption, process cleanup, and error precedence.Verification
uv run pytest tests/test_video.py tests/test_video_streaming.py: 52 passed in 11.11s.uv run ruff check src tests: All checks passed.