Skip to content

fix(desktop): videos/audio never indexed in packaged apps (0.5.1) - #1

Merged
RGB-loop merged 3 commits into
mainfrom
fix-video-enotdir
Oct 15, 2026
Merged

RGB-loop merged 3 commits into
mainfrom
fix-video-enotdir

Conversation

@RGB-loop

Copy link
Copy Markdown
Owner

Reported on V2EX: on macOS every video fails with spawn ENOTDIR.

Cause — require('ffmpeg-static') resolves to a path inside app.asar. Electron patches execFile for asar paths but not spawn, so in every packaged desktop build since 0.2.0 all video/audio indexing failed (ENOTDIR on macOS, ENOENT on Windows). Dev builds and the Docker image have no asar, which is why tests missed it.

Fix

  • Shared getFfmpegPath() (src/core/video/ffmpegPath.ts) maps the path to app.asar.unpacked; used by video, audio and capture.
  • On startup, videos that failed this way (spawn ENOTDIR/ENOENT, frame_count = 0) are reset and re-indexed automatically.
  • scripts/packaged-video-check.sh: indexes videos with the packaged app; run before each release.
  • Version 0.5.1 + CHANGELOG.

Verified

  • Published 0.5.0 dmg: 4 videos → 0 segments, 4× spawn ENOTDIR (reproduced).
  • Packaged 0.5.1, macOS: 4 videos (incl. silent) → 5 segments, 0 errors.
  • Upgrade 0.5.0 → 0.5.1 on the same data: 0 → 5 segments, errors cleared automatically.
  • Installed 0.5.1, Windows: 3 videos → 3 segments, 0 errors.
  • npm test 358 passed, test:db ok, typecheck clean.

…peg from app.asar.unpacked

require('ffmpeg-static') resolves inside app.asar; Electron patches execFile for asar
but not spawn, so every packaged release since 0.2.0 failed all video/audio with
spawn ENOTDIR (macOS) / ENOENT (Windows). Dev builds and Docker have no asar, so tests
missed it. Shared getFfmpegPath() maps to app.asar.unpacked; on startup, videos that
failed this way are reset and re-indexed. scripts/packaged-video-check.sh indexes
videos with the packaged app. Version 0.5.1.
… the ffmpeg binary skipped by --ignore-scripts
…e.runIf only skips tests) — move into beforeAll
@RGB-loop
RGB-loop merged commit d936db8 into main Oct 15, 2026
2 checks passed
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