Welcome to LEAD Support Forum Login | Register | Faq  

    LEAD Support Forum
  Resource to find answers and post technical questions about LEAD products.
Search    
   

Re: How to select only one capture device
Started by sdecorme at 07-22-2008 5:26. Topic has 7 replies.

Print Search « Previous Thread Next Thread »
  07-22-2008, 5:26
sdecorme is not online. Last active: 10/23/2008 3:11:20 PM sdecorme

Top 75 Posts
Joined on 07-22-2008
FRANCE
Posts 30
How to select only one capture device
Reply Quote
Hi
On my computer I've lot of video input device and it change between different configuration I need to be sure that each AxltmmCaptureCtrl have is own device for example:
AxltmmCaptureCtrl1 with Card1
AxltmmCaptureCtrl2 with Card2
AxltmmCaptureCtrl3 with Card3
The example give a listing but on my system the position in the listing can change
I'm would like to do it in c#
thanks

   Report 
  07-22-2008, 10:46
Adam Boulad is not online. Last active: 1/8/2009 3:31:15 PM Adam Boulad



Top 10 Posts
Joined on 09-16-2007
Posts 541
Re: How to select only one capture device
Reply Quote
Hello,
If you set the AxltmmCaptureCtrl1.VideoDevices.Selection to the desired device number, the control would use that device.
However, if the numbers change from time to time, you can search for the device using AxltmmCaptureCtrl1.VideoDevices.Find() before assigning the index you want.
Adam Boulad
LEADTOOLS Technical Support

   Report 
  07-23-2008, 5:30
sdecorme is not online. Last active: 10/23/2008 3:11:20 PM sdecorme

Top 75 Posts
Joined on 07-22-2008
FRANCE
Posts 30
Re: How to select only one capture device
Reply Quote
Thanks I find my way with your example.
Now I'v another problem , I've two AxltmmCaptureCtrl with 2 video acquisition card and of course I've to switch between everything and I've a problem when I use 2 AxltmmCaptureCtrl.an
With one AxltmmCaptureCtrl  I can swicth video to another but when I use 2 AxltmmCaptureCtrl the video doesn't change.
I  use C#

        private void EchangeVideo()
        {
            AxltmmCaptureCtrl1.Preview = false ;
            AxltmmCaptureCtrl2.Preview = false ;

            //charge les possibilités d'outils d'acquisition
            int countVideo1 = AxltmmCaptureCtrl1.VideoDevices.Count;
            string[] videoDeviceList1 = new string[countVideo1];
            for (int i = 0; i < countVideo1; i++) videoDeviceList1[i] = AxltmmCaptureCtrl1.VideoDevices.Item(i).FriendlyName;

            int countVideo2 = AxltmmCaptureCtrl2.VideoDevices.Count;
            string[] videoDeviceList2 = new string[countVideo2];
            for (int i = 0; i < countVideo2; i++) videoDeviceList2[i] = AxltmmCaptureCtrl2.VideoDevices.Item(i).FriendlyName;
           
            if (VideoJour == true) //flag to change video mode
            {
                VideoJour = false;
                try
                {
                    AxltmmCaptureCtrl1.VideoDevices.Selection = 2;
                    AxltmmCaptureCtrl1.VideoCaptureSizes.Selection = 13;
                    AxltmmCaptureCtrl1.Preview = true;
                }
                catch (Exception)
                {
                }
                try
                {
                    AxltmmCaptureCtrl2.VideoDevices.Selection = 3;
                    AxltmmCaptureCtrl2.VideoCaptureSizes.Selection = 1;
                    AxltmmCaptureCtrl2.Preview = true;
                }
                catch (Exception)
                {
                }
            }
            else
            {
                VideoJour = true;
                try
                {
                    AxltmmCaptureCtrl1.VideoDevices.Selection = 3;
                    AxltmmCaptureCtrl1.VideoCaptureSizes.Selection = 13;
                    AxltmmCaptureCtrl1.Preview = true;
                }
                catch (Exception)
                {
                }
                try
                {
                    AxltmmCaptureCtrl2.VideoDevices.Selection = 2;
                    AxltmmCaptureCtrl2.VideoCaptureSizes.Selection = 1;
                    AxltmmCaptureCtrl2.Preview = true;
                }
                catch (Exception)
                {
                }
            }
        }
Any ideas ?
thanks

   Report 
  07-23-2008, 8:02
sdecorme is not online. Last active: 10/23/2008 3:11:20 PM sdecorme

Top 75 Posts
Joined on 07-22-2008
FRANCE
Posts 30
Re: How to select only one capture device
Reply Quote
One more question
I use the two same acquisition system and they have the same name in the system properties sot I can't use
                    AxltmmCaptureCtrl1.VideoDevices.Selection = AxltmmCaptureCtrl1.VideoDevices.Find("DFG / USB2 - lt");

with this fonction the selection work fine
                    int countVideo2 = AxltmmCaptureCtrl2.VideoDevices.Count;
                    string[] videoDeviceList2 = new string[countVideo2];
                    for (int i = 0; i < countVideo2; i++) videoDeviceList2[i] = AxltmmCaptureCtrl2.VideoDevices.Item(i).FriendlyName;
                    AxltmmCaptureCtrl2.VideoDevices.Selection = 2;
                    AxltmmCaptureCtrl2.VideoCaptureSizes.Selection = 1;
                    AxltmmCaptureCtrl2.Preview = true;

but if I use my software on another Computer the VideoDevices.Selection will not be the same
Is there another way to choose my device ?
Thanks

   Report 
  07-23-2008, 11:14
Adam Boulad is not online. Last active: 1/8/2009 3:31:15 PM Adam Boulad



Top 10 Posts
Joined on 09-16-2007
Posts 541
Re: How to select only one capture device
Reply Quote
About your second post, I'm not sure that understand the problem, what exactly do you mean by switching the video?
Does this happen when you try change the VideoDevices or when you change the VideoCaptureSizes? What exactly do you mean by 'Switching videos'?
Can you please provide me with more details?

About the third post, if you have two devices with the same friendly name, there will be instances in VideoDevices with different indices. In this case,  the user should select the device that he wants to use.

If you have a different questions, please create a new forum post and give details regarding your question.
Adam Boulad
LEADTOOLS Technical Support

   Report 
  08-11-2008, 3:30
sdecorme is not online. Last active: 10/23/2008 3:11:20 PM sdecorme

Top 75 Posts
Joined on 07-22-2008
FRANCE
Posts 30
Re: How to select only one capture device
Reply Quote
My 2 devices have exactly the same friendly name where can I find the indice you talk about.
I've 2 AxltmmCaptureCtrl on my frame I to switch the video between this AxltmmCaptureCtrl.
VideoA size1 with AxltmmCaptureCtrl1
VideoB size2 with AxltmmCaptureCtrl2
When I switch I want to do
VideoB size1 with AxltmmCaptureCtrl1
VideoA size2 with AxltmmCaptureCtrl2
At the startup I have my 2 video but when I make the first switch I loose them.


   Report 
  08-11-2008, 12:30
Adnan Ismail is not online. Last active: 1/6/2009 4:12:02 PM Adnan Ismail



Top 10 Posts
Joined on 07-31-2006
Posts 1,367
Re: How to select only one capture device
Reply Quote
For each of the 2 controls, you will have a list of devices. You simply set the index to one of the listed device indices.

This means, if you want to switch, you do it like this:
//Get the 2 index values:
old1 = AxltmmCaptureCtrl1.VideoDevices.Selection
old2 = AxltmmCaptureCtrl2.VideoDevices.Selection

//Clear the selection for both controls
AxltmmCaptureCtrl1.VideoDevices.Selection = -1
AxltmmCaptureCtrl2.VideoDevices.Selection = -1

//switch the 2 indices:
AxltmmCaptureCtrl1.VideoDevices.Selection = old2
AxltmmCaptureCtrl2.VideoDevices.Selection = old1


Adnan Ismail
LEADTOOLS Technical Support

   Report 
  08-12-2008, 2:16
sdecorme is not online. Last active: 10/23/2008 3:11:20 PM sdecorme

Top 75 Posts
Joined on 07-22-2008
FRANCE
Posts 30
Re: How to select only one capture device
Reply Quote
It work thanks you [Y]
See you on another post quickly [;)]

   Report 
Post
LEAD Support Fo... » Enduser » Capture & Conve... » Re: How to select only one capture device

Powered by Community Server, by Telligent Systems