mifi/lossless-cut · error · UserFacingError

Invalid EDL data found

Error message

Invalid EDL data found

What it means

Thrown at the end of the mplayer EDL parser when the aggregated output array (Cut, Mute, Scene Marker, and Commercial Break segments combined) is empty. The parser read the file and classified rows by type (0-3) but none produced a valid segment, so there is nothing to import. It is a guard against importing a syntactically-OK but semantically empty .edl file.

Source

Thrown at src/renderer/src/edlFormats.ts:198

    return [{ start, end, type }];
  });

  const cutAwaySegments = allRows.filter((row) => row.type === 0);
  const muteSegments = allRows.filter((row) => row.type === 1);
  const sceneMarkers = allRows.filter((row) => row.type === 2);
  const commercialBreaks = allRows.filter((row) => row.type === 3);

  const inverted = invertSegments(sortSegments(cutAwaySegments), true, true);

  const map = (segments: SegmentBase[], name: string, type: 0 | 1 | 2 | 3) => segments.map(({ start, end }) => ({ start, end, name, tags: { mplayerEdlType: String(type) } }));

  const out = [
    ...map(inverted, 'Cut', 0),
    ...map(muteSegments, 'Mute', 1),
    ...map(sceneMarkers, 'Scene Marker', 2),
    ...map(commercialBreaks, 'Commercial Break', 3),
  ];
  if (out.length === 0) throw new UserFacingError(i18n.t('Invalid EDL data found'));
  return out;
}

export async function parseEdlCmx3600(text: string, fps: number) {
  const cmx = parseCmx3600(text);

  const parseTimecode = (t: string) => {
    const match = t.match(/^(\d+)[:;](\d+)[:;](\d+)[:;](\d+)$/);
    invariant(match, `Invalid EDL line: ${t}`);
    const hours = parseInt(match[1]!, 10);
    const minutes = parseInt(match[2]!, 10);
    const seconds = parseInt(match[3]!, 10);
    const frames = parseInt(match[4]!, 10);
    return Duration.fromObject({ hours, minutes, seconds: seconds + (frames / fps) }).as('seconds');
  };

  return cmx.events.map((event) => ({
    start: parseTimecode(event.sourceIn),

View on GitHub (pinned to 3b9a59c288)

Solutions

  1. Open the .edl in a text editor and confirm it contains lines of the form 'start<TAB>end<TAB>type' with type in 0..3.
  2. If the file is actually a CMX3600 EDL, import it through the CMX path (parseEdlCmx3600) instead of the mplayer parser.
  3. Regenerate the EDL from the source application, ensuring at least one valid cut/mute/scene/commercial row.
  4. Verify there are no stray non-numeric characters or wrong delimiters in the start/end columns.
Defensive patterns

Strategy: validation

Validate before calling

// Heuristic: a mplayer EDL should have at least one numeric tab-separated row
export function looksLikeMplayerEdl(text: string): boolean {
  return /^\s*[\d.]+\s+\t\s+[\d.]+\s+\t\s+[0-3]\s*$/m.test(text) || text.split(/\r?\n/).some((l) => /^\s*[\d.]+\t[\d.]+\t[0-3]\s*$/.test(l));
}
if (!looksLikeMplayerEdl(text)) throw new Error('File does not look like an mplayer EDL');

Try / catch

try {
  return await parseMplayerEdl(text);
} catch (err) {
  if (err instanceof UserFacingError && /Invalid EDL data found/.test(err.message)) {
    showError('This EDL contains no valid cut/mute/scene/commercial entries.');
    return [];
  }
  throw err;
}

Prevention

When it happens

Trigger: Importing a .edl file that contains only comment lines, blank lines, or rows whose type field is outside 0-3; an .edl where all rows failed the start<=end or numeric-parsing internal filters; pointing the EDL importer at a file with the .edl extension that is actually a different format.

Common situations: Re-saving an mplayer EDL with an editor that stripped the tab-separated numeric columns; a file from a tool that uses a different EDL dialect (CMX3600 vs mplayer) but shares the .edl extension; an EDL exported for a different cut list that has zero actual cut entries.

Related errors


AI-assisted analysis of mifi/lossless-cut@3b9a59c288 (2026-08-12). Data as JSON: /api/errors/73210ba232253557. Report an issue: GitHub.