{"record":{"id":"3d8a7bacb8f5a747","repo":"remotion-dev/remotion","slug":"h-262-video-stream-not-supported","errorCode":null,"errorMessage":"H.262 video stream not supported","messagePattern":"H\\.262 video stream not supported","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/media-parser/src/containers/transport-stream/process-stream-buffers.ts","lineNumber":117,"sourceCode":"\tstreamBuffer: TransportStreamPacketBuffer;\n\tprogramId: number;\n\tstructure: TransportStreamStructure;\n\tsampleCallbacks: CallbacksState;\n\tlogLevel: MediaParserLogLevel;\n\tonAudioTrack: MediaParserOnAudioTrack | null;\n\tonVideoTrack: MediaParserOnVideoTrack | null;\n\ttransportStream: TransportStreamState;\n\tmakeSamplesStartAtZero: boolean;\n\tavcState: AvcState;\n}) => {\n\tconst stream = getStreamForId(structure, programId);\n\tif (!stream) {\n\t\tthrow new Error('No stream found');\n\t}\n\n\t// 2 = ITU-T Rec. H.262 | ISO/IEC 13818-2 Video or ISO/IEC 11172-2 constrained parameter video stream\n\tif (stream.streamType === 2) {\n\t\tthrow new Error('H.262 video stream not supported');\n\t}\n\n\t// 27 = AVC / H.264 Video\n\tif (stream.streamType === 27) {\n\t\tawait handleAvcPacket({\n\t\t\tprogramId,\n\t\t\tstreamBuffer,\n\t\t\tsampleCallbacks,\n\t\t\tlogLevel,\n\t\t\tonVideoTrack,\n\t\t\toffset: streamBuffer.offset,\n\t\t\ttransportStream,\n\t\t\tmakeSamplesStartAtZero,\n\t\t\tavcState,\n\t\t});\n\t}\n\t// 15 = AAC / ADTS\n\telse if (stream.streamType === 15) {","sourceCodeStart":99,"sourceCodeEnd":135,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/media-parser/src/containers/transport-stream/process-stream-buffers.ts#L99-L135","documentation":"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.","triggerScenarios":"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).","commonSituations":"Legacy broadcast content; DVD/VOB sources; older satellite/cable captures; security camera footage encoded in MPEG-2.","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."],"exampleFix":"// before\nawait parseMedia({src: mpeg2Url});\n\n// after - transcode to H.264 first\nawait runFfmpeg(['-i', mpeg2Url, '-c:v', 'libx264', '-preset', 'fast', '-c:a', 'aac', outMp4]);\nawait parseMedia({src: outMp4});","handlingStrategy":"validation","validationCode":"// Reject MPEG-2 / H.262 video upstream\nimport {execSync} from 'node:child_process';\nfunction isH264(src: string): boolean {\n  try {\n    const out = execSync(`ffprobe -v error -select_streams v -show_entries stream=codec_name -of csv=p=0 \"${src}\"`).toString().trim();\n    return out === 'h264';\n  } catch { return false; }\n}","typeGuard":null,"tryCatchPattern":"try { await parseMedia({src}); }\ncatch (e) {\n  if (e instanceof Error && e.message === 'H.262 video stream not supported') {\n    // transcode to H.264\n    await runFfmpeg(['-i', src, '-c:v', 'libx264', '-preset', 'fast', '-c:a', 'copy', out]);\n    await parseMedia({src: out});\n  } else throw e;\n}","preventionTips":["Pre-screen video codec with ffprobe before parsing.","Transcode legacy MPEG-2 content to H.264.","Surface a clear 'unsupported codec' error to users."],"tags":["media-parser","transport-stream","mpegts","video","h262","mpeg2","unsupported-codec"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}