I was examining an audio file and noticed that the numbers of channels returned by mediainfo
and ffprobe
were different.
The mediainfo
command:
mediainfo audio.mp4
The ffprobe
command (see the channels
value):
ffprobe -i audio.mp4 -show_streams
Does anyone know what's happening? Here is the audio file for your own test.
AAC content, announced as mono. But AAC may have an hidden Parametric Stereo feature which makes this announcement not the reality 99.99% of the time (HE-AAC is rarely used for mono content).
FFmpeg is not able to switch from mono to stereo if stereo is detected after decoder init so it forces its output to stereo due to some anticipation of getting Parametric Stereo at some point.
MediaInfo does not have this limitation so shows stereo only if Parametric Stereo is detected. Parametric Stereo is not detected in this file.
In this case MediaInfo shows the correct value (mono) and FFmpeg shows an incorrect value (stereo). Not blaming FFmpeg here, their developers decided to do that for good reasons (decoding and handling lot of tools not able to deal with channel count change in the middle of a file), just not what you are looking for.
If you are not convinced, try to decode each channel in a different file, and compare files. There is only 1 byte not same between the 2 files, it is the byte saying that this is the left channel vs the right channel. Audio data is same: your file is really mono and even FFmpeg agrees on that when it decodes (in practice it duplicates the mono channel).
Jérôme, developer of MediaInfo.