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();