{"record":{"id":"81a627d3db2e6c35","repo":"remotion-dev/remotion","slug":"no-bitrate-info","errorCode":null,"errorMessage":"No bitrate info","messagePattern":"No bitrate info","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/media-parser/src/containers/mp3/parse-mpeg-header.ts","lineNumber":120,"sourceCode":"\t\t\t\ttimescale: WEBCODECS_TIMESCALE,\n\t\t\t\ttrackMediaTimeOffsetInTrackTimescale: 0,\n\t\t\t},\n\t\t\tregisterAudioSampleCallback: state.callbacks.registerAudioSampleCallback,\n\t\t\ttracks: state.callbacks.tracks,\n\t\t\tlogLevel: state.logLevel,\n\t\t\tonAudioTrack: state.onAudioTrack,\n\t\t});\n\t\tstate.callbacks.tracks.setIsDone(state.logLevel);\n\n\t\tstate.mediaSection.addMediaSection({\n\t\t\tstart: initialOffset,\n\t\t\tsize: state.contentLength - initialOffset,\n\t\t});\n\t}\n\n\tconst bitrateInfo = state.mp3.getMp3BitrateInfo();\n\tif (!bitrateInfo) {\n\t\tthrow new Error('No bitrate info');\n\t}\n\n\tconst sample =\n\t\tbitrateInfo.type === 'constant'\n\t\t\t? getAudioSampleFromCbr({\n\t\t\t\t\tbitrateInKbit,\n\t\t\t\t\tdata,\n\t\t\t\t\tinitialOffset,\n\t\t\t\t\tlayer,\n\t\t\t\t\tsampleRate,\n\t\t\t\t\tsamplesPerFrame,\n\t\t\t\t\tstate,\n\t\t\t\t})\n\t\t\t: getAudioSampleFromVbr({\n\t\t\t\t\tdata,\n\t\t\t\t\tinfo: bitrateInfo,\n\t\t\t\t\tmp3Info: state.mp3.getMp3Info(),\n\t\t\t\t\tposition: initialOffset,","sourceCodeStart":102,"sourceCodeEnd":138,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/media-parser/src/containers/mp3/parse-mpeg-header.ts#L102-L138","documentation":"Thrown by `parseMpegHeader` when, after parsing a frame, `state.mp3.getMp3BitrateInfo()` returns null/falsy. The bitrate info should have been set earlier in the flow (either as CBR via `setMp3BitrateInfo` or VBR via Xing); reaching this point with no bitrate info indicates an internal state inconsistency.","triggerScenarios":"Reached in `parse-mpeg-header.ts:118-121` when `state.callbacks.tracks.getTracks().length` was non-zero (i.e., not the first frame) and the bitrate info was never set, or when the first-frame branch returned early (`Info` header detected at line 62-64) without setting bitrate info and then continued to line 118.","commonSituations":"An MP3 file with an `Info` (non-VBR CBR marker) header that causes the first-frame branch to return early at line 63, but the bitrate info was never populated, and subsequent frames reach the bitrate-info check. Internal logic bugs where `setMp3BitrateInfo` is skipped. Edge-case files that trigger unusual control flow.","solutions":["Re-encode the MP3 file with a standard encoder (LAME via ffmpeg) to produce a well-formed file.","If the file has an `Info` tag instead of `Xing`, re-encode to ensure proper header structure.","Report the file at remotion.dev/report as it may represent an unhandled edge case.","Wrap `parseMedia` in try-catch and fall back to a re-encoded version of the file."],"exampleFix":"# re-encode to produce a clean MP3\nffmpeg -i input.mp3 -codec:a libmp3lame -b:a 192k output.mp3","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await parseMedia({src, fields: {durationInSeconds: true}});\n} catch (e) {\n  if (e instanceof Error && e.message === 'No bitrate info') {\n    console.error('Internal parser state error. The MP3 may have an unusual header structure.');\n  }\n  throw e;\n}","preventionTips":["Re-encode unusual MP3 files with a standard encoder (LAME via ffmpeg).","Avoid MP3 files with Info tags if they cause parsing issues; use Xing or pure CBR.","Report files that trigger this at remotion.dev/report.","Validate files with ffprobe before parsing."],"tags":["mp3","internal-state","corrupt-file","bitrate","edge-case"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}