locked
Cannot get a video stream with DirectShowNETCF RRS feed

  • Question

  • Hi all

    I'm currently trying to get a USB Webcam working under Windows Embedded Compact 7 with C#.

    I'm using the DirectShowNETCF Project example with its dll and I'm able to capture pictures when CapType is turned to Still.

    If I turn CapType to either Preview or PreviewStill I won't get eigther a still Image nor a stream.

    Basically my code looks like this:

    DirectShowNETCF.Camera.Camera cam_ = null;

            public frmMain()
            {    
                InitializeComponent();
                cam_ = new DirectShowNETCF.Camera.Camera();
            }

    private void button1_Click(object sender, EventArgs e)
            {
                cam_.CapType = DirectShowNETCF.Camera.CaptureType.Still;
                cam_.setMediaType(0);
                cam_.init();
                cam_.run();
                cam_.stillImage("\\test.jpg");
                cam_.stop();
            }

    private void button2_Click(object sender, EventArgs e)
            {
                cam_.CapType = DirectShowNETCF.Camera.CaptureType.Preview;
                cam_.setMediaType(0);
                cam_.init();

                if (!cam_.run(panel1.Handle))
                {
                    MessageBox.Show("Cannot start camera");
                }
            }

    button1 Event works pretty well, however button2 won't.

    Does anybody has any idea how I can get a stream?

    Thank you very much in advance!

    Ben

    Monday, December 2, 2013 12:44 PM

Answers

  • Hi Bauer_,

    Welcome to msdn forum.

      To preview, you need to insert Video Capture Filter, and Video Renderer. If you want to take a picture, you need to insert Image Sink Filter.Video Capture Filter has 3 output pins, Capture, Preview and Still.
    Preview pin should be connected to Video Renderer, and Still pin should be connected to Image Sink Filter

    More information:

    DirectShow

    Capturing an Image From a Still Image Pin

    Image capture Windows Mobile 5.0 without CameraCaptureDialog

    CameraCaptureDialog.ShowDialog Method

    Hope this helps you.

    Best Regards,

    Eileen


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by Eileen ni Monday, December 16, 2013 9:19 AM
    Monday, December 9, 2013 5:49 AM