remotion-dev/remotion · error · Error

Error in Media Parser: End of parsing of ${src} has been rea

Error message

Error in Media Parser: End of parsing of ${src} has been reached, but no tracks have been found 

What it means

Thrown by ensureHasTracksAtEnd when the parser reached end-of-file while the caller requested tracks (fields.tracks) but no tracks were ever emitted (doneWithTracks stayed false) and the canSkipTracks optimization does not apply. It signals the media was fully consumed without the parser recognizing any track boxes/atoms.

Source

Thrown at packages/media-parser/src/state/has-tracks-section.ts:44

			doneWithTracks = true;
		},
		addTrack: (track: MediaParserTrack) => {
			tracks.push(track);
		},
		getTracks: () => {
			return tracks;
		},
		ensureHasTracksAtEnd: (fields: Options<ParseMediaFields>) => {
			if (canSkipTracksState.canSkipTracks()) {
				return;
			}

			if (!fields.tracks) {
				return;
			}

			if (!doneWithTracks) {
				throw new Error(
					'Error in Media Parser: End of parsing of ' +
						src +
						' has been reached, but no tracks have been found ',
				);
			}
		},
	};
};

export type TracksState = ReturnType<typeof makeTracksSectionState>;

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Verify the input is actually a media file in a supported container before requesting tracks.
  2. For mp4 over a network, ensure the moov atom is fetched (faststart/moov-at-front); re-mux if needed.
  3. Handle the error and fall back to a different source or skip the tracks field if it is optional for your use case.

Example fix

// before
await parseMedia({ src, fields: { tracks: true } }); // throws on trackless file

// after
try {
  const { tracks } = await parseMedia({ src, fields: { tracks: true } });
} catch (e) {
  if (String(e.message).includes('no tracks have been found')) {
    // not a usable media file; handle gracefully
  } else throw e;
}
Defensive patterns

Strategy: try-catch

Validate before calling

import { statSync } from 'node:fs';
function looksLikeMedia(src: string): boolean {
  try { statSync(src); } catch { return false; }
  return /\.(mp4|mov|webm|mkv|mp3|wav|m4a|aac)$/i.test(src);
}
looksLikeMedia(src);

Type guard

const isLikelyMedia = (s: string) => /\.(mp4|mov|webm|mkv|mp3|wav|m4a|aac)$/i.test(s);

Try / catch

try { const { tracks } = await parseMedia({ src, fields: { tracks: true } }); } catch (e) { if (/no tracks have been found/.test(String((e as Error).message))) { /* not a usable media file - handle */ } else throw e; }

Prevention

When it happens

Trigger: Calling parseMedia with fields including tracks on a file that has no recognizable tracks: a non-media file, a truncated/corrupt file, a container the parser does not fully understand, or a file where the moov/trak boxes are missing or after EOF.

Common situations: Pointing parseMedia at a text file, image, or HTML by mistake. A partially downloaded media where the moov atom (mp4) was never fetched. Files with non-standard box layouts. Network truncation when range requests are unsupported.

Related errors


AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12). Data as JSON: /api/errors/0ade441bcfe42414. Report an issue: GitHub.