fluent-ffmpeg / node-fluent-ffmpeg

A fluent API to FFMPEG (http://www.ffmpeg.org)
MIT License
7.63k stars 873 forks source link

No way to `-map` stream by index when using `complexFilter` #1220

Open Inambe opened 11 months ago

Inambe commented 11 months ago

Version information

Code to reproduce

.complexFilter(complexFilter, ['[final]', '2:a'])

(note: if the problem only happens with some inputs, include a link to such an input file)

Expected results

2:a in the map argument array should be mapped as -map 2:a

Observed results

It is being mapped as -map [2:a]

Checklist

Inambe commented 11 months ago

I dug up and found where this problem is coming from:

https://github.com/fluent-ffmpeg/node-fluent-ffmpeg/blob/68d5c948b689b3058e52435e0bc3d4af0eee349e/lib/options/custom.js#L204

It always gets enclosed with []. Maybe there's a way I could include stream(s) from input(s) without processing it through complexFilter while using complexFilter? If there is, let me know.

Otherwise, I suggest removing this behavior of automatically enclosing with [].