Skip to content

fix: resolve issues #36, #37, #47 (release 0.9.0)#58

Merged
TMHSDigital merged 4 commits into
mainfrom
fix/issues-36-37-47
Jul 3, 2026
Merged

fix: resolve issues #36, #37, #47 (release 0.9.0)#58
TMHSDigital merged 4 commits into
mainfrom
fix/issues-36-37-47

Conversation

@TMHSDigital

Copy link
Copy Markdown
Owner

Summary

Implements the three open, well-scoped issues from the tracker:

  • Bug: odd output dimensions cause a cryptic encoder error in re-encode tools (crop/scale/assemble_highlights/title_card) #47 — odd output dimensions in re-encode tools. scale, crop, xfade_transition, assemble_highlights, and title_card now reject an explicit odd width/height with a clear message (naming the nearest even values) instead of dying with a cryptic libx264 "not divisible by 2" tail. Shared validateEvenDimension guard in src/utils/validate.ts; rejection (not rounding) per the issue's preference, since the caller asked for an exact size. Defaults and -2 auto-sides unaffected.
  • Bug: extract_audio 'copy' writes a broken file for non-mp4 audio codecs #36extract_audio format:"copy" container. The blanket .m4a wrote a broken file for non-mp4 codecs. copy now probes the source codec and maps it to a compatible container (aac/alac → m4a, mp3 → mp3, opus/vorbis → ogg, flac → flac, pcm → wav, else → mka), errors up front on an input with no audio stream, and returns sourceAudioCodec.
  • Enhancement: tools silently overwrite an existing output path #37 — silent output overwrite. resolveOutput now refuses a caller-supplied path that already exists unless the new optional overwrite: true is passed; unique auto-generated defaults are unchanged. Wired through all 19 tools with an output parameter and mirrored in mcp-tools.json. Minor version bump (0.9.0) since this changes default behavior for explicit output paths.

Testing

  • npm run build, npm run typecheck, npm run lint, npm test — 159 passed / 6 skipped, including 11 new unit tests (even-dimension rejection across all five builders, the codec→container map, and the overwrite guard incl. default-path exemption).
  • Runtime smoke over MCP stdio against real ffmpeg 8.1.1, all passing: repeated screenshot to the same explicit path refused then allowed with overwrite: true; scale width:101 rejected with the even-dimension message while width:100 succeeds; extract_audio copy on an opus source produced a playable .ogg with sourceAudioCodec: "opus"; copy on a video-only recording errors with "no audio stream".

Fixes #47. Fixes #36. Closes #37.

🤖 Generated with Claude Code

TMHSDigital and others added 4 commits July 3, 2026 12:30
scale, crop, xfade_transition, assemble_highlights, and title_card let
an explicit odd width/height reach libx264 + yuv420p, which fails with
a cryptic "not divisible by 2" tail. A shared validateEvenDimension
guard now rejects the value up front and suggests the nearest even
sizes. Fixes #47.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The blanket .m4a container cannot hold opus/vorbis/etc and wrote a
broken file. copy now probes the source audio codec first, maps it to a
compatible container (m4a/mp3/ogg/flac/wav, .mka as the catch-all),
errors clearly when the input has no audio stream, and reports
sourceAudioCodec in the result. Fixes #36.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Every ffmpeg builder runs with -y, so a caller-supplied output path
that already existed was silently clobbered. resolveOutput now refuses
an existing path with a clear error unless the tool call passes the new
optional overwrite flag; unique auto-generated default paths are
unaffected. Wired through all 19 tools with an output parameter and
mirrored in mcp-tools.json. Closes #37.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@TMHSDigital TMHSDigital merged commit f4c8686 into main Jul 3, 2026
8 checks passed
@TMHSDigital TMHSDigital deleted the fix/issues-36-37-47 branch July 3, 2026 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant