ffmpeg视频帧到图像nodejs?

时间:2019-05-10 14:28:24

标签: node.js

我正在使用ffmpeg将帧转换为图像,但出现错误

var express = require("express"),
ffmpeg = require('ffmpeg');
var ffmpeg = require('fluent-ffmpeg');

ffmpeg('./mv.mp4')
    .on('end', function() {
        console.log('Screenshots taken');
    })
    .on('error', function(err) {
        console.error(err);
    })
    .screenshots({
        // Will take screenshots at 20%, 40%, 60% and 80% of the video
        count: 4,
        folder: './'
    });

这是错误

if (config.timemarks.some(function(t) { return ('' + t).match(/^[\d.]+%$/); })) {
                     ^

TypeError: Cannot read property 'some' of undefined
    at computeTimemarks (/Users/mow/Desktop/vd/node_modules/fluent-ffmpeg/lib/recipes.js:162:30)
    at nextTask (/Users/mow/Desktop/vd/node_modules/async/dist/async.js:5324:14)
    at Object.waterfall (/Users/mow/Desktop/vd/node_modules/async/dist/async.js:5334:5)
    at FfmpegCommand.proto.takeScreenshots.proto.thumbnail.proto.thumbnails.proto.screenshot.proto.screenshots (/Users/mow/Desktop/vd/node_modules/fluent-ffmpeg/lib/recipes.js:159:11)
    at Object.<anonymous> (/Users/mow/Desktop/vd/app.js:15:4)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)

0 个答案:

没有答案