Repository navigation
feat(engine): report a take shorter than its window - #15
Merged
Merged
Conversation
Duration lived in internal/production, which imports the engine, so the engine could not ask how long a clip is without an import cycle. It is the one question every recorder's output can be asked, so it moves beside the recorders, where both callers reach it the same way.
A recorder that stops before the scene does leaves a clip that passes every check there is: the process exits cleanly, the container is whole, the file is not empty, and the film plays at real speed with no gap in it. What is missing is the end, which is where a scene puts the thing it was made to show. The run called it a success. Backstage holds both numbers and now compares them. It clocks the recorder from warm to stop, reads the clip, and reports a clip materially shorter than that window as an error naming both lengths. The take is kept, because a short take is still evidence. The window is wall-clock and not the sum of the step delays. A prop, a run step or a slow guest takes as long as it takes, and --speed changes the delays but not the clock. Slack is two seconds or two percent of the window. Over eleven measured takes, the one take held to its end came back a quarter of a second under, and every take that lost its end came back five to twenty seconds under. The check sits in the engine, so it covers all three recorders.
Stop waited twenty seconds for the recorder to leave after the interrupt and then fetched the file whatever the outcome, so a recorder caught mid-close was copied as a finished take and handed back as a good one. It is now an error, carrying the path, because the file is still worth looking at. Each take also prints how long the recorder took to close and how much it wrote while closing. Those two numbers are the only thing separating a recorder that was merely slow from one that ran out of time, and nothing else was recording them.
what-does-not-work.md gains the defect with the measurements behind it, and keeps what is not established separate from what is: what the recorder runs out of, and whether the loss has a fixed part from closing plus a part proportional to how far behind the encoder is. design.md and how-to-record-inside-a-vm.md both told the reader to use the inside recorder for every scene that does not end its own session. That is no longer the trade. The framebuffer recorder assembles at the rate it measured, so it is real time by construction and has no end to lose, which makes it the safer choice for a long still scene whose last beat is the point. Asking for fewer frames a second does not help, and the docs now say so rather than suggesting it: the same scene lost the same five seconds at twelve, at twenty and at thirty frames a second.
The slack was two seconds or two percent of the recording window, whichever was larger, and the eleven takes that calibrated it were all under three minutes. In that range the two seconds is the term that decides and the percentage never weighs. It weighs on a long take. Two percent of a fifty-one minute session is sixty-one seconds, so a take that lost a full minute of its ending would have passed the guard in silence -- and that is the take nobody reshoots casually, an hour of clock, ending on the beat the film exists for. The percentage is now capped at five seconds, the smallest loss ever measured, so the slack never grows past a gap that has really happened.
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.
Before
info.Size() == 0. A short take is not an empty one.wf-recorderwas given twenty seconds to close after its interrupt, and the file was fetched whatever the outcome. A recorder caught mid-close was copied as a finished take and handed back as a good one.After
Summary of changes
checkTakecompares clip length against the wall-clock recording window; error when short, clip kept, both lengths namedinside,framebufferandgpuare all coveredrunsteps and slow guests take as long as they take, and--speedchanges the delays but not the clockDurationmoved frominternal/productiontointernal/recorder; production imports the engine, so the engine could not reach it without a cycleWF.Stopreports the close time and the bytes written while closingWF.Stopreturns an error, with the path, when the recorder never left before the deadlineFiles updated
internal/engine/take.gointernal/engine/take_test.gointernal/engine/engine.gointernal/engine/engine_test.gointernal/recorder/length.gointernal/recorder/wf.gointernal/recorder/wf_test.gointernal/production/speed.gointernal/production/speed_test.godocs/what-does-not-work.mddocs/design.mddocs/how-to-record-inside-a-vm.mddocs/cli.mddocs/internal/ARCHITECTURE.mdValidation
ffprobeon the hostffprobemust still be able to filmRecord: false)Engine.Runwith a short clipgo build,go vet,go test ./...git archiveDeviations
takeSlackas avarconstRisks / follow-ups
wf-recorder, which encodes in software because these guests have no render node, was that far behind real time when it was stopped and did not write what it had not yet encoded. It has not been confirmed. The new close-time and bytes-written log lines are what would confirm it on the next take.References
17c3852,8bcd701,867a11e,d54724bfeat/weigh-the-take