Skip to content

Commit 76836d5

Browse files
committed
ffmpeg demuxer concat helper uses absolute paths in ffconcat file.
The ffmpeg demuxer concat helper uses absolute paths in the ffconcat file, rather than relative paths, because ffmpeg interprets relative paths with respect to the location of the ffconcat file, rather than with respect to CWD. Fixes #93 reported by @Cocalus.
1 parent dd1e676 commit 76836d5

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55

66
- ffmpeg muxing support supports the use of the `DASHMPD_PERSIST_FILES` environment variable to retain
77
the temporary files created during muxing.
8+
9+
- The ffmpeg demuxer concat helper uses absolute paths in the ffconcat file, rather than relative
10+
paths, because ffmpeg interprets relative paths with respect to the location of the ffconcat file,
11+
rather than with respect to CWD. Fixes #93 reported by @Cocalus.
812

913

1014
## [0.18.0] - 2025-01-12

src/ffmpeg.rs

+6-5
Original file line numberDiff line numberDiff line change
@@ -1178,13 +1178,14 @@ pub(crate) fn concat_output_files_ffmpeg_demuxer(
11781178
// https://ffmpeg.org/ffmpeg-formats.html#concat
11791179
writeln!(&demuxlist, "ffconcat version 1.0")
11801180
.map_err(|e| DashMpdError::Io(e, String::from("writing to demuxer cmd file")))?;
1181-
let mut inputs = Vec::<PathBuf>::new();
1182-
inputs.push(tmppath.into());
1183-
writeln!(&demuxlist, "file '{}'", tmppath)
1181+
let canonical = fs::canonicalize(tmppath)
1182+
.map_err(|e| DashMpdError::Io(e, String::from("canonicalizing temporary filename")))?;
1183+
writeln!(&demuxlist, "file '{}'", canonical.display())
11841184
.map_err(|e| DashMpdError::Io(e, String::from("writing to demuxer cmd file")))?;
11851185
for p in &paths[1..] {
1186-
inputs.push(p.to_path_buf());
1187-
writeln!(&demuxlist, "file '{}'", p.to_path_buf().display())
1186+
let canonical = fs::canonicalize(p)
1187+
.map_err(|e| DashMpdError::Io(e, String::from("canonicalizing temporary filename")))?;
1188+
writeln!(&demuxlist, "file '{}'", canonical.display())
11881189
.map_err(|e| DashMpdError::Io(e, String::from("writing to demuxer cmd file")))?;
11891190
}
11901191
let demuxlistpath = &demuxlist

0 commit comments

Comments
 (0)