小编Dan*_*ver的帖子

如何在 Fluent FFMPEG 中运行这个复杂的过滤器?

我正在尝试将以下复杂过滤器转换为 Fluent FFMPEG 命令,但我无法弄清楚映射是如何工作的。

ffmpeg -i audio.mp3 -filter_complex "[0:a]showfreqs=s=200x100:colors=white|white,format=yuv420p[vid]" -map "[vid]" -map 0:a video.mp4

到目前为止,这是我所拥有的,但我收到有关“vid”流的错误。

ffmpeg()
    .input("audio.mp3")
    .audioCodec("aac")
    .audioBitrate("320")
    .complexFilter(
      {
        filter: "showfreqs",
        options: { s: "200x100" },
        inputs: "0:a",
      },
      {
        filter: "format",
        options: { pix_fmts: "yuv420p" },
        outputs: ["vid"],
      }
    )
    .outputOptions(['-map "[vid]"', "-map 0:a"])
    .save(spectrumTmp)
Run Code Online (Sandbox Code Playgroud)

错误: ffmpeg exited with code 1: Stream map '"[vid]"' matches no streams. To ignore this, add a trailing '?' to the map.

如果我添加一个尾随 '?' 在outputOptions我得到一个没有视频流的文件。

ffmpeg fluent-ffmpeg

1
推荐指数
1
解决办法
1817
查看次数

标签 统计

ffmpeg ×1

fluent-ffmpeg ×1