AForge.NET

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

Make aforge work with Unity

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

Make aforge work with Unity

Postby aalexxjaz » Wed Nov 13, 2019 5:22 pm

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
aalexxjaz
 
Posts: 1
Joined: Wed Nov 13, 2019 5:18 pm



Return to AForge.NET Framework