AForge.NET

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

Start Capturing From S-Video

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

Start Capturing From S-Video

Postby eavci » Fri Oct 25, 2013 4:56 pm

I am trying to figure it out more than 3 days, but I can't established yet.

I want to capture from my Capture Card's S-Video connection (has Composite and S-Video Inputs) without using VideoCaptureDeviceForm each time.

When my program (C#) executed, I need to feed my VideoSourcePlayer with S-Video Source.

Please give a working code using VideoInput, CrossbarVideoInput or what type of code is needed.

Best Regards.
eavci
 
Posts: 4
Joined: Fri Oct 25, 2013 4:47 pm

Re: Start Capturing From S-Video

Postby andrew.kirillov » Sun Oct 27, 2013 11:09 am

VideoCaptureDeviceForm is just a form aimed to help you to select video device and choose it's crossbar settings and resolution. You can do this all in your code using properties of the VideoCaptureDevice. Check source code of the VideoCaptureDeviceForm to see how it is done.
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: Start Capturing From S-Video

Postby eavci » Tue Oct 29, 2013 7:11 pm

Sorry but, still I can't figured it out :(

Code: Select all
VideoCaptureDevice VideoKaynagi = new VideoCaptureDevice(VideoKaynaklari[GoruntuYakalamaKartiIndexNo-1].MonikerString);

VideoKaynagi.NewFrame  += new NewFrameEventHandler(VideoYeniKare);
VideoKaynagi.DesiredFrameSize = new Size(karegenislik, kareyukseklik);
VideoKaynagi.DesiredFrameRate = 25;
VideoKaynagi.CrossbarVideoInput = <Need how to set this property>
eavci
 
Posts: 4
Joined: Fri Oct 25, 2013 4:47 pm

Re: Start Capturing From S-Video

Postby andrew.kirillov » Wed Oct 30, 2013 10:20 am

eavci wrote:still I can't figured it out :(

So reading documentation is not something you've used to do?
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: Start Capturing From S-Video

Postby eavci » Wed Oct 30, 2013 5:34 pm

andrew.kirillov wrote:So reading documentation is not something you've used to do?

I read that document at least 100 times. But my coding skills isn't so good.

Documentation says;
"VideoInput CrossbarVideoInput { get; set; }"

I tried;

* VideoKaynagi.CrossbarVideoInput = (0,2);
* VideoKaynagi.CrossbarVideoInput = Videoinpt(0,2);
* VideoKaynagi.CrossbarVideoInput = {0,2};
* VideoKaynagi.CrossbarVideoInput = Videoinput{0,2};
* VideoKaynagi.CrossbarVideoInput = new Videoinput(0,2);
* Videoinput Girdi = new Videoinput;
***
**
*

But I can't write it right :(

As I say, my programming skills isn't that good. I just want someone give a simple working example :/
eavci
 
Posts: 4
Joined: Fri Oct 25, 2013 4:47 pm

Re: Start Capturing From S-Video

Postby andrew.kirillov » Thu Oct 31, 2013 7:51 am

OK, documentation must be hard. VideoCaptureDivece.AvailableCrossbarVideoInputs gives array of available video inputs. VideoCaptureDivece.CrossbarVideoInput accepts what? - yes video input. So combine those two together:
Code: Select all
VideoKaynagi.CrossbarVideoInput  = CrossbarVideoInput.AvailableCrossbarVideoInputs [0];


Of course you need to change 0 with an index of the S-Video input.
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: Start Capturing From S-Video

Postby eavci » Thu Oct 31, 2013 9:08 pm

andrew.kirillov wrote:OK, documentation must be hard. VideoCaptureDivece.AvailableCrossbarVideoInputs gives array of available video inputs. VideoCaptureDivece.CrossbarVideoInput accepts what? - yes video input. So combine those two together:
Code: Select all
VideoKaynagi.CrossbarVideoInput  = CrossbarVideoInput.AvailableCrossbarVideoInputs [0];


Of course you need to change 0 with an index of the S-Video input.


Thanks :-)
This was what I needed. Now I can start capturing from S-Video input directly :-)

Code: Select all
VideoKaynagi.CrossbarVideoInput = VideoKaynagi.AvailableCrossbarVideoInputs[1];
eavci
 
Posts: 4
Joined: Fri Oct 25, 2013 4:47 pm

Re: Start Capturing From S-Video

Postby Frugglehost » Tue May 21, 2019 7:16 pm

Below is what I did in around about way...

Code: Select all

        // Collect supported video sources
        private void EnumeratedSource(VideoCaptureDevice videoDevice) {
           
            //Clear combo box of items.
            cb_Type.Items.Clear();

            //Check if the crossbar sources are available
            if (videoDevice.CheckIfCrossbarAvailable()) {
               
                //Loop through each one to get the name of the items.
                for (int i = 0; i < videoDevice.AvailableCrossbarVideoInputs.Count(); i++) {
                    cb_Type.Items.Add(videoDevice.AvailableCrossbarVideoInputs[i].Type.ToString());
                }
            
            //Default to the 1st one.
            if (cb_Type.Items.Count>1) cb_Type.SelectedIndex = 0;

                //Set the device to match the index of the combo box.
                videoDevice.CrossbarVideoInput = videoDevice.AvailableCrossbarVideoInputs[cb_Type.SelectedIndex];
            }else {
                cb_Type.Enabled = false;
            }

            //Go check Resolutions
            EnumeratedSupportedFrameSizes(videoDevice);
        }

Frugglehost
 
Posts: 1
Joined: Tue May 21, 2019 7:11 pm




Return to AForge.NET Framework