locked
How to get device time stamps from the UVC stream with the WMF source reader RRS feed

  • Question

  • Hello,

    I'm currently developing an application which requires to get access to the Presentation Time Stamps (preferably converted in host clock units) as sent in the UVC stream so that I can synchronize the video streams of multiple UVC cameras.

    I'm currently using the WMF source reader and I can get multiple cameras to run simultaneously. However, the time stamps returned by the IMFSourceReader::ReadSample method seems not to be related to the PTS values sent by the device.

    While one camera was streaming, I logged the PTS value as sent by the device (UVC PTS) using a protocol analyzer and compared to the PTS returned by the IMFSourceReader::ReadSample method (WMF PTS). Here are the result I get when I subtract respectively the UVC PTS and WMF PTS of the previous frame and the PTS values of the current frame:

    When the camera is streaming at 30FPS:

    UVC PTS WMF PTS
    999943 321814
    999944 318107
    999943 319662
    999944 324671
    999943 320201
    999943 316466
    999944 320221
    999943 322969
    999944 317657
    999943 318670
    999944 322535
    999943 478240
    ... ...

    When the camera is streaming at 25FPS:

    UVC PTS WMF PTS
    1200003 321853
    1200012 480201
    ... ...

    The patterns are then repeating endlessly. We can clearly see that the WMF PTS are not related to the UVC PTS at least with the default behavior.

    Therefore, is there any way to get the UVC PTS values (preferably converted in host clock units)?

    Could the MFT_HW_TIMESTAMP_WITH_QPC_Attribute be of any help? I tried to get this attribute for all the webcams I own and unfortunately this attribute is not defined.

    Thank you


    Cédric

    Friday, April 13, 2012 7:15 AM

All replies

  • The timestamp from the device should be stored in the MFSampleExtension_DeviceTimestamp attribute on the media samples from the capture media source.
    Monday, May 21, 2012 7:45 PM
  • Hello,

    Thank you for the hint. Unfortunately, I gave it a try and the value returned by the GetUINT64() for this attribute is the same as the llTimestamp we get in the read sample callback.

    BR


    Cédric

    Wednesday, May 23, 2012 7:54 AM
  • Unfortunately, those are the only two timestamps provided by the device source -- MFSampleExtension_DeviceTimestamp provided by Kernel Streaming if it exists, and the QueryPerformanceCounter timestamp set as the sample timestamp.

    Monday, June 25, 2012 9:15 PM