Merge pull request #404 from sharkcreep87/fix/export-2gib-readfile-limit

fix(export): return temp path from buffer-mode FFmpeg muxer (>2 GiB) (#380)
This commit is contained in:
webadderall
2026-05-04 14:00:59 +10:00
committed by GitHub
7 changed files with 113 additions and 24 deletions
+4 -3
View File
@@ -1244,17 +1244,18 @@ export class ModernVideoExporter {
this.finalizationStageMs.ffmpegAudioMuxBreakdown = result.metrics;
}
if (!result.success || !result.data) {
if (!result.success || !result.tempPath) {
return {
success: false,
error: result.error || "Failed to mux exported audio with FFmpeg",
};
}
const videoBytes = result.data.slice();
// Returning a temp path (instead of buffering the muxed bytes back into
// the renderer) is what keeps >2 GiB exports off Node's fs.readFile cap.
return {
success: true,
blob: new Blob([videoBytes.buffer], { type: "video/mp4" }),
tempFilePath: result.tempPath,
};
}
+4 -4
View File
@@ -981,7 +981,7 @@ export class VideoExporter {
this.finalizationStageMs.ffmpegAudioMuxBreakdown = result.metrics;
}
if (!result.success || !result.data) {
if (!result.success || !result.tempPath) {
return {
success: false,
error: result.error || "Failed to mux exported audio with FFmpeg",
@@ -989,11 +989,11 @@ export class VideoExporter {
};
}
const blobData = new Uint8Array(result.data.byteLength);
blobData.set(result.data);
// Returning a temp path (instead of buffering the muxed bytes back into
// the renderer) is what keeps >2 GiB exports off Node's fs.readFile cap.
return {
success: true,
blob: new Blob([blobData.buffer], { type: "video/mp4" }),
tempFilePath: result.tempPath,
metrics: this.buildExportMetrics(),
};
}