locked
Possible to get video frames from preview stream?

Answers

All replies

  • It would probably be easier in C++ for this kind of thing.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Wednesday, March 26, 2014 7:13 PM
    Moderator
  • No prob with C++. How would it be done there? Using DirectShow I remember the old day.
    Wednesday, March 26, 2014 8:12 PM
  • What I want to do is instant barcode recognition. For that I need to get the frames of the video preview.
    Friday, March 28, 2014 5:22 PM
  • I'll move your question to the C++ forum, and ask our media guru to check it out.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Wednesday, April 02, 2014 2:14 PM
    Moderator
  • To capture a frame of the video you will write a Media Foundation Transform (MFT) to perform the capture.

    You can find example MFT implementations in the Media extensions sample

    Wednesday, April 02, 2014 2:30 PM
    Owner
  • Hello,

    Rob is correct. If you are familiar with DShow the techniques are similar with Media Foundation. You will write an MFT (Media Foundation Transform) that will intercept the video stream from the MediaCapture component, cache the current frame and pass the video along to the preview renderer. If you don't need to modify the video use an in-place transform. That way you can cache the frames yourself at a lower frame rate to maximize you algorithm.

    I hope this helps,

    James


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

    Wednesday, April 02, 2014 9:40 PM
    Moderator
  • Thanks James! I will try it out. Have written DShow in the past, gotta remember it :) I don't need to modify the video stream in my filter. I just want to analyze it for barcodes.

    So I would use a video tag in my WinJS app to display the preview stream and at the same time have a transform filter added to the media capture object that does my frame grabbing and processing for me?

    Wednesday, April 02, 2014 10:27 PM