简体   繁体   中英

Windows Media foundation : How to set an encoder property?

I have a IMFMediaSink interface implemented that encodes through the native h264 codec a particular source. I want to change the default options of the h264 codec, how to do that?

Note that media sink does not do the encoding and this makes the wording of the question not quite accurate. Media sink receives already produced H.264 and formats it into an MP4 byte stream.

The higher level Media Foundation API that matches the description of your effort is Sink Writer API. Internally it manages a media sink and additionally to this it is capable to chain transforms including the video encoders. This is a typical way to make encoding and media sink and sink writer to interoperate and produce the encoded content.

When Sink Writer instance adds H.264 encoders, it can be queried for IMFSinkWriterEx interface , which in turn can be used to access the video encoding transform, with respective setup options you seek. Note that the transforms are available after you add streams and configure input formats, so your codec setup needs to happen at respective configuration stage.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM