remotion-dev/remotion · error · Error
Mediabunny did not return an output buffer.
Error message
Mediabunny did not return an output buffer.
What it means
After `recording.source.close()` and `await recording.output.finalize()`, the code expects `recording.target.buffer` to be populated by Mediabunny's `BufferTarget`. If the buffer is falsy, finalization produced no data. This is a defensive guard against Mediabunny silently returning an empty result despite a successful finalize.
Source
Thrown at packages/canvas-capture-extension/src/recorder.ts:336
const finalizeRecording = async (
recording: RecordingState,
filename: string,
format: CaptureFormat,
): Promise<File> => {
await recording.lastFramePromise;
if (recording.hasEncodingError) {
throw recording.encodingError;
}
if (recording.frameCount === 0) {
throw new Error('No frames were added to the canvas recording.');
}
recording.source.close();
await recording.output.finalize();
if (!recording.target.buffer) {
throw new Error('Mediabunny did not return an output buffer.');
}
const captureData = JSON.stringify({
startedAt: recording.startedAt,
endedAt: performance.now(),
captureMetadata: recording.captureMetadata,
mouseMovements: recording.mouseMovements,
pointerClicks: recording.pointerClicks,
});
const {
ALL_FORMATS,
BufferSource,
BufferTarget,
Conversion,
Input,
Mp4OutputFormat,
Output,View on GitHub (pinned to 78fe4bb3fd)
Solutions
- Upgrade or pin a known-good Mediabunny version.
- Inspect `recording.encodingError` and `hasEncodingError` for the real cause.
- Re-run the capture; if persistent, capture debug info from the Mediabunny conversion.
- Report with the Mediabunny version and capture parameters.
Defensive patterns
Strategy: try-catch
Try / catch
try {
await recorder.stopRecording();
} catch (e) {
if (e instanceof Error && /did not return an output buffer/.test(e.message)) {
logMediabunnyVersion();
// re-record with a fresh session; do not reuse state.
}
throw e;
} Prevention
- Pin a known-good Mediabunny version.
- Check encodingError before stopping.
- Capture Mediabunny warnings during finalize.
When it happens
Trigger: Mediabunny's `BufferTarget` did not accumulate bytes — e.g., the muxer/encoder produced no output despite frameCount > 0; a Mediabunny version mismatch or internal error left the buffer undefined; finalize resolved but never wrote to the target.
Common situations: Mediabunny version regression; encoding silently dropped samples; a corrupted Mediabunny build; an unsupported codec configuration that did not raise `encodingError`.
Related errors
- Mediabunny remux did not return an output buffer.
- ${label} encoding is not supported at ${size.width}×${size.h
- No frames were added to the canvas recording.
- The display canvas would be ${displayWidth}×${displayHeight}
- The encoded frame would be ${outputSize.width}×${outputSize.
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/5e06b4348ee7d3d2.
Report an issue: GitHub.