【发布时间】:2019-11-04 19:15:02
【问题描述】:
我设置了一个节点服务器,它需要一个文件进行预处理。仅使用 ffmpeg 库时,文件处理没有问题,使用 fluent-ffmpeg 时,如果视频为 20 秒,则输出只会是视频的后半部分(10 秒)。我已经尝试了多个不同长度的文件并且存在相同的问题。知道为什么会发生这种情况吗?
const ffmpegPath = require('@ffmpeg-installer/ffmpeg').path;
const ffprobePath = require('@ffprobe-installer/ffprobe').path;
const ffmpeg = require('fluent-ffmpeg');
...
ffmpeg.setFfmpegPath(ffmpegPath);
ffmpeg.setFfprobePath(ffprobePath);
ffmpeg('video.mov').videoBitrate('512k').output('./output/video.mov')
.on('error', function(err, stdout, stderr) {
console.log('Cannot process video: ' + err.message);
}).screenshots({
count: 1,
size:'640x480'
});
【问题讨论】:
标签: node.js video ffmpeg fluent-ffmpeg