fix(render): escape Windows path separators in the subtitles filter#79
Open
Pcecil21 wants to merge 1 commit into
Open
fix(render): escape Windows path separators in the subtitles filter#79Pcecil21 wants to merge 1 commit into
Pcecil21 wants to merge 1 commit into
Conversation
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.
This was referenced Jun 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
subtitles=filter is built from an absolute path that escapes:and'but leaves\separators raw. On Windows the path isC:\Users\…\master.srt, so ffmpeg's filtergraph parser mangles the backslashes and subtitle burning fails. (Same class as themetadata=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.srt→C\:/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.subtitles=: convert\to/, and escape:and'viaescape_subtitles_pathand_escape_filter_value.tests/test_render_subtitles.py(cross-platform). Verified on Windows.Written for commit c61e796. Summary will update on new commits.