locked
Media Foundation VBR Encoding & Writing RRS feed

  • Question

  • Hello everyone

    I'm currently building the Media Foundation Tools for our own video Codec. Therefore, I created the Encoder and Decoder MFT components as well as an ASF File Sink. Since the codec has a variable bit rate by its nature, I figured it should be fairly simple to VBR-encode and write to an ASF file, but still I struggle in achieving this...
    At first, I set the MF_PD_ASF_METADATA_IS_VBR attribute on the Presentation Descriptor of the ContentInfo before the Multiplexer gets initialized.
    The Multiplexer has the Flag MFASF_MULTIPLEXER_AUTOADJUST_BITRATE set.
    Apparently one would need to update the values MFPKEY_RAVG, MFPKEY_BAVG, MFPKEY_RMAX and MFPKEY_BMAX after each call of IMFMultiplexer::End() in the Sink for VBR. So I tried to set something legit for those attributes after each call. Did I get that right?
    However, as soon as I enable the following properties on the Encoding Configuration Property Store of the ContentInfo object of my Sink, the Multiplexer object returns the MF_E_LATE_SAMPLE error code on the second Sample of the VBR video Stream...
    MFPKEY_VBRENABLED -> TRUE
    MFPKEY_PASSESUSED -> 1
    MFPKEY_VBRQUALITY -> 90 
    Has anyone experienced the same issues or is somebody able to explain to me where exactly which VBR properties need to be set? Also, all these settings have been made on the Sink - is nothing necessary on the Encoder's side?


    Thanks already to everyone!
    Cheers

    Tuesday, March 22, 2011 4:22 PM

Answers

  • Guys,

    Has nobody ever written a VBR media file with MF? I'd be grateful for any hints!

    I'm probably just missing some important thing... 

    Cheers,

    Stefan

    Sunday, March 27, 2011 10:18 AM

All replies

  • Guys,

    Has nobody ever written a VBR media file with MF? I'd be grateful for any hints!

    I'm probably just missing some important thing... 

    Cheers,

    Stefan

    Sunday, March 27, 2011 10:18 AM
  • Hi,

    I am fighting with the same problem too, created encoding pipline based on mentioned samples, but WMA encoder never returns any VBR type (listed using MFT->GetOutputAvailableType), always CBR. It is marked as resolved, how did you solve this problem?

    Thanks for reply

    Michal

    Tuesday, September 13, 2016 8:49 AM