fix(render): absolute concat paths for relative --output #6

Closed
hugooconnor wants to merge 0 commits from refs/pull/6/head into main
hugooconnor commented 2026-06-21 13:04:53 +00:00 (Migrated from codeberg.org)

Bug

ar-edit render <edit> --output out.mp4 (relative path) failed with:

Error: ffmpeg failed: concat failed: Error opening input files: No such file or directory

An absolute --output path worked; only relative paths were affected. play and the TUI dodged it because they render to absolute temp paths.

Root cause

ffmpeg's concat demuxer resolves relative file '...' entries relative to the directory containing the list file, not the process cwd. With a relative --output, the work dir (render.rs render_to_file) and the segment paths were relative, so the filelist held .ar-edit-render-out/segment_0000.mp4. ffmpeg then looked for .ar-edit-render-out/.ar-edit-render-out/segment_0000.mp4 → not found.

Fix

write_concat_list now canonicalizes each existing segment path so entries are always absolute. Nonexistent paths fall back to the original (keeps the existing synthetic-path unit tests passing).

Test

Adds write_concat_list_makes_existing_relative_segments_absolute, which reproduces the relative-cwd scenario and asserts the emitted entry is absolute. Verified end-to-end: relative-output render now produces a correct 4.02s file. Full ar-edit-core suite: 1191 passed.

🤖 Generated with Claude Code

## Bug `ar-edit render <edit> --output out.mp4` (relative path) failed with: ``` Error: ffmpeg failed: concat failed: Error opening input files: No such file or directory ``` An absolute `--output` path worked; only relative paths were affected. `play` and the TUI dodged it because they render to absolute temp paths. ## Root cause ffmpeg's concat demuxer resolves relative `file '...'` entries **relative to the directory containing the list file**, not the process cwd. With a relative `--output`, the work dir (`render.rs` `render_to_file`) and the segment paths were relative, so the filelist held `.ar-edit-render-out/segment_0000.mp4`. ffmpeg then looked for `.ar-edit-render-out/.ar-edit-render-out/segment_0000.mp4` → not found. ## Fix `write_concat_list` now canonicalizes each existing segment path so entries are always absolute. Nonexistent paths fall back to the original (keeps the existing synthetic-path unit tests passing). ## Test Adds `write_concat_list_makes_existing_relative_segments_absolute`, which reproduces the relative-cwd scenario and asserts the emitted entry is absolute. Verified end-to-end: relative-output render now produces a correct 4.02s file. Full `ar-edit-core` suite: 1191 passed. 🤖 Generated with [Claude Code](https://claude.com/claude-code)

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
anuna-research/ar-edit!6
No description provided.