remotion-dev/remotion · error · Error

No PAT box found

Error message

No PAT box found

What it means

Thrown by findProgramAssociationTableOrThrow at traversal.ts:14 when structure.boxes contains no box of type 'transport-stream-pat-box'. The PAT box is produced by parsePat; if it has not been encountered yet (or at all), every traversal that needs program associations fails.

Source

Thrown at packages/media-parser/src/containers/transport-stream/traversal.ts:14

import type {TransportStreamStructure} from '../../parse-result';
import type {TransportStreamPATBox, TransportStreamPMTBox} from './boxes';
import type {TransportStreamProgramAssociationTableEntry} from './parse-pat';
import type {TransportStreamEntry} from './parse-pmt';

const findProgramAssociationTableOrThrow = (
	structure: TransportStreamStructure,
) => {
	const box = structure.boxes.find(
		(b) => b.type === 'transport-stream-pat-box',
	);

	if (!box) {
		throw new Error('No PAT box found');
	}

	return box as TransportStreamPATBox;
};

export const findProgramMapOrNull = (structure: TransportStreamStructure) => {
	const box = structure.boxes.find(
		(b) => b.type === 'transport-stream-pmt-box',
	);

	if (!box) {
		return null;
	}

	return box as TransportStreamPMTBox;
};

export const findProgramMapTableOrThrow = (

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Re-mux the file: ffmpeg -i in.ts -c copy out.ts to regenerate the PAT.
  2. Ensure the input starts at a PAT packet (re-acquire from the source if needed).
  3. Validate with ffprobe that a PAT is present.
  4. File a bug with a sample if the stream contains a PAT but the library does not detect it.
Defensive patterns

Strategy: validation

Validate before calling

// Confirm a PAT packet is present before parsing
import {execSync} from 'node:child_process';
function hasTransportStreamPat(src: string): boolean {
  try { execSync(`ffprobe -v error -i "${src}" -t 1 -f null -`, {stdio: 'ignore'}); return true; } catch { return false; }
}

Try / catch

try { await parseMedia({src}); }
catch (e) {
  if (e instanceof Error && e.message === 'No PAT box found') {
    await runFfmpeg(['-i', src, '-c', 'copy', src + '.remux.ts']);
    await parseMedia({src: src + '.remux.ts'});
  } else throw e;
}

Prevention

When it happens

Trigger: findProgramAssociationTableOrThrow scans structure.boxes for the PAT type and throws if absent. Triggered when traversal runs before the PAT packet has been parsed, when the stream has no PAT (non-standard or corrupt), or when the PAT packet was dropped/lost.

Common situations: Partial captures missing the PAT packet; corrupt streams where the PAT PID (0x0000) carries no section; parser invoked too early before header packets are processed; non-conformant .ts files.

Related errors


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