damianociarla / node-ffmpeg

ffmpeg module for nodejs
MIT License
604 stars 140 forks source link

Trouble with paths that have spaces in them #78

Open Jacob-Mahoney opened 4 years ago

Jacob-Mahoney commented 4 years ago

Title is pretty self-explanatory. I'm having trouble with paths that have spaces in them.

import ffmpeg from "ffmpeg"

try {
    let process = new ffmpeg("C:\\Users\\JR\\Desktop\\new folder\\test.m4a");
    process.then(video => {
        video.save("C:\\Users\\JR\\Desktop\\test.mp3", (error, file) => {
            if (!error) {
                console.log("converted!");
            } else {
                console.log("uh oh error: " + error);
            }
        });
    },
    error => {
        console.log("Error: " + error);
    });
} catch (error) {
    console.log(error.code);
    console.log(error.msg);
}

Below are all the variations I've tried. They all result in either an error from the module itself saying "The input file does not exist" or an error from ffmpeg saying "No such file or directory".

let process = new ffmpeg("C:\\Users\\JR\\Desktop\\new folder\\test.m4a");

let process = new ffmpeg('C:\\Users\\JR\\Desktop\\new folder\\test.m4a');

let process = new ffmpeg('"C:\\Users\\JR\\Desktop\\new folder\\test.m4a"');

let process = new ffmpeg("C:/Users/JR/Desktop/new folder/test.m4a");

let process = new ffmpeg('C:/Users/JR/Desktop/new folder/test.m4a');

let process = new ffmpeg("C:\\Users\\JR\\Desktop\\new\ folder\test.m4a");

let process = new ffmpeg('C:\\Users\\JR\\Desktop\\new\ folder\test.m4a');

And probably several other variations that I'm forgetting. Any ideas?

tuananhl commented 4 years ago

Nice. Same issue

tugrul512bit commented 3 years ago

Also with paranthesis even when its encodeURI(name)'d.

World of Warcraft - Warlords of Draenor Cinematic(1).mp4

even if I append+prepent the file path with (") characers.

"'"+path.join(__dirname,uri)+"'"

anselanza commented 3 years ago

Ouch, yes, having the same problem. Anybody at least find a workaround?

paulkre commented 2 years ago

How is this still not fixed?

anselanza commented 2 years ago

Going to clone the repo and see if I can hunt this one down for myself!

anselanza commented 2 years ago

I think I fixed it: https://github.com/damianociarla/node-ffmpeg/pull/87