{"record":{"id":"675f53f6d639f64b","repo":"remotion-dev/remotion","slug":"unknown-track-type-tracktype","errorCode":null,"errorMessage":"Unknown track type: ${trackType}","messagePattern":"Unknown track type: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/media-parser/src/containers/webm/segments/track-entry.ts","lineNumber":34,"sourceCode":"\nexport const trackTypeToString = (trackType: number): TrackType => {\n\tswitch (trackType) {\n\t\tcase 1:\n\t\t\treturn 'video';\n\t\tcase 2:\n\t\t\treturn 'audio';\n\t\tcase 3:\n\t\t\treturn 'complex';\n\t\tcase 4:\n\t\t\treturn 'subtitle';\n\t\tcase 5:\n\t\t\treturn 'button';\n\t\tcase 6:\n\t\t\treturn 'control';\n\t\tcase 7:\n\t\t\treturn 'metadata';\n\t\tdefault:\n\t\t\tthrow new Error(`Unknown track type: ${trackType}`);\n\t}\n};\n\nexport type GetTracks = () => TrackEntry[];\n","sourceCodeStart":16,"sourceCodeEnd":39,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/media-parser/src/containers/webm/segments/track-entry.ts#L16-L39","documentation":"trackTypeToString maps the TrackType uint to a string; values 1-7 cover video/audio/complex/subtitle/button/control/metadata, and any other value throws. The Matroska spec reserves only those values, so an out-of-range TrackType means a non-conformant or corrupt track entry.","triggerScenarios":"parseMedia reads a TrackEntry whose TrackType element has a value outside 1..7 (e.g. 0 or 8+). This happens with proprietary extensions, bit-flipped TrackType values, or experimental muxers.","commonSituations":"Files from non-standard tools, corrupted track headers, or a partially overwritten TrackEntry.","solutions":["Re-mux with ffmpeg, which will normalize or drop unknown track types.","Use ffprobe to list track types; remove the offending track if possible.","Provide a different source file.","Try Mediabunny."],"exampleFix":"// shell: drop the bad track and re-mux\n// ffmpeg -i in.mkv -map 0:v:0 -map 0:a:0 -c copy out.mkv\nawait parseMedia({src: 'out.mkv', fields: {tracks: true}});","handlingStrategy":"try-catch","validationCode":"// Validate track types with ffprobe before parsing.\nimport {execFileSync} from 'node:child_process';\nfunction knownTrackTypes(file: string): boolean {\n  const out = execFileSync('ffprobe', ['-v', 'error', '-show_entries', 'stream=codec_type', '-of', 'csv=p=0', file], {encoding: 'utf8'});\n  return out.trim().split('\\n').every(t => ['video','audio','subtitle','data','attachment'].includes(t));\n}\nif (!knownTrackTypes('in.mkv')) throw new Error('source has an unknown track type');","typeGuard":null,"tryCatchPattern":"try {\n  await parseMedia({src: 'in.mkv', fields: {tracks: true}});\n} catch (err) {\n  if (err instanceof Error && /Unknown track type/.test(err.message)) {\n    throw new Error('Non-standard TrackType value; re-mux or strip the offending track with ffmpeg.', {cause: err});\n  }\n  throw err;\n}","preventionTips":["Use ffprobe to list codec_type before parsing.","Re-mux and -map only known track types.","Reject files ffprobe cannot fully describe."],"tags":["webm","matroska","media-parser","track","malformed-file"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}