jacobbo / WebEye

WebEye is a collection of .NET controls.
190 stars 131 forks source link

Webcam control displaying blank white box. can take pictures fine, no live feed. #60

Open inquisitev opened 5 years ago

inquisitev commented 5 years ago

Hi, I have been working on an application using this repo, This is my second time using this webcam control. The first time my camera showed up in the control flawlessly, This second time, its not showing up at all. I can take a picture of the web cam view and that works fine.

Window_capture

The two boxes on the lower half should display a direct feed of the webcam, they are your webcam control.

The included c#code is everything on my end that interacts with the webeye controls, the xaml code is the code that makes up the window that is included as a picture.

I'm wondering if I'm doing something wrong, or if there is some dependency that this webcam control would not work with.

`public void startCams() { var cams = webCameraControl1.GetVideoCaptureDevices().Where(x =>x.Name.Contains("Webcam")); var numberCam = cams.Count();

        if (numberCam == 0)
        {
            checkBox1.IsEnabled = false;
            checkBox2.IsEnabled = false;
            checkBox3.IsEnabled = false;
        }
        else if (numberCam == 1)
        {
            try
            {
                webCameraControl1.StartCapture(cams.ElementAt(0));
                checkBox1.IsEnabled = true;
            }
            catch (Exception e)
            {
                MessageBox.Show("Something went wrong, " + cams.ElementAt(0).Name.ToString() + " may be used in another program");
                checkBox1.IsEnabled = true;
            }
            checkBox2.IsEnabled = false;
            checkBox3.IsEnabled = false;

        }
    }

    private void Button_Click(object sender, RoutedEventArgs e)
    {
        startCams();
    }

    private void Button_Click_1(object sender, RoutedEventArgs e)
    {
        if (webCameraControl1.IsCapturing)
        {
            webCameraControl1.StopCapture();
        }
    }`

`<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:ScreenCaptureApp" xmlns:Wpf="clr-namespace:WebEye.Controls.Wpf;assembly=WebEye.Controls.Wpf.WebCameraControl" x:Class="ScreenCaptureApp.MainWindow" mc:Ignorable="d" Title="Name" Height="735.7" Width="809.5" ResizeMode="NoResize"

jacobbo commented 5 years ago

Hello, is this reproducible with the demo app? https://github.com/jacobbo/WebEye/tree/master/WebCameraControl/WPF/WebCameraDemo

inquisitev commented 5 years ago

When i used the demo app, the camera worked the first time with live feed, After that it shows the same white box that my app does, until i restart the computer.

jacobbo commented 5 years ago

So you press the start button, it works fine, then you press the stop button, and then, when you press the start button again, you get a white rectangle, even in the demo app, correct?

inquisitev commented 5 years ago

That is what happens in the demo app, it never displays a live feed in my app.

BergEmilio commented 5 years ago

I am in exactly the same situation. It's weird because this only happens on 1 of 3 PC I used. I think it's related to the memory. The first run just after rebooting usually OK, but just click stop button then start again, the live stream get blank. (the same as OP, it can save picture file well) This can be reproduced by WebCameraDemo or any APP using WebCameraControl. And it's not related to the camera (I tried 3 different camera)

PS: I am using VS2015 community, and my boss suggests me using newest compiler to try again (because the laptop not working correct on is newest one and has more RAM) Do you think this helpful?

jacobbo commented 5 years ago

I'm developing a new version of StreamPlayerControl which will be able to capture local sources, including webcams, plan to release it in a month.

hiddenhack commented 5 years ago

In my case i don't see live from webcam. Until some time ago it worked well, but now it doesn't work anymore. Before this defect did it only with some webcams ... although I never understood why. But it just doesn't work anymore. How can I use StreamPlayer to view from the webcam?

Thanks so much for the great job

hiddenhack commented 5 years ago

I have see this problem https://support.microsoft.com/en-us/help/3089247/directx-9-legacy-overlay-planes-don-t-work-with-miracast-displays-on-w

In fact the webcam is activated, but going to see in the task manager tells me GPU 0 - Legacy Overlay .... maybe this is the problem due to the update of Widnwos 10

This is only a display problem because if I take the photo, it works correctly

jacobbo commented 5 years ago

Quite possible. Can you try ffplay with your webcam please? I’m working on replacing DirectX with FFmpeg.

On Wed, 23 Oct 2019 at 07:11, hiddenhack notifications@github.com wrote:

I have see this problem

https://support.microsoft.com/en-us/help/3089247/directx-9-legacy-overlay-planes-don-t-work-with-miracast-displays-on-w

In fact the webcam is activated, but going to see in the task manager tells me GPU 0 - Legacy Overlay .... maybe this is the problem due to the update of Widnwos 10

This is only a display problem because if I take the photo, it works correctly

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jacobbo/WebEye/issues/60?email_source=notifications&email_token=AAN57QHMHKQN5KLNL5MQ6RTQP7THHA5CNFSM4IUTRX22YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECAGCHQ#issuecomment-545284382, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAN57QAVHO5MLO5ZDQTTFFLQP7THHANCNFSM4IUTRX2Q .

hiddenhack commented 5 years ago

I have tried with FFPlay and it works very well in addition it is also very fluid

jacobbo commented 5 years ago

Cool. Can’t give you a final release date unfortunately, hope to finish it in a couple of weeks.

On Wed, 23 Oct 2019 at 09:37, hiddenhack notifications@github.com wrote:

I have tried with FFPlay and it works very well in addition it is also very fluid

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jacobbo/WebEye/issues/60?email_source=notifications&email_token=AAN57QBCMG74RNCLJT537I3QQAEMTA5CNFSM4IUTRX22YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECASLVY#issuecomment-545334743, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAN57QHV3POK7CELJ2ZBMADQQAEMTANCNFSM4IUTRX2Q .