Skip to content

fix(render): escape Windows path separators in the subtitles filter#79

Open
Pcecil21 wants to merge 1 commit into
browser-use:mainfrom
Pcecil21:fix/windows-subtitles-path
Open

fix(render): escape Windows path separators in the subtitles filter#79
Pcecil21 wants to merge 1 commit into
browser-use:mainfrom
Pcecil21:fix/windows-subtitles-path

Conversation

@Pcecil21

@Pcecil21 Pcecil21 commented Jun 19, 2026

Copy link
Copy Markdown

Problem

The subtitles= filter is built from an absolute path that escapes : and ' but leaves \ separators raw. On Windows the path is C:\Users\…\master.srt, so ffmpeg's filtergraph parser mangles the backslashes and subtitle burning fails. (Same class as the metadata=print:file= issue — filtergraph delimiters in a Windows path.)

Fix

Forward-slash the separators (ffmpeg accepts them on Windows) and escape the drive colon, via escape_subtitles_path / _escape_filter_value — e.g. C:\Users\…\master.srtC\:/Users/…/master.srt.

Adds tests/test_render_subtitles.py (cross-platform; passes on Windows and Linux). Verified on Windows: burning subtitles with an escaped path runs ffmpeg clean. No behavior change on macOS/Linux (no \ or drive colon to rewrite).


Summary by cubic

Fixes subtitle burning on Windows by escaping backslashes and the drive colon in subtitles= filter paths. ffmpeg now parses Windows paths correctly; POSIX behavior is unchanged.

  • Bug Fixes
    • Escape Windows paths in subtitles=: convert \ to /, and escape : and ' via escape_subtitles_path and _escape_filter_value.
    • Added tests/test_render_subtitles.py (cross-platform). Verified on Windows.

Written for commit c61e796. Summary will update on new commits.

Review in cubic

The subtitles= filter was built from an absolute path that escaped ':'
and "'" but left '\' separators raw. On Windows the path is
C:\Users\...\master.srt, so ffmpeg's filtergraph parser mangled the
backslashes and subtitle burning failed. Fix: forward-slash the
separators (ffmpeg accepts them on Windows) and escape the drive colon
via escape_subtitles_path / _escape_filter_value.

Adds tests/test_render_subtitles.py (cross-platform; passes on Windows
and Linux). Verified on Windows: burning subtitles with an escaped path
runs ffmpeg clean. No behavior change on macOS/Linux.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Re-trigger cubic

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