Page 1 of 1

Make aforge work with Unity

PostPosted: Wed Nov 13, 2019 5:22 pm
by aalexxjaz
Hello!
So, Im working in Unity and Im trying to access to the webcam parameters such as zoom, rotation etc. With Unity I cant so Im trying it with Aforge, but I have a problem.
First of all I downloaded the last version (the .zip) and copied all the Release folder inside the project (and deleted a couple of dll that gave me errors, robotics and debugger.)

Also I changed the Unity API to .NET 4.0.

And I have a simple script, like this:

Code: Select all
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using AForge;
using AForge.Video;
using AForge.Video.DirectShow;

public class Aforge : MonoBehaviour
{

    private FilterInfoCollection captureDevices;
    private VideoCaptureDevice videoSource;

    void Start()
    {
        Setup();
    }

    void Setup()
    {
        captureDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice);
        videoSource = new VideoCaptureDevice();
    }

}


If I dont use Unity it detects me the cameras, but here if I print the capture devices count it sais always 0.

Any idea?

Thank you