I am trying to get the encoded bitrate of an audio file (mp4, m4a, aac) using Media Foundation.
What I did is:
PROPVARIANT prop;
IMFSourceReader* reader;
MFCreateSourceReaderFromURL(filePath, NULL, &reader);
reader->GetPresentationAttribute(MF_SOURCE_READER_MEDIASOURCE, MF_PD_AUDIO_ENCODING_BITRATE,
&prop);
The second line ends with an error and with empty PROPVARIAT.
However, when I do:
reader->GetPresentationAttribute(MF_SOURCE_READER_MEDIASOURCE, MF_PD_DURATION, &prop);
It works fine.
Does anyone know what is the issue and/or are there any other approaches to get the encoded bitrate of an audio track?