在 fluent-ffmpeg 上连接音频和视频

问题描述

我正在尝试使用库 fluent-ffmpeg 连接音频和视频,但它不起作用。任何人都可以帮助我吗?

var proc = ffmpeg(firstFile)
    .input(secondFile)
    .input(thirdFile)
    .input("./musicas/1.wav")
    //.input(...)
    .on('end',function() {
      console.log('files have been merged succesfully');
    })
    .on('error',function(err) {
      console.log('an error happened: ' + err.message);
    })
    .mergetoFile(outPath);

解决方法

在调用 mergeToFile 方法后使用事件。

var proc = ffmpeg(firstFile)
    .input(secondFile)
    .input(thirdFile)
    .input("./musicas/1.wav")
    .mergeToFile(outPath);
    .on('end',function() {
      console.log('files have been merged succesfully');
    })
    .on('error',function(err) {
      console.log('an error happened: ' + err.message);
    })

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...