I am using fluent-ffmpeg to resize a video.
I can't figure out what's happening though. I have 2 video files, one works but the other doesn't. I've been scouring the mediainfo
outputs of both files, checking for discrepancies but other than filesize
, duration
etc. there's no difference (same codec
, format
, width
/height
, frame rate
etc)
Here's a link to both files.
I've been reading these video files into fluent-ffmpeg using an input stream, as so:
await new Promise((resolve, reject) => {
ffmpeg(file.stream)
.output(path)
.size('426x240')
.on('start', function() {
console.log('started');
})
.on('error', function(err) {
console.log('An error occurred: ' + err.message);
})
.on('progress', function(progress) {
console.log('... frames: ' + progress.frames);
})
.on('end', function() {
console.log('Finished processing');
resolve();
})
.run();
});
The working file prints:
started
... frames: 86
... frames: 107
Finished processing
But the non-working file doesn't seem to have any frames, and prints:
started
... frames: 0
Finished processing
Any idea what could be wrong?
The ffmpeg command being executed:
ffmpeg -i pipe:0 -y -filter:v scale=w=426:h=240 uploads/works.mp4
It does, but in full mode only. try
mediainfo -f
on the files, you'll see:for the working file, and
For the non working file.
a "no" here means that the input needs to support seek (header is at the end, player needs to seek to end for parsing header then seek back to beginning for parsing data).