volumenetwork / video-thumbnail-generator

node js module to create thumbnails from a video
58 stars 16 forks source link

Cannot find ffprobe OR ffmpeg - node react vscode #13

Closed thebradisrad closed 4 years ago

thebradisrad commented 4 years ago

Here's the FIX for cannot find ffprobe or ffmpeg issue:

1) Google ffmpeg and install it on your computer. 2) Extract it and move the extracted folder to the C drive or programs locations 3) On windows add it to environment path if you want 4) Go back to vs code and npm install ffmpeg ffprobe 5) Then add this line (for windows) - the path should be path where the program is: ffmpeg.setFfmpegPath('C:/ffmpeg/bin/ffmpeg.exe'); ffmpeg.setFfprobePath('C:/ffmpeg/bin/ffprobe.exe'); 6) If you're using video thumbnail generator: const tg = new ThumbnailGenerator({ sourcePath: "sourcePath/", thumbnailPath: 'destinationPath/' }); tg.generateOneByPercentCb(90, (err, result) => { if (err) throw err; console.log(result); // 'test-thumbnail-320x240-0001.png' }); 6b) If you're using ffmpeg: ffmpeg(sourcePath) .screenshots({ timestamps: [0.0], filename: 'thumbnail.png', folder: destinationPath }) .on('end', err => { if (err) throw err; console.log('done'); });