{"record":{"id":"a3f4f42867befd2c","repo":"remotion-dev/remotion","slug":"unknown-packet-identifier","errorCode":null,"errorMessage":"Unknown packet identifier","messagePattern":"Unknown packet identifier","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/media-parser/src/containers/transport-stream/parse-packet.ts","lineNumber":108,"sourceCode":"\n\tif (program) {\n\t\tconst pmt = parsePmt(iterator);\n\t\treturn pmt;\n\t}\n\n\tconst transportStreamEntry = getStreamForId(structure, programId);\n\tif (transportStreamEntry) {\n\t\tparseStream({\n\t\t\ttransportStreamEntry,\n\t\t\titerator,\n\t\t\ttransportStream,\n\t\t\tprogramId,\n\t\t});\n\n\t\treturn null;\n\t}\n\n\tthrow new Error('Unknown packet identifier');\n};\n","sourceCodeStart":90,"sourceCodeEnd":110,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/media-parser/src/containers/transport-stream/parse-packet.ts#L90-L110","documentation":"Thrown by parsePacket() when the packet's programId (PID, 13 bits) is not found in the transport stream's stream table (getStreamForId returns null) and is therefore unknown to the demuxer. Normally the PAT/PMT declares every PID; an unknown PID means either the PAT/PMT has not been parsed yet, was missed/corrupt, or the PID is genuinely undeclared.","triggerScenarios":"Encountering a TS packet whose PID was never registered via PAT/PMT parsing — e.g. PMT arrives late or out of order, the PMT is corrupt, or the stream contains an undeclared elementary stream.","commonSituations":"TS files where PAT/PMT ordering is unusual; partially-captured TS (missing the head with PAT/PMT); streams with private/undeclared PIDs; buggy TS muxers.","solutions":["Ensure the TS starts with intact PAT (PID 0) and PMT packets — capture from the start of the stream, not mid-way.","Re-mux the TS so PAT/PMT are emitted cleanly: ffmpeg -i in.ts -c copy out.ts.","If the unknown PID is expected (e.g. a private stream), pre-register it or ignore unknown-PID packets instead of throwing."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Ensure PAT (PID 0) and PMT are parsed before expecting known PIDs.\n// Pre-validate with ffprobe that the TS has a valid program map.\n// ffprobe -v error -show_programs in.ts","typeGuard":"function isKnownPid(pid: number, knownPids: Set<number>): boolean {\n  return knownPids.has(pid);\n}","tryCatchPattern":"try {\n  parsePacket({iterator, structure, transportStream});\n} catch (err) {\n  if (err instanceof Error && err.message === 'Unknown packet identifier') {\n    // skip unknown-PID packets until PAT/PMT are parsed, or remux the TS\n  } else throw err;\n}","preventionTips":["Capture TS from the start so PAT/PMT are present.","Re-mux with ffmpeg to emit clean PAT/PMT.","Ignore unknown-PID packets rather than aborting the whole parse."],"tags":["transport-stream","mpeg-ts","pid","pat","pmt","media-parser"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}