Repository navigation
Log capture encoder progress every 5 s (logging only) - #149
Merged
Merged
Conversation
Condense the capture ffmpeg's existing -progress pipe:2 blocks (already drained by the stderr thread) into one qorcap.log line at most every 5 s: encoder progress: frame=1234 fps=59.94 speed=0.998x dup=3 drop=1 Fields missing or unparsable in ffmpeg's output are omitted. ffmpeg argv, recording, manifest, checkpoint, seal, live tap, receipt.v0 and contracts/ are unchanged. No new dependencies.
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.
What
Every 5 s while the capture ffmpeg runs, QorCap now writes one
infoline to qorcap.log:The last block of a session (
progress=end) is always logged and gets(end)at the end of the line. A field that is missing from ffmpeg's output or doesn't parse is left out. Nothing is made up.Why
Practice match 201238 dropped about 7.7 s of frames: 4,472 "frame dropped" warnings, with the Elgato buffer at 100% from 8:13:14 PM CST. Right now the log can't tell us whether the encoder fell behind (fps and speed drop) or the capture thread stalled (fps and speed hold steady while frames drop). This line answers that.
Where the data comes from
-stats_period 1 -progress pipe:2(src/ffmpeg.rs). Its stderr is already drained by its own thread inrun_capture_once(src/engine.rs). That thread already readsframe,fps,dup_framesanddrop_framesinto/status.ProgressLog(src/encprog.rs) on that same thread. It takes the same key=value pairs and returns at most one line every 5 s. It reads time from a thread-localInstant.-statsline (frame= 1234 fps= 30 ... speed=1.00x) ever reaches this thread, it's parsed too. With-loglevel warningffmpeg doesn't print those lines.Tests
encprog:-statslines are parsedcargo build --locked✅cargo build --release --locked✅QORTIME=<qortime 0204 pin> cargo test --locked: lib 202 (base 196, +6), main 1, contracts 2, haptic_replay 1, redteam 2 ✅cargo clippy --all-targets --locked: 46 warning lines, the same as base 506a3bc, and none in the new code.Scope
Logging only, no behavior change. receipt.v0,
contracts/,schema/, the recording/manifest/checkpoint/seal path and the live tap are untouched. REAL MATCH behaves the same apart from the extra log line.Draft. Merge only on Con's word.