remotion-dev/remotion · error · Error

Unknown packet identifier

Error message

Unknown packet identifier

What it means

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.

Source

Thrown at packages/media-parser/src/containers/transport-stream/parse-packet.ts:108

	if (program) {
		const pmt = parsePmt(iterator);
		return pmt;
	}

	const transportStreamEntry = getStreamForId(structure, programId);
	if (transportStreamEntry) {
		parseStream({
			transportStreamEntry,
			iterator,
			transportStream,
			programId,
		});

		return null;
	}

	throw new Error('Unknown packet identifier');
};

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Ensure the TS starts with intact PAT (PID 0) and PMT packets — capture from the start of the stream, not mid-way.
  2. Re-mux the TS so PAT/PMT are emitted cleanly: ffmpeg -i in.ts -c copy out.ts.
  3. If the unknown PID is expected (e.g. a private stream), pre-register it or ignore unknown-PID packets instead of throwing.
Defensive patterns

Strategy: try-catch

Validate before calling

// Ensure PAT (PID 0) and PMT are parsed before expecting known PIDs.
// Pre-validate with ffprobe that the TS has a valid program map.
// ffprobe -v error -show_programs in.ts

Type guard

function isKnownPid(pid: number, knownPids: Set<number>): boolean {
  return knownPids.has(pid);
}

Try / catch

try {
  parsePacket({iterator, structure, transportStream});
} catch (err) {
  if (err instanceof Error && err.message === 'Unknown packet identifier') {
    // skip unknown-PID packets until PAT/PMT are parsed, or remux the TS
  } else throw err;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12). Data as JSON: /api/errors/a3f4f42867befd2c. Report an issue: GitHub.