简体   繁体   English

fluent-ffmpeg 进程停止

[英]fluent-ffmpeg process stops

I am working on a Node.js web app and I want to add some text over a video using 'fluent-ffmpeg'.我正在开发 Node.js web 应用程序,我想使用“fluent-ffmpeg”在视频上添加一些文本。 After a few minutes of processing, it stops at 68-69% but it does not give any errors.经过几分钟的处理,它在 68-69% 处停止,但它没有给出任何错误。 I am using as input a GET-signed URL from Google Cloud.我使用来自 Google Cloud 的 GET 签名 URL 作为输入。

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".当达到 69% 时停止并显示:“处理成功完成”。 I've tried to run the same command on terminal with the same url as input and it fully complete the process.我尝试使用相同的 url 作为输入在终端上运行相同的命令,它完全完成了该过程。 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.问题是我将视频从一个桶复制到另一个桶,但我没有等到视频完全复制到桶中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM