I'm trying to turn the following complex filter into a Fluent FFMPEG command but I can't figure out how the mapping works.
ffmpeg -i audio.mp3 -filter_complex "[0:a]showfreqs=s=200x100:colors=white|white,format=yuv420p[vid]" -map "[vid]" -map 0:a video.mp4
This is what I have so far but I get an error about the 'vid' stream.
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)
Error: ffmpeg exited with code 1: Stream map '"[vid]"' matches no streams.
To ignore this, add a trailing '?' to the map.
If I add a trailing '?' in outputOptions
I get a file with no video stream.