locked
B frames in H.264 MFT RRS feed

  • Question

  • Hi guys,

    When running Windows Media Foundation H.264 MFT on Win10,  I found that the PTS and DTS of same frame are not equal (pts get from IMFSample->GetSampleTime, and dts from IMPSample->GetUINT64(MFSampleExtension_DecodeTimestamp).

    Below are the timestamps from the H.264 MFT encoded frames:

    pts = 0, dts = 0
    pts = 2, dts = 1
    pts = 1, dts = 2
    pts = 4, dts = 3
    pts = 3, dts = 4
    pts = 6, dts = 5
    pts = 5, dts = 6
    pts = 8, dts = 7
    pts = 7, dts = 8
    pts = 10, dts = 9
    pts = 9, dts = 10
    pts = 12, dts = 11
    pts = 11, dts = 12
    pts = 14, dts = 13
    pts = 13, dts = 14
    pts = 16, dts = 15
    pts = 15, dts = 16
    pts = 18, dts = 17
    pts = 17, dts = 18
    pts = 20, dts = 19
    pts = 19, dts = 20
    pts = 22, dts = 21
    pts = 21, dts = 22
    pts = 24, dts = 23
    pts = 23, dts = 24
    pts = 26, dts = 25
    pts = 25, dts = 26
    pts = 28, dts = 27
    pts = 27, dts = 28
    pts = 30, dts = 29

    We know PTS can be different from DTS when B frame is used. But according to documentation here https://msdn.microsoft.com/en-us/library/windows/desktop/dd797816(v=vs.85).aspx 

    • 0: Do not use B frames (default).

    B frames by default are not used, so that DTS SHOULD be same with PTS.

    Could anyone help to explain it? I'm looking for a way to get monotonically increasing PTSs.

    Thanks

    Tuesday, October 13, 2015 7:24 AM

All replies

  • Are you sure the video has no B frames? Perhaps try to verify when you're creating it that the settings for B frames are indeed off.

    Thursday, October 15, 2015 2:53 PM