vvo / gifify

😻 Convert any video file to an optimized animated GIF.
ISC License
6.21k stars 314 forks source link

"TypeError: Cannot set property 'inputFilePath' of undefined" #104

Closed bikowalczyk closed 6 years ago

bikowalczyk commented 6 years ago

Hello, I'm trying to create a node js app , which will first download a mp4 file, then convert it into gif. The video file is created successfully, but when I begin to convert it, I get this error:

image

This is my node js code:

app.get('/gif', function(req, res){
    const link = (JSON.stringify(req.query.url).slice(1,-1));   //direct mp4 link

    //now download file locally, send download url and destroy file
    const fileName = link.slice(-14);  
    const r = request(link);

    r.on('response', (resp)=>{
    const stream = resp.pipe(fs.createWriteStream(__dirname + '/downloads/' + fileName));
    stream.on('finish',()=> gifify(__dirname + '/downloads/' + fileName).pipe(__dirname + '/downloads/' + fileName.slice(1,-4) +'.gif'));
    }); 

})

Do you know what may cause the issue?

Thanks ;)

vvo commented 6 years ago

just published a new version, try it