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).