Skip to content

Record your screen, ship a demo. Free and open-source, GPU-accelerated, no watermarks, no subscriptions. Windows, macOS, Linux. Actively maintained.

fix: pass explicit range to packet scan read

Enriquefft337838294d69
diff --git a/src/lib/exporter/streamingDecoder.ts b/src/lib/exporter/streamingDecoder.ts
index 7e261ffed..cc5ded5aa 100644
--- a/src/lib/exporter/streamingDecoder.ts
+++ b/src/lib/exporter/streamingDecoder.ts
@@ -230,9 +230,11 @@ export class StreamingVideoDecoder {
// Scan video packets to find the true content boundary.
// MediaRecorder (especially on Linux) writes unreliable container durations.
// Packet timestamps are ground truth — no decode needed, just timestamp reads.
+ // Pass explicit range because some containers are truncated without one.
+ const scanEndSec = Math.max(mediaInfo.duration, videoStream?.duration ?? 0, 0) + 0.5;
let maxPacketEndUs = 0;
const scanReader = (
- this.demuxer.read("video") as ReadableStream<EncodedVideoChunk>
+ this.demuxer.read("video", 0, scanEndSec) as ReadableStream<EncodedVideoChunk>
).getReader();
try {
while (true) {