{"record":{"id":"7b3bc6387653d051","repo":"remotion-dev/remotion","slug":"no-stream-found","errorCode":null,"errorMessage":"No stream found","messagePattern":"No stream found","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/media-parser/src/containers/transport-stream/process-stream-buffers.ts","lineNumber":112,"sourceCode":"\tonVideoTrack,\n\ttransportStream,\n\tmakeSamplesStartAtZero,\n\tavcState,\n}: {\n\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,","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/media-parser/src/containers/transport-stream/process-stream-buffers.ts#L94-L130","documentation":"Thrown by processStreamBuffer at process-stream-buffers.ts:112 when getStreamForId returns null for the given programId. getStreamForId looks up the PID in the PMT's streams array, so a null result means the PID is not declared in the parsed PMT.","triggerScenarios":"processStreamBuffer calls getStreamForId(structure, programId) and throws on null. Triggered when a transport packet for an undeclared PID reaches processing (e.g. a PID added after the PMT, a private-stream PID, or corruption that rewrites the PID).","commonSituations":"PMT that does not list all carried PIDs; PID remapping mid-stream; corrupt packet headers; multi-program streams where the wrong program's PID is processed.","solutions":["Re-mux the file: ffmpeg -i in.ts -c copy out.ts to ensure PMT lists every PID.","Filter to a single program before parsing (ffmpeg -i in.ts -map 0:p:123 -c copy out.ts).","Verify with ffprobe that the PID is declared in the PMT.","File a bug if the stream plays in ffprobe but fails here."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Verify every elementary PID is declared in the PMT\nimport {execSync} from 'node:child_process';\nfunction pmtListsAllPids(src: string): boolean {\n  try { execSync(`ffprobe -v error -i \"${src}\" -t 5 -f null -`, {stdio: 'ignore'}); return true; } catch { return false; }\n}","typeGuard":null,"tryCatchPattern":"try { await parseMedia({src}); }\ncatch (e) {\n  if (e instanceof Error && e.message === 'No stream found') {\n    // undeclared PID - re-mux to a single program\n    await runFfmpeg(['-i', src, '-map', '0:v:0', '-map', '0:a:0', '-c', 'copy', out]);\n    await parseMedia({src: out});\n  } else throw e;\n}","preventionTips":["Filter multi-program transport streams to a single program before parsing.","Re-mux with ffmpeg to normalize PMT declarations.","Validate with ffprobe that all PIDs are declared."],"tags":["media-parser","transport-stream","mpegts","pmt","pid","validation"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}