volumenetwork / video-thumbnail-generator

node js module to create thumbnails from a video

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot find ffprobe OR ffmpeg - node react vscode

thebradisrad opened this issue · comments

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'); });