As described in this question I’m trying to create a custom audio codec and save it with the Sink Writer in a MP4 file. I succeeded with the aid of setting MF_MT_MPEG4_SAMPLE_DESCRIPTION, following some information from this link.
My custom audio media type has the guid {0000ECDC-0000-0010-8000-00AA00389B71}
, set with MF_MT_SUBTYPE.
Just before calling Finalize
I test the media type of the writing mp4 and it’s indeed valid:
MF_MT_MPEG4_SAMPLE_DESCRIPTION byte array
MF_MT_AUDIO_NUM_CHANNELS 2
MF_MT_MAJOR_TYPE MFMediaType_Audio
MF_MT_AUDIO_SAMPLES_PER_SECOND 48000
MF_MT_MPEG4_CURRENT_SAMPLE_ENTRY 0
MF_MT_SUBTYPE {0000ECDC-0000-0010-8000-00AA00389B71}
Now the weird thing, after reopening the file:
CComPtr<IMFSourceReader> srr;
FCreateSourceReaderFromURL(fi.c_str(), 0, &srr);
CComPtr<IMFMediaType> c;
srr->GetCurrentMediaType(MF_SOURCE_READER_FIRST_AUDIO_STREAM, &c);
LogMediaType(c);
Now this time I get this weird thing:
MF_MT_AUDIO_AVG_BYTES_PER_SECOND 383
MF_MT_AVG_BITRATE 3071
MF_MT_MPEG4_SAMPLE_DESCRIPTION byte array
MF_MT_AUDIO_NUM_CHANNELS 2
MF_MT_MAJOR_TYPE MFMediaType_Audio
MF_MT_AUDIO_SAMPLES_PER_SECOND 48000
MF_MT_MPEG4_CURRENT_SAMPLE_ENTRY 0
MF_MT_AUDIO_BITS_PER_SAMPLE 16
MF_MT_SUBTYPE {65636463-767A-494D-B478-F29D25DC9037}
Now I ‘m forced to register with my decoder the weird {65636463-767A-494D-B478-F29D25DC9037}
guid as subtype and also I get some garbage like the AVG bitrate.
What could cause this?