remotion-dev/remotion · error · Error
Failed to create color correction texture
Error message
Failed to create color correction texture
What it means
Thrown by createTexture in the color correction effect when gl.createTexture() returns null. The GL context cannot allocate another texture object, indicating resource/memory exhaustion or context loss. The effect needs the source texture to receive frame pixels, so setup aborts.
Source
Thrown at packages/effects/src/color-correction.ts:355
gl.linkProgram(program);
gl.deleteShader(vertexShader);
gl.deleteShader(fragmentShader);
if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {
const log = gl.getProgramInfoLog(program);
gl.deleteProgram(program);
throw new Error(
`Color correction shader link failed: ${log ?? '(no log)'}`,
);
}
return program;
};
const createTexture = (gl: WebGL2RenderingContext): WebGLTexture => {
const texture = gl.createTexture();
if (!texture) {
throw new Error('Failed to create color correction texture');
}
gl.bindTexture(gl.TEXTURE_2D, texture);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
gl.bindTexture(gl.TEXTURE_2D, null);
return texture;
};
const setupColorCorrection = (
target: HTMLCanvasElement,
): ColorCorrectionState => {
const gl = target.getContext('webgl2', {
premultipliedAlpha: true,
alpha: true,
preserveDrawingBuffer: true,View on GitHub (pinned to 78fe4bb3fd)
Solutions
- Reduce render concurrency so fewer textures are live at once.
- Render with GPU acceleration rather than software GL.
- Update drivers/Chrome and retry for transient context loss.
- Fewer concurrent WebGL effects reduces aggregate texture allocation.
Example fix
// before remotion render main --concurrency=8 // after remotion render main --concurrency=1
Defensive patterns
Strategy: retry
Validate before calling
function webgl2TextureAvailable(): boolean {
try {
const c = document.createElement('canvas');
const gl = c.getContext('webgl2');
if (!gl) return false;
const t = gl.createTexture();
const ok = t !== null;
if (t) gl.deleteTexture(t);
return ok;
} catch {
return false;
}
} Try / catch
try {
await renderMedia({...});
} catch (err) {
if (/Failed to create color correction texture/i.test(String(err))) {
await renderMedia({...opts, concurrency: 1});
} else {
throw err;
}
} Prevention
- Lower render concurrency to reduce live GL texture objects.
- Use GPU-accelerated render environments instead of software GL.
- Update drivers and Chromium; retry on transient context loss.
- Reduce the number of WebGL effects active per frame.
When it happens
Trigger: At color-correction.ts:355 inside setupColorCorrection (textureSource = createTexture(gl)) after the program, VAO, and VBO are built. gl.createTexture() returns null under GL object/memory pressure or a lost context; not caused by colorCorrection() params.
Common situations: High render concurrency, software GL with low texture limits, GPU memory pressure, or a render that suffered context loss.
Related errors
- Failed to create color correction shader
- Failed to create color correction shader program
- Failed to create color correction vertex array
- Failed to create color correction vertex buffer
- Failed to create WebGL texture
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/92df4a3dd523297e.
Report an issue: GitHub.