3

I have a problem with saving the preview from the .mp4 file. I followed this tutorial, but I got the Error: ffmpeg exited with code 1: C:\Users\Lenovo\Documents\My projects\YouTube\routes: Permission denied. I don't know how to deal with it, the 'outputPath' is simplestrong text "public/uploads/previews". I am on Windows 10.

return ffmpeg()
            .input(inputPath)
            .inputOptions([`-ss ${startPreviewInSec}`])
            .outputOptions([`-t ${previewDurationInSec}`])
            .noAudio()
            .format("gif")
            .output(outputPath)
            .on("end", resolve)
            .on("error", reject)
            .run();
humble_button
  • 91
  • 2
  • 8
  • The error message says everything, basic the path that you are trying to use the application does not have permission. Are the users that is running node "Lenovo"? And is correct the path "public/uploads/previews"? Maybe also try to add a slash before: "/public/uploads/previews" – BrTkCa Sep 08 '20 at 19:56
  • When I add slash before I get the 'No such file or directory' error. Yes, there is only one windows account, that's Lenovo. I will try it on Ubuntu, because I have no idea how to deal with it. – humble_button Sep 08 '20 at 20:37
  • Finally I got it. In my output I was missing the file name like for example "public/uploads/previews/nameOfThePreview" and it works. – humble_button Sep 09 '20 at 04:44
  • awesome @humble_button! – BrTkCa Sep 10 '20 at 00:55

0 Answers0