AForge.NET

  :: AForge.NET Framework :: Articles :: Forums ::

Playing multiple cameras of same model not working

Forum to discuss AForge.NET Framework, its features, API, how-tos, etc.

Playing multiple cameras of same model not working

Postby DSZ » Wed Feb 27, 2019 5:57 am

I can play with two cameras simultaneously using aforge player(one was PC webcam and another was a USB camera). Now when I'm trying with two cameras which is connected from a PCB, is not working (both camera are of same model). Camera which is connected to first player is only playing. Second player shows "connecting.." message only. Seems the issue is with same model of camera. . This might be a limitations of drivers/system. Can I resolve this? or can I reach in a conclusion what is the exact issue ? When I'm running the same app in Windows 8 it is working. My lap is windows 10 ASUS X541U.

Code: Select all
private void StartCameras()
    {
        try
        {
     // create first video source
     videoSource1 = new VideoCaptureDevice(videoDevices[camera1Combo.SelectedIndex].MonikerString);
     videoSourcePlayer1.VideoSource = videoSource1;
     videoSource1.NewFrame += new AForge.Video.NewFrameEventHandler(Video1_NewFrame);
     videoSourcePlayer1.Start();
            // create second video source
            if (camera2Combo.Enabled == true)
            {
   videoSource2 = new VideoCaptureDevice(videoDevices[camera2Combo.SelectedIndex].MonikerString);               
   videoSourcePlayer2.VideoSource = videoSource2;
   videoSource2.NewFrame += new AForge.Video.NewFrameEventHandler(Video2_NewFrame);
   videoSourcePlayer2.Start();
            }
        }
        catch(Exception ex)
        {
            string exx = ex.Message;
        }     
    }
Attachments
stack1.png
stack1.png (98.56 KiB) Viewed 1237 times
Last edited by DSZ on Thu Feb 28, 2019 3:19 am, edited 1 time in total.
DSZ
 
Posts: 15
Joined: Mon Feb 25, 2019 7:06 am

Re: Playing multiple cameras of same model not working

Postby andrew.kirillov » Wed Feb 27, 2019 8:07 am

This issue was already discussed here many times. There is not much you can do. There problem you have is caused by drivers. Most drivers simply don't support two cameras of the same model running together. You may try finding a different driver for your camera.
With best regards,
Andrew


Interested in supporting AForge.NET Framework?
User avatar
andrew.kirillov
Site Admin, AForge.NET Developer
 
Posts: 3427
Joined: Fri Jan 23, 2009 9:12 am
Location: UK

Re: Playing multiple cameras of same model not working

Postby DSZ » Wed Feb 27, 2019 8:48 am

andrew.kirillov wrote:This issue was already discussed here many times. There is not much you can do. There problem you have is caused by drivers. Most drivers simply don't support two cameras of the same model running together. You may try finding a different driver for your camera.


Is there any mechanism to test if the usb port support multi camera operation?
And do you know any similar kind of drivers, which allow multi camera access through a single port?
DSZ
 
Posts: 15
Joined: Mon Feb 25, 2019 7:06 am

Re: Playing multiple cameras of same model not working

Postby andrew.kirillov » Wed Feb 27, 2019 10:31 am

DSZ wrote:Is there any mechanism to test if the usb port support multi camera operation?

There is no problem with multiple cameras. There is a problem with multiple cameras of the same model/make. It is not USB port which does not support something. But the camera's driver. No, I don't have tools for troubleshooting this.
With best regards,
Andrew


Interested in supporting AForge.NET Framework?
User avatar
andrew.kirillov
Site Admin, AForge.NET Developer
 
Posts: 3427
Joined: Fri Jan 23, 2009 9:12 am
Location: UK

Re: Playing multiple cameras of same model not working

Postby gripner » Wed Jun 19, 2019 9:23 am

Hello

I have been strugling with this for some time trying to find a work-around.

The issue is not with AForge or webcam/camera beeing of the same model/make.
The issue is that most webcameras uses windows usbvideo.sys (the standard driver for webcams in windows one could say)

So you will have the same issue if you take a camera of brand X and another camera of brand Y BOTH using usbvideo,sys, it will not work.

If you take 2 cameras of model and make Xy and that camera have a driver that supports multiple cameras it will work just fine.

So, does ANYONE know if there is another "generic" usbvideo driver from other company then Microsoft ?
I did google but cant find any. but then again there is always hope!
gripner
 
Posts: 5
Joined: Thu Oct 25, 2018 9:03 pm

Re: Playing multiple cameras of same model not working

Postby gripner » Mon Jun 24, 2019 6:44 am

After finaly finding some information.
Issue seems to be that the "usbvideo.sys" enumerates the usb and basicaly "asks" for just about all USB bandwidth/resources thus when camera nr 2 using same driver there are no resources left.

Where i found this information they mentioned USB3 might work better, did not for me, might be since cameras are not true USB3 cameras uncertain.
But "easiest" solution is to put the 2 camera son DIFFERERNT usb controllers, easy way for me was to put one camera in USB2 connector and one camera in USB3 connector, then I for sure know its on two different controllers.

Works just fine like this.
gripner
 
Posts: 5
Joined: Thu Oct 25, 2018 9:03 pm




Return to AForge.NET Framework