{"record":{"id":"3ff8d271e8e73471","repo":"remotion-dev/remotion","slug":"no-pmt-box-found","errorCode":null,"errorMessage":"No PMT box found","messagePattern":"No PMT box found","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/media-parser/src/containers/transport-stream/traversal.ts","lineNumber":38,"sourceCode":"export const findProgramMapOrNull = (structure: TransportStreamStructure) => {\n\tconst box = structure.boxes.find(\n\t\t(b) => b.type === 'transport-stream-pmt-box',\n\t);\n\n\tif (!box) {\n\t\treturn null;\n\t}\n\n\treturn box as TransportStreamPMTBox;\n};\n\nexport const findProgramMapTableOrThrow = (\n\tstructure: TransportStreamStructure,\n) => {\n\tconst box = findProgramMapOrNull(structure);\n\n\tif (!box) {\n\t\tthrow new Error('No PMT box found');\n\t}\n\n\treturn box;\n};\n\nexport const getProgramForId = (\n\tstructure: TransportStreamStructure,\n\tpacketIdentifier: number,\n): TransportStreamProgramAssociationTableEntry | null => {\n\tconst box = findProgramAssociationTableOrThrow(structure);\n\tconst entry = box.pat.find(\n\t\t(e) => e.programMapIdentifier === packetIdentifier,\n\t);\n\treturn entry ?? null;\n};\n\nexport const getStreamForId = (\n\tstructure: TransportStreamStructure,","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/media-parser/src/containers/transport-stream/traversal.ts#L20-L56","documentation":"Thrown by findProgramMapTableOrThrow at traversal.ts:38 when findProgramMapOrNull returns null, i.e. structure.boxes has no box of type 'transport-stream-pmt-box'. The PMT box is produced by parsePmt; if it has not been encountered yet, every traversal that needs stream metadata fails.","triggerScenarios":"findProgramMapTableOrThrow delegates to findProgramMapOrNull and throws on null. Triggered when traversal runs before the PMT packet has been parsed, when the stream has no PMT, or when the PMT PID declared by the PAT carries no section.","commonSituations":"Partial captures missing the PMT packet; corrupt streams where the PMT PID is wrong or carries no section; parser invoked before header packets are processed; non-conformant .ts files.","solutions":["Re-mux the file: ffmpeg -i in.ts -c copy out.ts to regenerate the PMT.","Verify with ffprobe that the PMT is present and references the expected PIDs.","Ensure the input starts at the PAT/PMT and includes both before any elementary-stream packets.","File a bug with a sample if the stream contains a PMT but the library does not detect it."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Confirm a PMT packet is present before parsing\nimport {execSync} from 'node:child_process';\nfunction hasTransportStreamPmt(src: string): boolean {\n  try { execSync(`ffprobe -v error -i \"${src}\" -t 1 -f null -`, {stdio: 'ignore'}); return true; } catch { return false; }\n}","typeGuard":null,"tryCatchPattern":"try { await parseMedia({src}); }\ncatch (e) {\n  if (e instanceof Error && e.message === 'No PMT box found') {\n    await runFfmpeg(['-i', src, '-c', 'copy', src + '.remux.ts']);\n    await parseMedia({src: src + '.remux.ts'});\n  } else throw e;\n}","preventionTips":["Ensure .ts inputs include both PAT and PMT packets before elementary-stream packets.","Re-mux with ffmpeg to regenerate PAT/PMT.","Validate with ffprobe that the PMT is present."],"tags":["media-parser","transport-stream","mpegts","pmt","validation"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}