Skip to content

fix(ffmpeg): preserve paths through filter and concat parsers - #40

Merged
yultyyev merged 1 commit into
MakeMyClip:fix/ffmpeg-path-escapingfrom
eliasruntime:fix/filter-option-escaping
Oct 29, 2026
Merged

yultyyev merged 1 commit into
MakeMyClip:fix/ffmpeg-path-escapingfrom
eliasruntime:fix/filter-option-escaping

Conversation

@eliasruntime

Copy link
Copy Markdown
Contributor

On native Windows, a normal drive-qualified workspace makes clip add_text / add_captions in the published 0.3.0 package fail before drawing, with Both text and text file provided. The filtergraph parser consumes the outer quotes, leaving the drive colon exposed to the filter-option parser. Apostrophes in filenames also need to survive both layers.

Escape filter-option colons, quotes and backslashes before quoting for the filtergraph. Keep concat-list paths on a separate single-layer quoting path so a filter fix does not corrupt filenames in the concat demuxer. Refuse line breaks/NUL that cannot be represented as one concat-list line. Replace the misleading simulated parser test and add real FFmpeg coverage under tests/integration.

Validation on Windows / Node 24.19.0:

  • 129 targeted tests pass; repository lint and both TypeScript checks pass (existing lint warnings remain).
  • Actual patched-source add_text and concat calls pass in a workspace containing a drive letter, apostrophe, spaces, comma, brackets and semicolon, using FFmpeg 6.1.1.
  • The full Windows suite has four existing platform failures: one POSIX-only expected path and three symlink-creation EPERM errors. The same four failures were reproduced with the unmodified upstream source; this patch does not claim to fix them.

This is a draft pending hosted validation. The real-FFmpeg regression cases are CI-only under the repository convention. Please approve the fork workflow when appropriate so those Linux checks can run. The separate multi-track export and still-image duration limitations found during the task are outside this patch.

Submitted by Codex for Codex Improvement Lab under the maintainer's authorization.

@yultyyev
yultyyev changed the base branch from main to fix/ffmpeg-path-escaping October 29, 2026 16:54
@yultyyev
yultyyev marked this pull request as ready for review October 29, 2026 16:54
@yultyyev
yultyyev merged commit f1ea3df into MakeMyClip:fix/ffmpeg-path-escaping Oct 29, 2026
yultyyev added a commit that referenced this pull request Oct 29, 2026
Builds on #40. A filter option value is read twice: the filtergraph
parser strips one layer of quoting, then the option parser splits on
`:` and strips another. `quoteFilterArg` now escapes for the option
parser first and quotes that for the graph parser, so Windows drive
colons, apostrophes and `[],;` survive, and a value can no longer
close its quote and add a filter. It also escapes edge whitespace,
which the option parser otherwise trims (a file name ending in a
space was not found).

Concat-list paths get their own single-layer `quoteConcatPath`; a
path with a line break or NUL throws `ConcatPathError` naming it.

Tests read escaped output back through a port of FFmpeg's
`av_get_token` instead of comparing strings, and CI-only tests run
the cases through the real FFmpeg binary.

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

Copy link
Copy Markdown

🎉 This PR is included in version 0.3.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@yultyyev

yultyyev commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

On native Windows, a normal drive-qualified workspace makes clip add_text / add_captions in the published 0.3.0 package fail before drawing, with Both text and text file provided. The filtergraph parser consumes the outer quotes, leaving the drive colon exposed to the filter-option parser. Apostrophes in filenames also need to survive both layers.

Thanks @eliasruntime. This shipped in v0.3.1.

It went in through #43, which keeps your escaping and adds edge-whitespace handling, parse-back tests against a port of FFmpeg's av_get_token, and Linux CI coverage through the movie filter.

Windows was only checked through that parser port, so a re-run of your repro on 0.3.1 would confirm the drive-colon fix. Issues for the Windows test failures and the multi-track and still-image limits you found are welcome.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants