remotion-dev/remotion · critical · Error
Failed to create WebGL framebuffer
Error message
Failed to create WebGL framebuffer
What it means
Thrown by `setupBlur` when `gl.createFramebuffer()` returns `null`. The framebuffer is the render target for the horizontal blur pass (blur renders source -> intermediate texture via FBO, then intermediate -> canvas). A null handle is a resource-allocation/context-loss failure.
Source
Thrown at packages/effects/src/blur/blur-runtime.ts:157
throw new Error('Failed to create WebGL buffer');
}
gl.bindBuffer(gl.ARRAY_BUFFER, vbo);
gl.bufferData(gl.ARRAY_BUFFER, data, gl.STATIC_DRAW);
gl.enableVertexAttribArray(0);
gl.vertexAttribPointer(0, 2, gl.FLOAT, false, 16, 0);
gl.enableVertexAttribArray(1);
gl.vertexAttribPointer(1, 2, gl.FLOAT, false, 16, 8);
gl.bindVertexArray(null);
const textureSource = createRgbaTexture(gl);
const textureIntermediate = createRgbaTexture(gl);
const framebuffer = gl.createFramebuffer();
if (!framebuffer) {
throw new Error('Failed to create WebGL framebuffer');
}
const w = Math.max(1, target.width);
const h = Math.max(1, target.height);
gl.bindTexture(gl.TEXTURE_2D, textureIntermediate);
gl.texImage2D(
gl.TEXTURE_2D,
0,
gl.RGBA,
w,
h,
0,
gl.RGBA,
gl.UNSIGNED_BYTE,
null,
);
gl.bindTexture(gl.TEXTURE_2D, null);
View on GitHub (pinned to 78fe4bb3fd)
Solutions
- Guard with `gl.isContextLost()`; reinitialize on restoration.
- Free unused blur states via `cleanupBlur` (deletes the framebuffer).
- Reduce concurrent blur effects.
- Confirm hardware-accelerated WebGL2; update drivers.
Example fix
if (gl.isContextLost()) {
// reinitialize after restore
} else {
const state = setupBlur(canvas);
} Defensive patterns
Strategy: try-catch
Validate before calling
if (gl.isContextLost()) { /* skip setupBlur */ } Try / catch
try {
const state = setupBlur(canvas);
} catch (err) {
if (/Failed to create WebGL framebuffer/.test(err.message)) {
// await restore or reduce effects, then retry
} else { throw err; }
} Prevention
- Release the framebuffer via cleanupBlur on unused states.
- Handle context-loss events.
- Cap concurrent blur effects (each holds one FBO).
When it happens
Trigger: Fires at line 155-157, after both textures are created, when `gl.createFramebuffer()` returns null.
Common situations: Context loss during setup; framebuffer-object cap reached by many live blur effects; software renderer with low FBO limits; the GL implementation does not expose the framebuffer capability.
Related errors
- Failed to create WebGL shader
- Failed to create WebGL program
- Failed to create WebGL vertex array
- Failed to create WebGL buffer
- Blur framebuffer incomplete: 0x${status.toString(16)}
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/c6838a63edac5c38.
Report an issue: GitHub.