【发布时间】:2019-09-10 00:04:40
【问题描述】:
我正在尝试将以下复杂过滤器转换为 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)
错误:ffmpeg exited with code 1: Stream map '"[vid]"' matches no streams.
To ignore this, add a trailing '?' to the map.
如果我添加尾随 '?'在outputOptions 我得到一个没有视频流的文件。
【问题讨论】:
-
报价问题。试试
.outputOptions(["-map '[vid]'", "-map 0:a"])或.outputOptions(["-map [vid]", "-map 0:a"])。
标签: ffmpeg fluent-ffmpeg