0
votes

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:

  1. Call CoInitializeEx to initialize the COM library.
  2. Call MFStartup to initialize Microsoft Media Foundation.
  3. Create the sink writer.
  4. Send video frames to the sink writer.
  5. Call IMFSinkWriter::Finalize to finalize the output file.
  6. Release the pointer to the sink writer.
  7. Call MFShutdown.
  8. 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

1 Answers

0
votes

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.