问题描述
我正在尝试为自己的节点项目生成视频缩略图thumbsupply和video-thumbnail npm都返回相同的错误,称为not found: ffprobe
I am trying to generate video thumbnail in my node project for that I triedthumbsupply 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);
推荐答案
Thumbsuplly使用fluent-ffmpeg(通过快速查看源代码):
Thumbsuplly uses fluent-ffmpeg (from a quick look at the source):
fluent-ffmpeg在上面的链接中提供了有关ffmpeg安装要求和所需路径的信息.
fluent-ffmpeg has information on the requirements around ffmpeg installation and the required path at the link above.
ffmpeg和ffprobe
ffmpeg and ffprobe
fluent-ffmpeg需要ffmpeg> = 0.9才能工作.它可能与以前的版本一起使用,但是一些功能将不可用(并且不再对库进行较低版本的测试).
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).
如果设置了FFMPEG_PATH环境变量,fluent-ffmpeg会将其用作ffmpeg可执行文件的完整路径.否则,它将尝试直接调用ffmpeg(因此它应该在您的PATH中).您还必须安装ffprobe(大多数发行版随附ffmpeg).同样,fluent-ffmpeg将使用FFPROBE_PATH环境变量(如果已设置),否则将尝试在PATH中调用它.
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包括安装的详细信息在这里: https://www.ffmpeg.org/download.html
ffmpeg details including installation is here: https://www.ffmpeg.org/download.html
这篇关于找不到ffprobe?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!