Interlaced flag setting about video recorded by webcam RRS feed

  • Question

  • 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??

    • Edited by Kenny Lin Monday, March 26, 2012 3:40 AM
    Monday, March 26, 2012 2:40 AM


All replies

  • 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

    Tuesday, March 27, 2012 5:27 AM
  • 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??


    Tuesday, March 27, 2012 9:38 AM
  • 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/

    Tuesday, March 27, 2012 4:25 PM
  • 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



    • Edited by Kenny Lin Thursday, March 29, 2012 10:45 AM
    Wednesday, March 28, 2012 6:55 AM
  • 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/

    Friday, April 6, 2012 12:05 AM
  • 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"



    Saturday, April 7, 2012 6:24 AM
  • Okay, I will answer in the other thread.


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

    Monday, April 9, 2012 11:16 PM