{"record":{"id":"31eb7e37d2f01c87","repo":"remotion-dev/remotion","slug":"no-tracks-segment","errorCode":null,"errorMessage":"No tracks segment","messagePattern":"No tracks segment","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/media-parser/src/containers/webm/get-ready-tracks.ts","lineNumber":32,"sourceCode":"};\n\nexport const getTracksFromMatroska = ({\n\tstructureState,\n\twebmState,\n}: {\n\tstructureState: StructureState;\n\twebmState: WebmState;\n}): ResolvedAndUnresolvedTracks => {\n\tconst structure = structureState.getMatroskaStructure();\n\tconst mainSegment = getMainSegment(structure.boxes);\n\tif (!mainSegment) {\n\t\tthrow new Error('No main segment');\n\t}\n\n\tconst tracksSegment = getTracksSegment(mainSegment);\n\n\tif (!tracksSegment) {\n\t\tthrow new Error('No tracks segment');\n\t}\n\n\tconst resolvedTracks: MediaParserTrack[] = [];\n\tconst missingInfo: MediaParserTrack[] = [];\n\n\tfor (const trackEntrySegment of tracksSegment.value) {\n\t\tif (trackEntrySegment.type === 'Crc32') {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (trackEntrySegment.type !== 'TrackEntry') {\n\t\t\tthrow new Error('Expected track entry segment');\n\t\t}\n\n\t\tconst track = getTrack({\n\t\t\ttrack: trackEntrySegment,\n\t\t\ttimescale: webmState.getTimescale(),\n\t\t});","sourceCodeStart":14,"sourceCodeEnd":50,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/media-parser/src/containers/webm/get-ready-tracks.ts#L14-L50","documentation":"After locating the main Segment, getTracksFromMatroska looks inside it for a Tracks element (ID 0x1654AE6B). If getTracksSegment returns null it throws 'No tracks segment' — the Segment exists but has no Tracks child, so no tracks can be resolved. This indicates a truncated/malformed Matroska or a stream parsed before Tracks arrived.","triggerScenarios":"parseMedia() on a Matroska/WebM whose Segment lacks a Tracks element: truncated file (cut before Tracks), a muxer that wrote Segment info but no Tracks, or a live stream parsed too early.","commonSituations":"Truncated download; incomplete mux; live stream read before Tracks; corrupted EBML tree.","solutions":["Check with ffprobe that tracks are present.","Re-mux: ffmpeg -i in.mkv -c copy out.mkv.","Use Mediabunny; try/catch parseMedia()."],"exampleFix":"# validate tracks exist, then re-mux\nffprobe -v error -show_streams in.mkv && ffmpeg -i in.mkv -c copy out.mkv\n\nawait parseMedia({ src: 'out.mkv' });","handlingStrategy":"try-catch","validationCode":"// confirm tracks exist before parsing\n// ffprobe -v error -show_streams in.mkv   (prints streams => Tracks element present)","typeGuard":null,"tryCatchPattern":"try {\n  await parseMedia({ src: 'in.mkv' });\n} catch (err) {\n  if (err instanceof Error && /No tracks segment/.test(err.message)) {\n    // Segment has no Tracks — re-mux or skip\n  } else throw err;\n}","preventionTips":["Re-mux truncated MKV/WebM with ffmpeg so Tracks is written.","Validate with ffprobe -show_streams before parsing.","Use Mediabunny."],"tags":["webm","matroska","media-parser","corrupt-file","container","tracks"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}