Skip to content

Drain live MPEG-TS input and SRT output cleanly at event end - #41

Closed
jpietek wants to merge 4 commits into
developfrom
fix/python-packet-eof-drain
Closed

jpietek wants to merge 4 commits into
developfrom
fix/python-packet-eof-drain

Conversation

@jpietek

@jpietek jpietek commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

Live MPEG-TS input shutdown discarded packets buffered in the demuxer/parser, and FFmpeg closed live SRT publishers before the peer could deliver their final buffered messages. A 90-second reframer run received all 2,250 source frames but previously processed only 2,248.

Add an explicit InputRec request-eof operation that interrupts reads while draining valid packets and emitting the common A/V EOF. Intentional AVERROR_EXIT recovery is scoped to this operation; other errors remain failures. Expose Packet.eof() for native drain control. With positive SRT linger, the FFmpeg 9 patch drains pending sends and waits for negotiated peer delivery within the bounded close deadline; steady-state buffering is unchanged.

Validation: native connected-TCP regression exactly matches file-EOF video/audio packet hashes and timestamps. Production-image GCP transport tests preserved five byte-identical 90-second SRT captures at 200 and 100 ms without a shim. The full GCP GPU reframer at 100 ms preserved all 2,250 frames in each of three outputs, decoded cleanly, and aligned output boundaries. FFmpeg patch-series checks and close-helper regression tests passed. Evidence: gs://aiml-recorder-ai-tests/reframer-srt-e2e/reframer-nba-e2e-4d76fe0b7a/ .

@jpietek jpietek closed this Oct 12, 2026
@jpietek
jpietek deleted the fix/python-packet-eof-drain branch October 12, 2026 06:59
@jpietek
jpietek restored the fix/python-packet-eof-drain branch October 12, 2026 07:02
@jpietek
jpietek deleted the fix/python-packet-eof-drain branch October 12, 2026 09:16
@jpietek
jpietek restored the fix/python-packet-eof-drain branch October 12, 2026 09:19
@jpietek
jpietek deleted the fix/python-packet-eof-drain branch October 12, 2026 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant