I am working on a Node.js web app and I want to add some text over a video using 'fluent-ffmpeg'. After a few minutes of processing, it stops at 68-69% but it does not give any errors. I am using as input a GET-signed URL from Google Cloud.
const ffmpeg = require('fluent-ffmpeg');
const url = await generateV4ReadSignedUrl(storage).catch(console.error);
try {
const process = ffmpeg(url)
.withVideoFilter(command)
.on('progress', function(info) {
console.log('progress ' + info.percent + '%');
})
.on('end', function() {
console.log('Processing finished successfully');
})
.on('error', function(err, stdout, stderr) {
console.error;
})
.save(__dirname+'/../add_labels/video.mp4');
} catch (e) {
console.log(e.msg);
}
When it reaches 69%, it stops and shows: "Processing finished successfully". I've tried to run the same command on terminal with the same url as input and it fully complete the process. Also, I've tried run it without the command and still performs the same.
The problem was that I was copying the video from one bucket to another but I was not waiting until the video was fully copied to the bucket.