{"record":{"id":"2aa36689eb1f1318","repo":"remotion-dev/remotion","slug":"no-video-sample","errorCode":null,"errorMessage":"No video sample","messagePattern":"No video sample","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/media-parser/src/containers/iso-base-media/make-track.ts","lineNumber":120,"sourceCode":"\n\tif (!trakBoxContainsVideo(trakBox)) {\n\t\treturn {\n\t\t\ttype: 'other',\n\t\t\ttrackId: tkhdBox.trackId,\n\t\t\toriginalTimescale: timescaleAndDuration.timescale,\n\t\t\ttrakBox,\n\t\t\tstartInSeconds: startTimeInSeconds,\n\t\t\ttimescale: WEBCODECS_TIMESCALE,\n\t\t\ttrackMediaTimeOffsetInTrackTimescale:\n\t\t\t\tfindTrackMediaTimeOffsetInTrackTimescale({\n\t\t\t\t\ttrakBox,\n\t\t\t\t}),\n\t\t};\n\t}\n\n\tconst videoSample = getStsdVideoConfig(trakBox);\n\tif (!videoSample) {\n\t\tthrow new Error('No video sample');\n\t}\n\n\tconst sampleAspectRatio = getSampleAspectRatio(trakBox);\n\n\tconst aspectRatioApplied = applyAspectRatios({\n\t\tdimensions: videoSample,\n\t\tsampleAspectRatio,\n\t\tdisplayAspectRatio: getDisplayAspectRatio({\n\t\t\tsampleAspectRatio,\n\t\t\tnativeDimensions: videoSample,\n\t\t}),\n\t});\n\n\tconst {displayAspectHeight, displayAspectWidth, height, rotation, width} =\n\t\tapplyTkhdBox(aspectRatioApplied, tkhdBox);\n\n\tconst codec = getVideoCodecString(trakBox);\n","sourceCodeStart":102,"sourceCodeEnd":138,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/media-parser/src/containers/iso-base-media/make-track.ts#L102-L138","documentation":"Thrown by makeBaseMediaTrack() for a track identified as video. getStsdVideoConfig(trakBox) returned a falsy value, so no video sample description (dimensions + coded size from stsd) could be read. Without it the parser cannot establish width/height/coded dimensions, so it aborts.","triggerScenarios":"parseMedia({src}) on a video MP4/MOV whose trak has a corrupted, empty, or unsupported stsd video entry. Also fires when trakBoxContainsVideo is true but the stsd sample description box is missing or its FourCC is not one the parser recognises when extracting the video sample config.","commonSituations":"Files where the video track header exists but the sample description is stripped/truncated; 'video' tracks that are actually cover-art/hint/metadata tracks; non-standard or very new video codecs.","solutions":["Validate with ffprobe <file> to confirm a video stream with dimensions is reported.","Re-mux: ffmpeg -i in.mp4 -c:v copy out.mp4; if the codec is unsupported, transcode to H.264: ffmpeg -i in.mp4 -c:v libx264 -crf 20 out.mp4.","Use @remotion/mediabunny, which may recognise more sample-entry types.","Confirm the track is genuinely video and not a cover/hint track before parsing."],"exampleFix":"// before\nconst {dimensions} = await parseMedia({src, reader: nodeReader});\n\n// after\nconst dim = await parseMedia({src, reader: nodeReader}).then(\n  (r) => r.dimensions,\n  (err) => {\n    if (err instanceof Error && /No video sample/.test(err.message)) {\n      console.warn('Video sample description unreadable; re-mux or transcode with ffmpeg');\n      return null;\n    }\n    throw err;\n  },\n);","handlingStrategy":"try-catch","validationCode":"// Confirm a video stream with dimensions is reported before parsing:\n//   ffprobe -v error -select_streams v:0 -show_entries stream=width,height -of csv=s=x:p=0 in.mp4\nimport {execFileSync} from 'node:child_process';\nfunction videoSampleReadable(file: string): boolean {\n  try {\n    const out = execFileSync('ffprobe',\n      ['-v','error','-select_streams','v:0','-show_entries','stream=width,height','-of','csv=s=x:p=0', file],\n      {encoding: 'utf8'});\n    return /^\\d+x\\d+$/.test(out.trim());\n  } catch { return false; }\n}","typeGuard":"// No caller-side type guard: the stsd video sample entry is a deep binary\n// structure. parseMedia() input is a URL/File/Uint8Array.\n// => typeGuard: null","tryCatchPattern":"let dimensions: {width: number; height: number} | null = null;\ntry {\n  ({dimensions} = await parseMedia({src, reader: nodeReader}));\n} catch (err) {\n  if (err instanceof Error && /No video sample/.test(err.message)) {\n    dimensions = null; // video sample description unreadable\n  } else {\n    throw err;\n  }\n}","preventionTips":["Pre-validate with ffprobe that a video stream reports width×height.","Re-mux/transcode with ffmpeg if the codec or sample entry is unusual.","Migrate to @remotion/mediabunny (parseMedia is deprecated).","Guard every parseMedia() call against untrusted inputs."],"tags":["mp4","iso-base-media","media-parser","video","corrupt-file","stsd","codec"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}