Cannot find ffprobe?
Asked Answered
S

2

11

I am trying to generate video thumbnail in my node project for that I tried thumbsupply and video-thumbnail npm both returns the same error called not found: ffprobe

const thumbsupply = require('thumbsupply'); 
const ffprobe = require('@ffprobe-installer/ffprobe');
let aa =   thumbsupply.generateThumbnail('videoplayback.mp4', {
                                            size: thumbsupply.ThumbSize.MEDIUM, // or ThumbSize.LARGE
                                            timestamp: "10%", // or `30` for 30 seconds
                                            forceCreate: true,
                                            cacheDir: "~/myapp/cache",
                                            mimetype: "video/mp4"
                                           })
                                     console.log(aa);
Swoop answered 4/3, 2019 at 10:20 Comment(1)
Is ffmpeg installed?Umbilication
P
13

Thumbsupply uses fluent-ffmpeg (from a quick look at the source):

fluent-ffmpeg has information on the requirements around ffmpeg installation and the required path at the link above.

Prerequisites

ffmpeg and ffprobe

fluent-ffmpeg requires ffmpeg >= 0.9 to work. It may work with previous versions but several features won't be available (and the library is not tested with lower versions anylonger).

If the FFMPEG_PATH environment variable is set, fluent-ffmpeg will use it as the full path to the ffmpeg executable. Otherwise, it will attempt to call ffmpeg directly (so it should be in your PATH). You must also have ffprobe installed (it comes with ffmpeg in most distributions). Similarly, fluent-ffmpeg will use the FFPROBE_PATH environment variable if it is set, otherwise it will attempt to call it in the PATH.

ffmpeg details including installation is here: https://www.ffmpeg.org/download.html

Personnel answered 4/3, 2019 at 12:4 Comment(1)
In my case, despite having correctly installed ffmpeg and ffprobe, the error continued. I had to manually set the path with these commands: Ffmpeg.setFfmpegPath("/usr/bin/ffmpeg"); Ffmpeg.setFfprobePath("/usr/bin/ffprobe");Jericajericho
G
9

I was also getting this issue Error: Cannot find ffprobe

I have done following steps to make it work in ubuntu

sudo apt update

sudo apt install ffmpeg

restarted my pm2 api instance.

This was my case with the deployment server,

Since, I was working in local on mac os, I used

brew install ffmpeg

Gorgonzola answered 5/9, 2021 at 6:47 Comment(1)
I had to use sudo apt-get update followed by sudo apt-get install ffmpegImplantation

© 2022 - 2024 — McMap. All rights reserved.