remotion-dev/remotion · error
No tracks yet
Error message
No tracks yet
What it means
Thrown by getAudioCodec(parserState) when getTracks() has returned an empty array, i.e. the parser has not yet discovered any tracks in the container. The function needs at least one track to look for an audio track; with zero tracks it throws rather than returning a misleading null (null is reserved for 'tracks exist but none are audio').
Source
Thrown at packages/media-parser/src/get-audio-codec.ts:20
import type {EsdsBox} from './containers/iso-base-media/esds/esds';
import type {AudioSample} from './containers/iso-base-media/stsd/samples';
import type {TrakBox} from './containers/iso-base-media/trak/trak';
import {getStsdBox} from './containers/iso-base-media/traversal';
import {
getHasTracks,
getTracks,
type MediaParserAudioCodec,
} from './get-tracks';
import type {AnySegment} from './parse-result';
import type {ParserState} from './state/parser-state';
export const getAudioCodec = (
parserState: ParserState,
): MediaParserAudioCodec | null => {
const tracks = getTracks(parserState, true);
if (tracks.length === 0) {
throw new Error('No tracks yet');
}
const audioTrack = tracks.find((t) => t.type === 'audio');
if (!audioTrack) {
return null;
}
if (audioTrack.type === 'audio') {
return audioTrack.codecEnum;
}
return null;
};
export const hasAudioCodec = (state: ParserState): boolean => {
return getHasTracks(state, true);
};
View on GitHub (pinned to 78fe4bb3fd)
Solutions
- Wait for the 'tracks' event (or check hasAudioCodec(state)) before calling getAudioCodec.
- Guard with getTracks(parserState, true).length > 0 before invocation.
- Confirm the container actually contains tracks; for non-AV containers the call is not meaningful.
Example fix
// before
const codec = getAudioCodec(parserState);
// after
if (getTracks(parserState, true).length > 0) {
const codec = getAudioCodec(parserState);
} else {
// wait for tracks event
} Defensive patterns
Strategy: validation
Validate before calling
import {getTracks} from '@remotion/media-parser/get-tracks';
if (getTracks(parserState, true).length > 0) {
const codec = getAudioCodec(parserState);
} Type guard
null
Try / catch
try { getAudioCodec(parserState); } catch (e) { if (e.message === 'No tracks yet') { /* wait for tracks event */ } else throw e; } Prevention
- Call getAudioCodec only after the 'tracks' event.
- Use hasAudioCodec(state) to check readiness.
- Do not read codec synchronously at parse start.
When it happens
Trigger: Calling getAudioCodec during early parsing before the moov/segment-info has been processed. Calling it on a structure that has no tracks at all (e.g. a metadata-only file or wrong container type).
Common situations: Reading codec info synchronously right after parseMedia starts, before the 'tracks' event fires. Inspecting state in a custom reader/seeker before tracks are populated. Passing a parserState captured from a different (track-less) phase.
Related errors
- Cannot render an image sequence with a codec that renders no
- Cannot change the behavior for pre-mounting audio tags dynam
- `_experimentalKeepAudioContextAlive` cannot be changed dynam
- The number of shared audio tags has changed dynamically. Onc
- Changing the AudioContext sample rate dynamically is not sup
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/2ced463df3bb3134.
Report an issue: GitHub.