{"record":{"id":"f6ad0dfac018bf1e","repo":"remotion-dev/remotion","slug":"invalid-icc-profile-signature","errorCode":null,"errorMessage":"Invalid ICC profile signature","messagePattern":"Invalid ICC profile signature","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"packages/media-parser/src/containers/iso-base-media/parse-icc-profile.ts","lineNumber":59,"sourceCode":"\tconst iterator = getArrayBufferIterator({\n\t\tinitialData: data,\n\t\tmaxBytes: data.length,\n\t\tlogLevel: 'error',\n\t});\n\tconst size = iterator.getUint32();\n\tif (size !== data.length) {\n\t\tthrow new Error('Invalid ICC profile size');\n\t}\n\n\tconst preferredCMMType = iterator.getByteString(4, false);\n\tconst profileVersion = iterator.getByteString(4, false);\n\tconst profileDeviceClass = iterator.getByteString(4, false);\n\tconst colorSpace = iterator.getByteString(4, false);\n\tconst pcs = iterator.getByteString(4, false);\n\tconst dateTime = iterator.getSlice(12);\n\tconst signature = iterator.getByteString(4, false);\n\tif (signature !== 'acsp') {\n\t\tthrow new Error('Invalid ICC profile signature');\n\t}\n\n\tconst primaryPlatform = iterator.getByteString(4, false);\n\tconst profileFlags = iterator.getUint32();\n\tconst deviceManufacturer = iterator.getByteString(4, false);\n\tconst deviceModel = iterator.getByteString(4, false);\n\tconst deviceAttributes = iterator.getUint64();\n\tconst renderingIntent = iterator.getUint32();\n\tconst pcsIlluminant1 = iterator.getUint32();\n\tconst pcsIlluminant2 = iterator.getUint32();\n\tconst pcsIlluminant3 = iterator.getUint32();\n\tconst profileCreator = iterator.getByteString(4, false);\n\tconst profileId = iterator.getByteString(16, false);\n\n\t// reserved\n\titerator.discard(28);\n\n\tconst tagCount = iterator.getUint32();","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/media-parser/src/containers/iso-base-media/parse-icc-profile.ts#L41-L77","documentation":"Thrown in parseIccProfile() after reading the ICC profile signature at byte offset 36. Every valid ICC profile must carry the 4-byte signature 'acsp'; anything else means the blob is not a valid ICC profile and the parser aborts.","triggerScenarios":"parseMedia({src}) on a video whose colr box advertises an ICC profile type but whose payload's signature bytes are not 'acsp' — i.e. the colr box points at a non-ICC blob, a corrupt profile, or a different colour-profile format mislabelled as ICC.","commonSituations":"Mislabelled colr boxes (nclx/proprietary colour data stored under an ICC type); corrupted ICC profiles; files from tools that wrote colour data without the ICC signature.","solutions":["Re-mux to rebuild colour boxes: ffmpeg -i in.mp4 -c copy out.mp4; if it persists, strip colour metadata: ffmpeg -i in.mp4 -c copy -map_metadata -1 out.mp4.","Re-fetch the source if you suspect corruption.","If colour accuracy is not needed, removing the colr box avoids the check.","Migrate to @remotion/mediabunny (parseMedia is deprecated)."],"exampleFix":"// before\nconst {isHdr} = await parseMedia({src, reader: nodeReader});\n\n// after\ntry {\n  const r = await parseMedia({src, reader: nodeReader});\n} catch (err) {\n  if (err instanceof Error && /Invalid ICC profile signature/.test(err.message)) {\n    // colr payload is not a valid ICC profile; strip colour metadata\n  } else throw err;\n}","handlingStrategy":"try-catch","validationCode":"// Strip colour metadata if unused, then validate ffprobe reads it:\n//   ffmpeg -i in.mp4 -c copy -map_metadata -1 out.mp4\nimport {execFileSync} from 'node:child_process';\nfunction colorMetadataParses(file: string): boolean {\n  try {\n    execFileSync('ffprobe', ['-v','error','-select_streams','v:0','-show_entries','stream=color_space,color_transfer,color_primaries','-of','json', file], {encoding:'utf8', stdio:'pipe'});\n    return true;\n  } catch { return false; }\n}","typeGuard":"// The ICC 'acsp' signature is a deep binary field; not caller-type-guardable.\n// => typeGuard: null","tryCatchPattern":"try {\n  await parseMedia({src, reader: nodeReader});\n} catch (err) {\n  if (err instanceof Error && /Invalid ICC profile signature/.test(err.message)) {\n    // colr payload is not a valid ICC profile; strip colour metadata\n  } else {\n    throw err;\n  }\n}","preventionTips":["Strip colour metadata with ffmpeg -map_metadata -1 when not needed.","Re-mux to rebuild a compliant colr box.","Remove mislabelled colr boxes for files that don't need colour management.","Migrate to @remotion/mediabunny (parseMedia is deprecated)."],"tags":["mp4","iso-base-media","media-parser","colr","icc","color","corrupt-file","metadata"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}