fluent-ffmpeg / node-fluent-ffmpeg

A fluent API to FFMPEG (http://www.ffmpeg.org)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

Inambe opened this issue · comments

Version information

  • fluent-ffmpeg version: 2.1.2
  • ffmpeg version: 4.2.7-0ubuntu0.1
  • OS: Ubuntu

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

  • I have read the FAQ
  • I tried the same with command line ffmpeg and it works correctly (hint: if the problem also happens this way, this is an ffmpeg problem and you're not reporting it to the right place)
  • I have included full stderr/stdout output from ffmpeg

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

self._complexFilters('-map', streamSpec.replace(utils.streamRegexp, '[$1]'));

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 [].