Skip to content

Commit

Permalink
ffmpeg demuxer concat helper uses absolute paths in ffconcat file.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
emarsden committed Feb 22, 2025
1 parent dd1e676 commit 76836d5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@

- ffmpeg muxing support supports the use of the `DASHMPD_PERSIST_FILES` environment variable to retain
the temporary files created during muxing.

- 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.


## [0.18.0] - 2025-01-12
Expand Down
11 changes: 6 additions & 5 deletions src/ffmpeg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1178,13 +1178,14 @@ pub(crate) fn concat_output_files_ffmpeg_demuxer(
// https://ffmpeg.org/ffmpeg-formats.html#concat
writeln!(&demuxlist, "ffconcat version 1.0")
.map_err(|e| DashMpdError::Io(e, String::from("writing to demuxer cmd file")))?;
let mut inputs = Vec::<PathBuf>::new();
inputs.push(tmppath.into());
writeln!(&demuxlist, "file '{}'", tmppath)
let canonical = fs::canonicalize(tmppath)
.map_err(|e| DashMpdError::Io(e, String::from("canonicalizing temporary filename")))?;
writeln!(&demuxlist, "file '{}'", canonical.display())
.map_err(|e| DashMpdError::Io(e, String::from("writing to demuxer cmd file")))?;
for p in &paths[1..] {
inputs.push(p.to_path_buf());
writeln!(&demuxlist, "file '{}'", p.to_path_buf().display())
let canonical = fs::canonicalize(p)
.map_err(|e| DashMpdError::Io(e, String::from("canonicalizing temporary filename")))?;
writeln!(&demuxlist, "file '{}'", canonical.display())
.map_err(|e| DashMpdError::Io(e, String::from("writing to demuxer cmd file")))?;
}
let demuxlistpath = &demuxlist
Expand Down

0 comments on commit 76836d5

Please sign in to comment.