Skip to content

Bug: positioned-video clips contribute ~0s to output duration (regression of #62 / #123) #231

Description

@SecurityQQ

Found while restoring test fixtures in #230. Both #62 and #123 are closed, but their regression tests never actually ran — they died on a missing gitignored fixture long before reaching their assertions, so the regression went unnoticed.

Evidence

Two compositions, identical except for the middle clip's layers (local backend, ffmpeg 7.x):

const wrap = (mid) => [
  { duration: 2, layers: [{ type: "fill-color", color: "#ff0000" }] },
  mid,
  { duration: 2, layers: [{ type: "fill-color", color: "#0000ff" }] },
];

// middle = fill-color            -> 5s  ✅ (6s minus 2x default 0.5s transition)
// middle = fill + 2 positioned   -> 4s  ❌ (positioned clip contributes ~0s)

Reproduced without any transitions too: 3 clips x 2s = 4s instead of 6s when the middle clip holds positioned videos.

A clip whose only layer is a positioned video still throws:

Clip 0 produced no video output — ensure it has at least one visual layer (video, image, or fill-color)

That is precisely the #123 symptom. It occurs whether or not a fill-color base layer is present, so it is broader than the "no base layer" case #123 described.

Impact

<Split> / <Slot> / Grid layouts inside a <Clip> silently lose their clip's duration, shortening the final video. This is the exact user-facing symptom of #62.

Current state

The two regression tests are marked test.failing in src/ai-sdk/providers/editly/editly.test.ts (PR #230), so they:

  • keep the correct expectation encoded in the assertion, and
  • fail loudly the moment the bug is fixed, forcing the marker's removal.

They are NOT skipped, and this is NOT fixed in #230 — that PR is scoped to the opentype.js crash and fixture restoration.

Suggested starting point

buildBaseClipFilter / the positioned-overlay path in src/ai-sdk/providers/editly/index.ts — the same code #123 touched. Likely the clip's base segment is emitted with zero duration when all its layers are classified as overlays.

Repro

bun test src/ai-sdk/providers/editly/editly.test.ts -t "issue #62: positioned videos"
bun test src/ai-sdk/providers/editly/editly.test.ts -t "issue #123: clip with only positioned"

(Remove .failing to see them fail.)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions