Skip to content

Commit

Permalink
better escape filenames for ffmpeg
Browse files Browse the repository at this point in the history
fix #32
  • Loading branch information
DominikPeters committed Nov 9, 2024
1 parent fec2bc2 commit 9f84ee1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/submodules/FFmpeg.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ export async function mergeFiles(files, reencode, onProgress) {
for (const file of files) {
const { name } = file;
ffmpeg.writeFile(name, await fetchFile(file));
inputPaths.push(`file ${name.replace(/ /g, '\\ ')}`);
const escaped = name.replace(/([\\'\s])/g, '\\$1');
inputPaths.push(`file ${escaped}`);
}
await ffmpeg.writeFile('concat_list.txt', inputPaths.join('\n'));
const onLog = ({ message }) => {
Expand Down

0 comments on commit 9f84ee1

Please sign in to comment.