Interlaced flag setting about video recorded by webcam


  • Now I suffer a problem with video recorded by webcam(Both Logitech QuickCam Pro for NoteBooks and V-Gear TalkCam TX6 VGA WebCam have this situation). The media type of stream is MFVideoInterlace_Progressive, but the interlaced flag is TRUE. From this article http://msdn.microsoft.com/en-us/library/aa367729(VS.85).aspx, it says that if my media type of that stream is MFVideoInterlace_Progressive, my interlaced flag is optinal. If this attribute is set, then it should be FALSE. It obviously go against with this rule. Form the article, it says that the "For example, if the media type is MFVideoInterlace_Progressive, it implies that all frames in the stream are progressive. Therefore, you can either set the MFSampleExtension_Interlaced attribute to FALSE, or leave the attribute unset." Does it mean that I will get this error code MF_E_ATTRIBUTENOTFOUND from function IMFAttributes::GetUINT32 to specify that this attribute is unset ?? 

    Based on those reasons above. I have some problems.

    1. Does that video stream is legal??

    2. If that is legal , how can I handle that media type and interlaced flag?? Does it mean that if the media type is MFVideoInterlace_Progressive, I can ignore the setting of interlaced flag and treat the video stream as progressive??

    2012年3月26日 2:40



  • Hello,

    Here are some media capture samples in metro style App. Maybe you can follow these sample codes.


    Or you can provide us some sample codes or some steps to reproduce this issue.

    Best regards,

    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us

    2012年3月27日 5:27
  • Dear Jesse:

    I forgot to mention that our module is an MFT component under metro. The samples seems doesn't mention about this.

    Actually I just do these things:

    1. create a Webcam APP under JavaScript

    2. insert our module with function "addEffectAsync"

    3. get input media type by "m_pInputType->GetUINT32(MF_MT_INTERLACE_MODE, &m_input_interlace_format)"

    4. get interlaced flag of input frame with function "(mp_input_sample->GetUINT32(MFSampleExtension_Interlaced, &frame_interlaced)"

    5.My Stream video format is "MFVideoFormat_RGB24"

    I found that "m_input_interlace_format = MFVideoInterlace_Progressive" but "frame_interlaced = TRUE".

    Is this combination is legal??

    From msdn, frame_interlaced should be FALSE or unset??

    What is unset meaning??


    2012年3月27日 9:38
  • Hello Kenny,

    Yes if MFVideoInterlace_Progressive is set to "true" you can ignore the MFSampleExtension_Interlaced flag on each sample. Unless a dynamic format change has occured.


    Windows Media SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    2012年3月27日 16:25
  • Dear James:

    Thanks for your reply and I still have some questions.

    1. From msdn http://msdn.microsoft.com/en-us/library/windows/desktop/aa367729(v=vs.85).aspx#interlace_flags, it says that "each of these attributes can have three values: either TRUE,FALSE, or not set". Can I Know what's the value of not set??  return error MF_E_ATTRIBUTENOTFOUND??

    2. From msdn http://msdn.microsoft.com/en-us/library/windows/desktop/aa367729(v=vs.85).aspx#interlace_flags, it says that "If an attribute is not set, the value is taken from the media type. If an attribute is set, the value overrides the media type", it seems that I need to check interlace flag on sample first and then media type. As for dynamic format change, it is same too.

    Based on those rules above, the video stream from webcam will conflict those rules because the media type of stream is MFVideoInterlace_Porgessive and interlace flag MFSampleExtension_interlaced is true. I will take the stream as interlaced, but in fact, the video stream is progessive. Is this the problem of decoder or ??


    1. Webcam are Logitech Quick Pro For NoteBooks and V-Gear Talkcam TX6 VGA WebCam

    2. Video format is MFVideoFormat_RGB24



    2012年3月28日 6:55
  • Hello Kenny,

    Sorry for the late reply. I have been out of the office. If you are still confused with the way the MF interlaced flags work please let me know and I will do what I can to help you.



    Windows Media SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    2012年4月6日 0:05
  • Dear James:

    I still quite not sure how the MF interlaced flags works. I have post another topic for this, here is the link "http://social.msdn.microsoft.com/Forums/en-US/winappswithnativecode/thread/03dd442f-b41c-474e-bbf3-6ea253187d52"



    2012年4月7日 6:24
  • Okay, I will answer in the other thread.


    Windows Media SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    2012年4月9日 23:16