Skip to content

fix(media-local): report an ExtractFrame time past the end of the stream - #429

Open
rudycelekli wants to merge 1 commit into
hypit-ai:mainfrom
rudycelekli:fix/extract-frame-time-bounds
Open

rudycelekli wants to merge 1 commit into
hypit-ai:mainfrom
rudycelekli:fix/extract-frame-time-bounds

Conversation

@rudycelekli

@rudycelekli rudycelekli commented Oct 19, 2026 •

Copy link
Copy Markdown

An ExtractFrame whose at is time:<seconds> past the end of the selected video stream fails with a raw filesystem error that names a temporary file:

Error: ENOENT: no such file or directory, open '/var/folders/…/hypit-media-extract-frame-KUC4Ff/frame.png'

frame:N is checked against the stream's frame count when the Producer plans the Need ("Frame N is outside the selected stream"), but a time is not. ffmpeg's select=gte(t,…) matches no frame, ffmpeg exits successfully without writing an image, and readFile on the missing output is what fails. The message does not say that the requested time was the problem.

When the output image is missing, the execution now reports Frame extraction found no frame at <seconds>s; the time is past the end of the selected stream (or a general "found no frame" for other selections), with the original error as cause. Other read failures are rethrown unchanged. This changes only the error message: no extraction that succeeds today behaves differently.

The new packages/media-local/test/extract-frame.test.ts makes a 1-second clip, extracts at 0.5 s, and checks the message for 5 s. It needs ffmpeg and skips without it, like the other media-local tests. It fails on main (FFmpeg 8.0 locally) and passes with the change.

Checks run:

  • node --import tsx --test packages/media-local/test/extract-frame.test.ts packages/media-local/test/alpha.test.ts

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant