{"record":{"id":"eb16373a824d3044","repo":"remotion-dev/remotion","slug":"does-not-pmt-table-with-more-than-1-entry-uncommo","errorCode":null,"errorMessage":"Does not PMT table with more than 1 entry, uncommon","messagePattern":"Does not PMT table with more than 1 entry, uncommon","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/media-parser/src/containers/transport-stream/parse-pmt.ts","lineNumber":63,"sourceCode":"\t\t\titerator.getBits(4); // reserved\n\t\t\tconst esInfoLength = iterator.getBits(12);\n\t\t\titerator.getBits(esInfoLength * 8);\n\t\t\tstreams.push({streamType, pid: elementaryPid});\n\n\t\t\tconst remaining = sectionLength - (iterator.counter.getOffset() - start);\n\t\t\tif (remaining <= 4) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\ttables.push({\n\t\t\ttype: 'transport-stream-program-map-table',\n\t\t\tstreams,\n\t\t});\n\t}\n\n\tif (tables.length !== 1) {\n\t\tthrow new Error('Does not PMT table with more than 1 entry, uncommon');\n\t}\n\n\titerator.stopReadingBits();\n\n\treturn {\n\t\ttype: 'transport-stream-pmt-box',\n\t\ttableId,\n\t\tstreams: tables[0].streams,\n\t};\n};\n\nexport const parsePmt = (iterator: BufferIterator): TransportStreamPMTBox => {\n\titerator.startReadingBits();\n\n\tconst tableId = iterator.getBits(8);\n\titerator.getBits(1); // syntax indicator\n\titerator.getBits(1); // private bit\n\titerator.getBits(4);","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/media-parser/src/containers/transport-stream/parse-pmt.ts#L45-L81","documentation":"Thrown at parse-pmt.ts:63 when parsePmtTable produces a tables array whose length is not exactly 1. The loop runs from sectionNumber to lastSectionNumber inclusive, so a multi-section PMT (lastSectionNumber > sectionNumber) yields more than one entry and trips the guard. The library assumes a single-section PMT, which covers the vast majority of real-world streams.","triggerScenarios":"parsePmtTable pushes one entry per iteration of the sectionNumber..lastSectionNumber loop; if that range spans more than one value, tables.length > 1 and the guard fires. Triggered by multi-section PMTs (rare in practice) or by corruption that inflates lastSectionNumber.","commonSituations":"Streams from unusual broadcast muxers that segment the PMT; corrupt PMT section headers; theoretical edge cases the library has chosen not to support yet.","solutions":["Re-mux to a single-section PMT: ffmpeg -i in.ts -c copy out.ts.","If you genuinely need multi-section PMT support, file a feature request on @remotion/media-parser with the sample.","Transcode to a different container (MP4, MKV) that does not segment program maps.","Verify the PMT section_number/last_section_number with dvbsnoop."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Reject multi-section PMTs upstream by checking last_section_number\n// Not directly exposed by ffprobe; rely on re-mux to collapse to single-section.\nfunction normalizePmt(src: string): string {\n  const out = src + '.remux.ts';\n  execSync(`ffmpeg -y -i \"${src}\" -c copy \"${out}\"`);\n  return out;\n}","typeGuard":null,"tryCatchPattern":"try { await parseMedia({src}); }\ncatch (e) { if (e instanceof Error && e.message === 'Does not PMT table with more than 1 entry, uncommon') { const norm = remux(src); await parseMedia({src: norm}); } else throw e; }","preventionTips":["Re-mux multi-program or multi-section transport streams with ffmpeg.","Transcode to MP4/MKV if PMT segmentation cannot be normalized.","File a feature request on @remotion/media-parser if you need multi-section PMT."],"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"}