1

I use this batch command for years in ffmpeg, but from update to the last version don't work and don't see in documentation whats the problem.

ffmpeg -i C:\Pelis\video.mkv -vcodec copy -map 0:a -map 0:v -acodec aac -b:a 384k -ac 2 -filter_complex extrastereo C:\Pelis\Salida.mkv

I recive that error allways:

[fc#0 @ 000001c68f377180] Cannot find a matching stream for unlabeled input pad extrastereo:default Error binding filtergraph inputs/outputs: Invalid argument

3
  • -filter_complex extrastereo is bug and don't work, i make probes with other filters and be fine, only the extrastereo filter fail some wasn't implement Commented May 30 at 17:49
  • You have to specify the input you want to apply the filter to, -filter_complex "[0:a]extrastereo[audio]" -map 0:v -map [audio]... Commented May 30 at 22:26
  • My answer assumes that your "batch command" worked with FFmpeg version 5 or earlier, and it's not working with FFmpeg version 7. Can you please edit your question, and add the versions of the older FFmpeg that worked and the newer version that doesn't work?
    – Rotem
    Commented May 31 at 10:12

1 Answer 1

0

It is not working due to the audio mapping: -map 0:a.

The following command should work:
ffmpeg -i C:\Pelis\video.mkv -vcodec copy -acodec aac -b:a 384k -ac 2 -filter_complex extrastereo C:\Pelis\Salida.mkv


It looks like the behavior of "unlabeled input" to a filter was changed between FFmpeg versions (say between version 5.xx and version 7.0).

  • Example for "unlabeled input": -filter_complex extrastereo.
  • Example for "labeled input": -filter_complex [0:a]extrastereo.

-map 0:a maps the original audio stream of the input, to the output.
-filter_complex extrastereo looks (automatically) for some default input audio stream, and creates a new audio output stream.
Now we have to candidate output audio streams...


There is a different behavior of FFmpeg version 5.xx and version 7.0:

  • FFmpeg 5.xx ignores the -map 0:a, and maps the output of extrastereo to Salida.mkv.
  • FFmpeg 7.0 maps the original input stream 0:a to Salida.mkv, and refuses to (automatically) select it as input to extrastereo filter.

The correct behavior is undefined, and it is a good practice to explicitly define the input to each filter: [0:a]extrastereo.


Note that using both -map 0:a and "[0:a]extrastereo[audio]" -map 0:v -map [audio] as suggested by Ricardo: ffmpeg -i C:\Pelis\video.mkv -vcodec copy -map 0:a -map 0:v -acodec aac -b:a 384k -ac 2 -filter_complex "[0:a]extrastereo[audio]" -map 0:v -map [audio] C:\Pelis\Salida.mkv, creates an output with two audio streams.
I assume your intention is creating an output with one audio streams.


Note:
FFmpeg 6.1 has a different behavior than both FFmpeg 5 and FFmpeg 7.
When using the original command with FFmpeg 6.1, the output has two audio streams.
Mapping the original audio due to -map 0:a, and also mapping the output of extrastereo, seems to be the correct behavior.
I suppose that FFmpeg 5 and earlier versions have a bug, the bug was fixed in FFmpeg 6, and with FFmpeg 7 there is an error message (giving error message is probably for the best).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .