{"record":{"id":"92df4a3dd523297e","repo":"remotion-dev/remotion","slug":"failed-to-create-color-correction-texture","errorCode":null,"errorMessage":"Failed to create color correction texture","messagePattern":"Failed to create color correction texture","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/effects/src/color-correction.ts","lineNumber":355,"sourceCode":"\tgl.linkProgram(program);\n\tgl.deleteShader(vertexShader);\n\tgl.deleteShader(fragmentShader);\n\n\tif (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\n\t\tconst log = gl.getProgramInfoLog(program);\n\t\tgl.deleteProgram(program);\n\t\tthrow new Error(\n\t\t\t`Color correction shader link failed: ${log ?? '(no log)'}`,\n\t\t);\n\t}\n\n\treturn program;\n};\n\nconst createTexture = (gl: WebGL2RenderingContext): WebGLTexture => {\n\tconst texture = gl.createTexture();\n\tif (!texture) {\n\t\tthrow new Error('Failed to create color correction texture');\n\t}\n\n\tgl.bindTexture(gl.TEXTURE_2D, texture);\n\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n\tgl.bindTexture(gl.TEXTURE_2D, null);\n\treturn texture;\n};\n\nconst setupColorCorrection = (\n\ttarget: HTMLCanvasElement,\n): ColorCorrectionState => {\n\tconst gl = target.getContext('webgl2', {\n\t\tpremultipliedAlpha: true,\n\t\talpha: true,\n\t\tpreserveDrawingBuffer: true,","sourceCodeStart":337,"sourceCodeEnd":373,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/color-correction.ts#L337-L373","documentation":"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.","triggerScenarios":"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.","commonSituations":"High render concurrency, software GL with low texture limits, GPU memory pressure, or a render that suffered context loss.","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."],"exampleFix":"// before\nremotion render main --concurrency=8\n\n// after\nremotion render main --concurrency=1","handlingStrategy":"retry","validationCode":"function webgl2TextureAvailable(): boolean {\n  try {\n    const c = document.createElement('canvas');\n    const gl = c.getContext('webgl2');\n    if (!gl) return false;\n    const t = gl.createTexture();\n    const ok = t !== null;\n    if (t) gl.deleteTexture(t);\n    return ok;\n  } catch {\n    return false;\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  await renderMedia({...});\n} catch (err) {\n  if (/Failed to create color correction texture/i.test(String(err))) {\n    await renderMedia({...opts, concurrency: 1});\n  } else {\n    throw err;\n  }\n}","preventionTips":["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."],"tags":["webgl","gpu-resource-exhaustion","color-correction","texture","rendering","environment"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}