Skip to content

Create polished demo videos without editing skills. Mac/Windows/Linux

fix: cursor desync in exports — remove erroneous startup offset from cursor timestamp

webadderall023d5212a987
diff --git a/src/lib/exporter/streamingDecoder.ts b/src/lib/exporter/streamingDecoder.ts
index a7a3e177..fdcb1a0d 100644
--- a/src/lib/exporter/streamingDecoder.ts
+++ b/src/lib/exporter/streamingDecoder.ts
@@ -221,7 +221,6 @@ export class StreamingVideoDecoder {
let decodeError: Error | null = null;
let decodeDone = false;
let firstDecodedFrameTimestampUs: number | null = null;
- let decodedFrameStartupOffsetUs = 0;
this.decoder = new VideoDecoder({
output: (frame: VideoFrame) => {
@@ -349,12 +348,11 @@ export class StreamingVideoDecoder {
const clone = new VideoFrame(heldFrame, { timestamp: heldFrame.timestamp });
const sourceTimestampMs = sourceTimeSec * 1000;
- const cursorTimestampMs = sourceTimestampMs + decodedFrameStartupOffsetUs / 1000;
await onFrame(
clone,
exportFrameIndex * frameDurationUs,
sourceTimestampMs,
- cursorTimestampMs,
+ sourceTimestampMs,
);
segmentFrameIndex++;
exportFrameIndex++;
@@ -367,10 +365,6 @@ export class StreamingVideoDecoder {
if (firstDecodedFrameTimestampUs === null) {
firstDecodedFrameTimestampUs = frame.timestamp;
- decodedFrameStartupOffsetUs = getDecodedFrameStartupOffsetUs(
- firstDecodedFrameTimestampUs,
- this.metadata,
- );
}
const normalizedFrameTimeSec = Math.max(
@@ -444,12 +438,11 @@ export class StreamingVideoDecoder {
const clone = new VideoFrame(heldFrame, { timestamp: heldFrame.timestamp });
const sourceTimestampMs = sourceTimeSec * 1000;
- const cursorTimestampMs = sourceTimestampMs + decodedFrameStartupOffsetUs / 1000;
await onFrame(
clone,
exportFrameIndex * frameDurationUs,
sourceTimestampMs,
- cursorTimestampMs,
+ sourceTimestampMs,
);
segmentFrameIndex++;
exportFrameIndex++;