问题
Currently I'm trying to use Windows Media Foundation SDK (C++) to create WMV file on Windows 10.
I was able to create a WMV file, but I have difficulty to add language list object (7C4346A9-EFE0-4BFC-B229-393EDE415C85) into the asf file.
I am using WMSinkWriter to create a file, and how I pass input video/audio data is as following article mentions: https://docs.microsoft.com/en-us/windows/desktop/medfound/tutorial--using-the-sink-writer-to-encode-video
Here's summary of what I'm doing:
- Call CoInitializeEx to initialize the COM library.
- Call MFStartup to initialize Microsoft Media Foundation.
- Create the sink writer.
- Send video frames to the sink writer.
- Call IMFSinkWriter::Finalize to finalize the output file.
- Release the pointer to the sink writer.
- Call MFShutdown.
- Call CoUninitialize.
There's no much information on the internet since it is old SDK.
If you have any clue, please let me know.
回答1:
IMFASFContentInfo interface of the ASF Media Sink can be obtained from the Sink Writer using GetServiceForStream and specifying MF_SINK_WRITER_MEDIASINK like this:
pSinkWriter->GetServiceForStream(MF_SINK_WRITER_MEDIASINK, GUID_NULL, IID_PPV_ARGS(&pContentInfo));
where pContentInfo points to an IMFASFContentInfo.
You should be able to use IMFASFContentInfo to set the language list by using any or all of the MF_SD_LANGUAGE, MF_SD_ASF_EXTSTRMPROP_LANGUAGE_ID_INDEX, MF_PD_ASF_LANGLIST attributes on the corresponding IMFStreamDescriptor of the IMFPresentationDescriptor obtained by the IMFASFContentInfo object using GeneratePresentationDescriptor method.
来源:https://stackoverflow.com/questions/51033401/how-to-specify-language-list-object-in-windows-media-foundation-sdk