remotion-dev/remotion · error · Error
H.262 video stream not supported
Error message
H.262 video stream not supported
What it means
Thrown by processStreamBuffer at process-stream-buffers.ts:117 when the PMT declares stream_type=2 (ITU-T H.262 / MPEG-2 Video or MPEG-1 constrained video). The library only implements handlers for stream_type=27 (H.264/AVC) and stream_type=15 (AAC), so H.262 video is explicitly rejected.
Source
Thrown at packages/media-parser/src/containers/transport-stream/process-stream-buffers.ts:117
streamBuffer: TransportStreamPacketBuffer;
programId: number;
structure: TransportStreamStructure;
sampleCallbacks: CallbacksState;
logLevel: MediaParserLogLevel;
onAudioTrack: MediaParserOnAudioTrack | null;
onVideoTrack: MediaParserOnVideoTrack | null;
transportStream: TransportStreamState;
makeSamplesStartAtZero: boolean;
avcState: AvcState;
}) => {
const stream = getStreamForId(structure, programId);
if (!stream) {
throw new Error('No stream found');
}
// 2 = ITU-T Rec. H.262 | ISO/IEC 13818-2 Video or ISO/IEC 11172-2 constrained parameter video stream
if (stream.streamType === 2) {
throw new Error('H.262 video stream not supported');
}
// 27 = AVC / H.264 Video
if (stream.streamType === 27) {
await handleAvcPacket({
programId,
streamBuffer,
sampleCallbacks,
logLevel,
onVideoTrack,
offset: streamBuffer.offset,
transportStream,
makeSamplesStartAtZero,
avcState,
});
}
// 15 = AAC / ADTS
else if (stream.streamType === 15) {View on GitHub (pinned to 78fe4bb3fd)
Solutions
- Transcode the video to H.264: ffmpeg -i in.ts -c:v libx264 -c:a aac out.mp4.
- Use a different container/codec that the library supports.
- File a feature request on @remotion/media-parser if MPEG-2 support is required.
- Pre-screen inputs with ffprobe to reject H.262 streams early.
Example fix
// before
await parseMedia({src: mpeg2Url});
// after - transcode to H.264 first
await runFfmpeg(['-i', mpeg2Url, '-c:v', 'libx264', '-preset', 'fast', '-c:a', 'aac', outMp4]);
await parseMedia({src: outMp4}); Defensive patterns
Strategy: validation
Validate before calling
// Reject MPEG-2 / H.262 video upstream
import {execSync} from 'node:child_process';
function isH264(src: string): boolean {
try {
const out = execSync(`ffprobe -v error -select_streams v -show_entries stream=codec_name -of csv=p=0 "${src}"`).toString().trim();
return out === 'h264';
} catch { return false; }
} Try / catch
try { await parseMedia({src}); }
catch (e) {
if (e instanceof Error && e.message === 'H.262 video stream not supported') {
// transcode to H.264
await runFfmpeg(['-i', src, '-c:v', 'libx264', '-preset', 'fast', '-c:a', 'copy', out]);
await parseMedia({src: out});
} else throw e;
} Prevention
- Pre-screen video codec with ffprobe before parsing.
- Transcode legacy MPEG-2 content to H.264.
- Surface a clear 'unsupported codec' error to users.
When it happens
Trigger: processStreamBuffer checks stream.streamType === 2 and throws before dispatching to any handler. Triggered by MPEG-2 video transport streams (e.g. DVD VOB, broadcast TV, older satellite captures).
Common situations: Legacy broadcast content; DVD/VOB sources; older satellite/cable captures; security camera footage encoded in MPEG-2.
Related errors
- cannot process avc stream
- Invalid table ID: ${tableId}
- Invalid section length
- Unexpected PES packet start code: ${ident.toString(16)}
- Invalid marker bits: ${markerBits}
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/3d8a7bacb8f5a747.
Report an issue: GitHub.