fix(render): escape apostrophes in concat demuxer list#54
Open
sidorovanthon wants to merge 1 commit into
Open
Conversation
concat_segments wrote each segment path into the ffmpeg concat list as `file '<path>'`. A literal apostrophe in the path (e.g. a videos folder whose name contains "couldn't") closes the single-quoted string early, so ffmpeg parses a truncated path and the concat step fails with a non-zero exit -- while the per-segment extracts all succeed, which makes it look like the cut worked right up until the join. Escape ' as '\'' (close quote, escaped quote, reopen quote), the quoting the concat demuxer line format expects. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
concat_segmentsinhelpers/render.pywrites the ffmpeg concat-demuxer list as:When the resolved path contains a literal apostrophe — which is common for English video-folder names (e.g.
2026-03-12 What else I couldn't yet do with the help of AI/) — the apostrophe closes the single-quoted string early. ffmpeg then parses a truncated path and the concat step fails:This is especially confusing because the per-segment extracts all succeed — the failure only surfaces at the join, after the slow part of the pipeline has already run.
Fix
Escape
'as'\''(close quote, escaped quote, reopen quote), which is the quoting the concat demuxer line format expects:Repro
Run any EDL whose source/edit directory path contains an apostrophe. Before the fix, concat fails; after,
base.mp4is produced normally. Verified end-to-end on a real 1080×1920 vertical render whose folder name contained "couldn't".🤖 Generated with Claude Code
Summary by cubic
Escape apostrophes in segment paths when generating the ffmpeg concat-demuxer list to prevent truncated paths and failed joins. Adds proper
'\''quoting via a small helper inconcat_segmentsso paths containing'concat successfully.Written for commit 60f1a50. Summary will update on new commits.