Show how fast a recording not in real time goes as a speed
The tempo of a recording not in real time read as how many times slower than real time it was made. "5.1x real time" for a recording that took five times as long as its video looked like it ran five times faster. - The log line at the end and the notice now give seconds of video per second it took, with two decimals: 0.20x for the example above. - It may go above 1x. Nothing holds a recording not in real time back to the wall clock, and a cheap scene on a fast screen makes more frames a second than the video has. - A recording of a single frame took 0 s and has no tempo line now, instead of a division by zero. Tests: - tsc, eslint, Prettier clean - Gate on melektaus-atx: green, 311 files, 4821 tests - No check reads the figure itself. 68j looks for "x real time, and has every frame", which still matches. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
abb8fa51d8
commit
b1173ba6bb
3 files changed
+8
-8
No files matched your search
@@ -322,7 +322,7 @@ export class PlaySession {
|
|||||||
if (steady && !this.state.paused)
|
if (steady && !this.state.paused)
|
||||||
return (
|
return (
|
||||||
`Recording "${steady.name}" not in real time: ${steady.seconds.toFixed(1)} s of video, ` +
|
`Recording "${steady.name}" not in real time: ${steady.seconds.toFixed(1)} s of video, ` +
|
||||||
`${steady.slower.toFixed(1)}x real time · Esc stops`
|
`${steady.speed.toFixed(2)}x real time · Esc stops`
|
||||||
);
|
);
|
||||||
if (this.state.paused) {
|
if (this.state.paused) {
|
||||||
const why = this.breakAt === null ? 'Paused' : `Break in ${this.breakAt}`;
|
const why = this.breakAt === null ? 'Paused' : `Break in ${this.breakAt}`;
|
||||||
|
|||||||
@@ -115,14 +115,14 @@ export class GameRecorder implements RecordingSink {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* How far a recording not in real time has got (#423): seconds of video, and how many times
|
* How far a recording not in real time has got (#423): seconds of video, and its speed, seconds
|
||||||
* longer it took; null while none records.
|
* of video per second it took (0.2 is five times slower than real time); null while none records.
|
||||||
*/
|
*/
|
||||||
steadyPace(): { name: string; seconds: number; slower: number } | null {
|
steadyPace(): { name: string; seconds: number; speed: number } | null {
|
||||||
const info = this.take?.info();
|
const info = this.take?.info();
|
||||||
if (!info || info.realTime || info.state !== 'recording') return null;
|
if (!info || info.realTime || info.state !== 'recording') return null;
|
||||||
const seconds = info.durationMs / 1000;
|
const seconds = info.durationMs / 1000;
|
||||||
return { name: info.name, seconds, slower: seconds > 0 ? info.tookMs / info.durationMs : 0 };
|
return { name: info.name, seconds, speed: info.tookMs > 0 ? info.durationMs / info.tookMs : 0 };
|
||||||
}
|
}
|
||||||
|
|
||||||
stop(): string {
|
stop(): string {
|
||||||
|
|||||||
@@ -588,14 +588,14 @@ export class Take {
|
|||||||
this.tellPace();
|
this.tellPace();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** How much slower than real time a recording not in real time was made (#423). */
|
/** How fast a recording not in real time was made (#423): seconds of video per second it took. */
|
||||||
private tellPace(): void {
|
private tellPace(): void {
|
||||||
const pace = this.steady;
|
const pace = this.steady;
|
||||||
if (!pace || pace.seconds <= 0) return;
|
|
||||||
const took = this.tookMs / 1000;
|
const took = this.tookMs / 1000;
|
||||||
|
if (!pace || pace.seconds <= 0 || took <= 0) return;
|
||||||
this.host.log(
|
this.host.log(
|
||||||
`Recording "${this.name}" took ${took.toFixed(1)} s for ${pace.seconds.toFixed(1)} s of video, ` +
|
`Recording "${this.name}" took ${took.toFixed(1)} s for ${pace.seconds.toFixed(1)} s of video, ` +
|
||||||
`${(took / pace.seconds).toFixed(1)}x real time, and has every frame`,
|
`${(pace.seconds / took).toFixed(2)}x real time, and has every frame`,
|
||||||
'info',
|
'info',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user