Reputation: 53
I have a node server set up and it takes a file for pre-processing. When using only ffmpeg library, files are processed with no problem, when using fluent-ffmpeg, if a video is 20 seconds, the output will only be the last half of the video (10 seconds). I've tried multiple files of varying length and with same issue. Any idea why this would happen?
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'
});
Upvotes: 1
Views: 453
Reputation: 53
Turns out I misunderstood docs... can't incorporate both input processing and screenshots in same call... should be
ffmpeg('video.mov').videoBitrate('512k')
.output('./output/video.mov')
.on('error', function(err, stdout, stderr) {
console.log('Cannot process video: ' + err.message);
});
and separately
ffmpeg('video.mov').screenshots({
count: 1,
size:'640x480'
});
Upvotes: 2