Fix subtitle path escaping on Windows in render.py - #128
Open
flavioengenharia04-cloud wants to merge 1 commit into
Open
Fix subtitle path escaping on Windows in render.py#128flavioengenharia04-cloud wants to merge 1 commit into
flavioengenharia04-cloud wants to merge 1 commit into
Conversation
The subtitles filter only escaped colons in the SRT path, leaving raw backslashes from Windows absolute paths (e.g. C:\Users\...\master.srt) unescaped. ffmpeg's filtergraph parser treats backslash as an escape character too, so the resulting filter string was malformed and build_final_composite failed whenever subtitles were requested on Windows. Convert backslashes to forward slashes before escaping the drive-letter colon, which ffmpeg's subtitles filter accepts on Windows and avoids the double-escaping problem entirely.
DarkStyleee
added a commit
to DarkStyleee/video-use
that referenced
this pull request
Aug 20, 2026
…font on Windows Three small Windows failures, none of them covered by browser-use#131 or browser-use#128. grade.py passed a temp file path straight into metadata=print:file=. Inside a filter option value the drive colon reads as an option separator, so ffmpeg reports "No option name near 'UsersRunner...'" and the analysis dies before a single frame is sampled. The path is now escaped the way render.py already escapes the subtitles path. Verified with --analyze on a real capture: the filter it computes is byte-identical to the one from a run where the path parses. render.py and timeline_view.py read the transcript and the EDL with read_text(), which decodes with the locale codepage. This does not raise on a non-ASCII transcript, which would at least be visible. On cp1251 it returns mojibake: "привет" comes back as "Рїсђрёрірес‚", and the subtitles are built from that. Both files are JSON, so UTF-8 is the only correct decoding. FONT_CANDIDATES listed macOS and Linux paths only. load_font falls back to ImageFont.load_default(), so the timeline still renders, in a bitmap font at a fixed size. Consolas and Arial appended.
This was referenced Aug 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.
Summary
build_final_composite's subtitles filter only escaped colons in the SRT path, leaving raw backslashes (e.g.C:\Users\...\master.srt) unescaped.subtitles='...'filter string was malformed and the render failed with a non-zero exit whenever--build-subtitles(or any EDL with asubtitlespath) was used on Windows.subtitlesfilter accepts forward slashes on Windows, which sidesteps the double-escaping problem entirely.Test plan
render.py --build-subtitlesagainst a Windows absolute path EDL — composite step failed with aCalledProcessErrorfrom thesubtitles=filter.🤖 Generated with Claude Code
Summary by cubic
Fix Windows subtitle path escaping in the ffmpeg filter to stop renders from failing when using
--build-subtitlesor EDL subtitles.Written for commit 5e9c4f7. Summary will update on new commits.