{"record":{"id":"4bb8e88178656628","repo":"remotion-dev/remotion","slug":"expected-type-indicator-to-be-0","errorCode":null,"errorMessage":"Expected type indicator to be 0","messagePattern":"Expected type indicator to be 0","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"packages/media-parser/src/containers/iso-base-media/meta/ilst.ts","lineNumber":140,"sourceCode":"\n\t\t\t// \"----\" atom in m4a files\n\t\t\t// iTunes adds it for .m4a files\n\t\t\t// not very interesting data, so we don't parse them\n\t\t\tif (index === '----') {\n\t\t\t\titerator.discard(metadataSize - 8);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\titerator.discard(metadataSize - 8);\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst innerSize = iterator.getUint32();\n\t\tconst type = iterator.getAtom();\n\t\tconst typeIndicator = iterator.getUint8();\n\n\t\tif (typeIndicator !== 0) {\n\t\t\tthrow new Error('Expected type indicator to be 0');\n\t\t}\n\n\t\tconst wellKnownType = iterator.getUint24();\n\t\titerator.discard(4);\n\t\tconst value = parseFromWellKnownType(\n\t\t\twellKnownType,\n\t\t\titerator,\n\t\t\tinnerSize - 16,\n\t\t);\n\t\tentries.push({index, type, wellKnownType, value});\n\t}\n\n\tbox.discardRest();\n\n\treturn {\n\t\ttype: 'ilst-box',\n\t\tboxSize: size,\n\t\toffset,","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/media-parser/src/containers/iso-base-media/meta/ilst.ts#L122-L158","documentation":"Thrown in parseIlstBox() after reading the ilst data atom's type-indicator byte. The QuickTime/iTunes spec requires the type indicator to be 0 for the well-known-type encoding this parser expects; any other value is rejected because the subsequent wellKnownType (getUint24) would be misaligned/meaningless.","triggerScenarios":"parseMedia({src}) on a file whose ilst data atom has a type indicator byte != 0 — i.e. a metadata atom using a different (UTF-8/variant) encoding or a corrupted indicator byte. The parser only handles the 'well-known type' (indicator 0) encoding.","commonSituations":"M4A/MOV files with non-Apple-style metadata encodings, or corrupt/hand-edited ilst atoms where the indicator byte is wrong.","solutions":["Strip and rebuild metadata: ffmpeg -i in.m4a -map_metadata -1 -c copy out.m4a.","Re-tag with a compliant tool (Kid3/mp3tag) if you need metadata.","Re-mux the whole file: ffmpeg -i in.file -c copy out.mp4.","Migrate to @remotion/mediabunny (parseMedia is deprecated)."],"exampleFix":"// before\nconst {metadata} = 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 && /Expected type indicator to be 0/.test(err.message)) {\n    // ilst encoding not supported; strip metadata and re-mux\n  } else throw err;\n}","handlingStrategy":"try-catch","validationCode":"// Validate ffprobe reads the tags cleanly before parsing:\n//   ffprobe -v error -show_entries format_tags -of json in.m4a\nimport {execFileSync} from 'node:child_process';\nfunction metadataParses(file: string): boolean {\n  try {\n    execFileSync('ffprobe', ['-v','error','-show_entries','format_tags','-of','json', file], {encoding:'utf8', stdio:'pipe'});\n    return true;\n  } catch { return false; }\n}","typeGuard":"// The ilst type-indicator byte is deep binary metadata; not caller-type-guardable.\n// => typeGuard: null","tryCatchPattern":"try {\n  const {metadata} = await parseMedia({src, reader: nodeReader});\n} catch (err) {\n  if (err instanceof Error && /Expected type indicator to be 0/.test(err.message)) {\n    // ilst uses an unsupported encoding; strip metadata and re-mux\n  } else {\n    throw err;\n  }\n}","preventionTips":["Strip/rebuild iTunes metadata with ffmpeg -map_metadata -1 for untrusted inputs.","Use a compliant tag editor to repair or remove bad metadata.","Migrate to @remotion/mediabunny (parseMedia is deprecated).","Wrap parseMedia() in try/catch when parsing arbitrary tagged files."],"tags":["mp4","iso-base-media","media-parser","ilst","metadata","corrupt-file","itunes"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}