Code Monkey home page Code Monkey logo

hololenscamerastream's People

Contributors

jonmcelroy avatar labellson avatar motionsmith avatar soylentgraham avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hololenscamerastream's Issues

What is the size of the Image?

I am reading the code of MatrixUsageApp and I can see that the byte[] array that contains the image is a one dimensional array. The size of it is obtained through sample.dataLength where sample is a VideoCaptureSample

Reading the code of VideoCaptureSample I notice that I can get the total size of the data (with dataLength) but how can I get the Height and Width (in pixels) of the image?? I need this to do 2D processing.

Get camera stream from remote device

Any idea if it would be possible to get the camera stream from a remote HoloLens device?
I would like to have the Unity-Editor and enter the IP of my HoloLens device, and it would render the devices camera stream in the Unity-Editor on my PC.

Cannot set camera parameters (resolution, frame rate, etc)

The camera parameters that are passed into VideoCapture.StartVideoModeAsync() are not applied in the plugin.

I have done some work to try to apply them, but I get an error in the plugin that says The stream number provided was invalid. My attempts so far to understand and fix this error haven't worked.

Video camera data output

Hey everyone,

I am working on a project that requires me to analyze each video frame captured from the Hololens. However, when I look at the image data it can only be uncompressed and when I try to change to a compressed format (JPEG/PNG) the video camera will not start.

My Questions:
What format is the uncompressed data in? I tried BGRA and NV12 and neither of those were readable for me in Unity or OpenCV.

Is there a reason as to why when I compress the data the video is prevented from starting?

Thank you
~Zach

Doing Image Processing on the RGB Image

I have read the examples and I can see that I will have the image loaded on _latestImageBytes.
Now, same as what SoylentGraham commented in https://github.com/VulcanTechnologies/HoloLensCameraStream/issues/10 I can understand of course that this is an 1D array. I suppose the BGRA is similar to the Format32bppArgb format.

I want to do some Image Processing on this image. (I have already the algorithms I want to implement so no problem there) Can anyone give some advice or pointers on how to proceed?


In the file MatrixUsageApp.cs or in VideoPanelApp.cs I see there is a OnFrameSampleAcquired function. I get that this is the function that gets called on every frame. Inside the function there is the UnityEngine.WSA.Application.InvokeOnAppThread call .

I don't understand this so well. Is this being called on another thread? Should I put all my processing inside this? (I do a lot of processing) . And if it is done on another thread, how can I finally get some results back to the Unity UI Thread (that I suppose is the one starting it)

Thousand thanks for any help. I really like this library.

Raw distorted video frames

Hello!

First of all great work!

I was wondering if there are any capabilities as to capturing the raw distorted camera images from the locatable camera? According to the documentation (https://docs.microsoft.com/en-us/windows/mixed-reality/locatable-camera), the camera image processing of the HoloLens has built in undistortion of the camera images and I am finding this to be a little inaccurate. Also found in the documentation they say the the raw distorted camera frames are still preserved in the "preview" mode (not exactly sure what this is) while the undistortion happens with the photo and video capture. I was basically wondering if you have any input as to how to access the preview stream to fetch the raw image data. Could it perhaps be a setting to the Media Capture?

Thank you for your input and again, great work :)

Camera Capture icon still active after calling StopVideoModeAsync

Hello,
First thanks for this wonderful library that is really helpfull !
My issue : Hololens has recently updated two days ago, and now when calling StartVideoModeAsync, a camera icon starts flashing on top left of the HoloLens screen. When calling StopVideoModeAsync for the first time, camera capture stops and icon disapear. Start and Stop capture again, and icon stays forever flashing on screeen until I quit the application. The video capture is stopped, however the fps are slow like if capture mode was still active.
I could reproduce the issue with the Projection Example sample, on master branch and unity 2017.2

Thanks,
Regards, Jean

NotImplementedException: The requested feature is not implemented

Hello,

When I want to try the VideoPanel example I get this error in Unity: NotImplementedException: The requested feature is not implemented.
HoloLensCameraStream.VideoCapture.CreateAync (HoloLensCameraStream.OnVideoCaptureResourceCreatedCallback onCreatedCallback)
CameraStreamHelper.Awake () (at Assets/CamStream/Scripts/CameraStreamHelper.cs:88).
When I try the solution in Visual Studion on Local Machine in the Debug Console show:
"Creating the VideoCapture object failed."
What is the problem and how can I solve it?
Mention that I have version 5.6 of Unity and I follow all the steps in the readme.
Thank you :)

Holotoolkit is having issues in 5.6 (heads up)

Hey there,

Just found this project today - looks awesome. Will aim to contribute once I figure out how.

I noticed the project is built in 5.6 and wanted to give you a word of warning that there seems to be something messed up in the WorldAnchor system in HoloToolkit in 5.6. I encountered some very odd behavior losing worldanchors and failing builds from visual studio with a different project I upgraded and found some forum threads online with similar problems. The Holotoolkit doesn't officially support 5.6 yet so I believe that is why.

Provide access to bitmap buffer pointer

Right now, developers can only copy the the bytes from the buffer, a process which creates significant overhead and memory consumption. Developers should be able to access and manage a direct pointer to the byte stream.

Not working with Unity 2018.2.0f2

Hi, I've tried to compile the 2018 example with Unity Editor 2018.2.0f2 but the output of the video is appear on the image canvas. It just white but the camera icon is blinking. Any solution to fix this? Thank you.

Not working with the latest version of unity 2017.3.1

Thank you for the great effort

I am trying to run the 2017.3 branch but all i get is white feed. when I debug, inside: CameraStreamHelper.Instance.GetVideoCaptureAsync(OnVideoCaptureCreated);
the videocapture is coming null

Any idea?

Unauthorized access exception on build

Hi,

I used HoloLensCameraStream to send image frames to a server.
But when i compile i have his error:

System.UnauthorizedAccessException: 'Access is denied. (Excep_FromHResult 0x80070005)'

on that line :
public static async void CreateAync(OnVideoCaptureResourceCreatedCallback onCreatedCallback){ var allFrameSourceGroups = await MediaFrameSourceGroup.FindAllAsync();

thank tou for your help

Impossible to build on Unity 2017.4.10f1 LTS 64bits

Hello,

I want to compile at least one of your example but I get on VS on building before deployment. I got:

Severity Code Description Project File Line Suppression State
Error The command ""C:\Users\sal\Documents\Unity\HoloLensCameraStream-master\HoloLensVideoCaptureExample\App\Unity\Tools\AssemblyConverter.exe" -platform=uap -lock="C:\Users\sal\Documents\Unity\HoloLensCameraStream-master\HoloLensVideoCaptureExample\App\HoloLensVideoCaptureExample\project.lock.json" -bits=32 -configuration=Release -removeDebuggableAttribute=False -uwpsdk=10.0.17134.0 -path="." -path="C:\Program Files\Unity\Editor\Data\PlaybackEngines\MetroSupport\Players\UAP\dotnet\x86\Release"
followed by a long list of path.

I tried on 2017.4.9f1 and it was the same thing. I work on windows 10 version 1803 and compile with the sdk 10.0.1734.0 and tried on scripting runtime 3.5 or 4.6 and API compatibility 2.0 or 4.6.

Thanks in advance for your help.

How to run example stream?

Hello,
I have succesfully deployed example to Hololens.
How should it work? I see white panel - maybe video screen. But what's next?
Is there any client application in this example?

Thanks in advance for answer.

Point cloud data

Hi! I am trying to use this plugin to extract point cloud data for feature matching. I am wondering whether it is possible?

Could not deploy code to HoloLens

I have to implement something that's how to access the camera of HoloLens and send the video stream to PC side. According to the mentioned step, I do the same step. I just build the project and do not change anything in the DLL file. Because I just want to run the example project at first. So, for this at first, I build the plugin, at that time I also setup missing NuGet packages. Then I jump to "Running the example Unity Project". in Unity, there's no problem with building the SDK and other parameters.

Now, go for VS solution, setting the deploy (ARM to x86, Device) and when I start to debug and deploy the code to HoloLens, at that time there has an error generated in Visual Studio.

error

Severity	Code	Description	Project	File	Line	Suppression State
Error The command ""C:\unity\Hololens\App\Unity\Tools\AssemblyConverter.exe" -platform=uap -lock="C:\unity\Hololens\App\Hololens\project.lock.json" -bits=32 -configuration=Debug -removeDebuggableAttribute=False -uwpsdk=10.0.16299.0 -path="." -path="C:\Program Files\Unity\Editor\Data\PlaybackEngines\MetroSupport\Players\UAP\dotnet\x86\Debug" "C:\unity\Hololens\App\Hololens\Assembly-CSharp.dll" "C:\unity\Hololens\App\Hololens\Assembly-CSharp-firstpass.dll" "C:\unity\Hololens\App\Hololens\UnityEngine.dll" "C:\unity\Hololens\App\Hololens\UnityEngine.Analytics.dll" "C:\unity\Hololens\App\Hololens\nunit.framework.dll" "C:\unity\Hololens\App\Hololens\UnityEngine.UI.dll" "C:\unity\Hololens\App\Hololens\UnityEngine.HoloLens.dll" "C:\unity\Hololens\App\Hololens\UnityEngine.Networking.dll" "C:\unity\Hololens\App\Hololens\UnityEngine.VR.dll"" exited with code 1.	Hololens	C:\unity\Hololens\App\Hololens\Hololens.csproj	282	

Now, I'm stuck with this. Could you please help me to solve this? Please tell me what I could and how I could solve it. For your info, I also attached this image.

For your info, I want to mention that I use Unity Version: 5.6.0f3 and the Visual Studio 's version is: Visual studio community 2017 .

List<Byte> Support

Is it possible to get ListBytes from CopyRawImageDataIntoBuffer?

Thanks

Visual Studio Debug Problem (Unity 2017.3)

Hello, I downloaded the 2017.3 branch, then opened the video capture example, changed unity project settings as described in the readme and build the solution (through unity) .
The problem is that when i try to run the project (debug ,x86 ) on the hololens emulator using Visual Studio 2017, I got the following error :

https://pastebin.com/BC4fD1NV

(pasted there because it's too long)

I'm asking here because i see only a list of file paths and i can't understand why, thank you.

VideoCaptureSample.CopyRawImageDataIntoBuffer() byte sequence rotated by 180 degrees returns mirrored

Hey there,
First of all, thanks for this amazing plugin. I made some tests with it in the VideoPanelExample.
I've been playing with this line of code of VideoPanelApp

cameraParams.rotateImage180Degrees = true; //If your image is upside down, remove this line.

The line below decides the value of rotation property in VideoCapture

The issue appears if rotateImage180Degrees = true because the property is applied and the byte sequence returned is rotated by 180 and mirrored.

hololens_pic_of_pic_mirrored

If rotateImage180Degrees = false, the byte sequence returns without any rotation, but upside-down.

hololens_pic_norotated

I think, mirroring horizontally the byte sequence would be the best way to solve the issue, but I haven't found a way to achieve this in the MediaCapture documentation.

A possible workaround would do it manually outside the plugin.

private byte[] mirrorByteBufferHorizontally(int width, byte[] b)
{
        wisdth *= 4;
        byte[] _b = new byte[width];
        for (int i = 0, j = b.Length - width; i < j; i += width, j -= width)
        {
            Array.ConstrainedCopy(b, i, _b, 0, width);
            Array.ConstrainedCopy(b, j, b, i, width);
            Array.ConstrainedCopy(_b, 0, b, j, width);
        }

        return b;
}

Integration in Unity 2017.2

Hello,
I am trying to use your tool in Unity 2017.2.0f3. I followed your instructions for building the dlls and modified some bits of code in the examples, since Unity thought that your VideoCapture class was its class in the namespace UnityEngine.XR.WSA.WebCam (https://docs.unity3d.com/2017.2/Documentation/ScriptReference/XR.WSA.WebCam.VideoCapture.html); so I had to change some declarations here and there. Anyway, the unity project compiled and the VideoPanel example scene was built correctly. Then, I deployed it on the HoloLens. The application started, but it immediately crashed. the problem is that Visual Studio doe not detect any error and I only have a simple output message, shown in the attached image. What could be the problem?
output

_latestImageBytes Buffer decoding issue

Hi.

Firstly Thank you for this awesome plugin!

I am trying to convert the

_latestImageBytes

byte array (retrieved from VideoCaptureSample.CopyRawImageDataIntoBuffer() ) into the SoftwareBitmap for UWP. However, I faced

Component not found exception

at the Creation of the bitmap decoder. However, the same set of code works for byte array image retrieved from the uwp file picker. Could you help with the issue? Is there any other way to convert the retrieved image to softwarebitmap?

below is the code sniplet. I am using the BGRA pixel format.

InMemoryRandomAccessStream randomAccessStream = new InMemoryRandomAccessStream();

await randomAccessStream.WriteAsync(_latestImageBytes.AsBuffer());

randomAccessStream.Seek(0);

BitmapDecoder decoder = await BitmapDecoder.CreateAsync(randomAccessStream); // this is where exception happens!

openCVInputBitmap = await decoder.GetSoftwareBitmapAsync(); 

Thank you in advance!

Performance crash after using videostream

Hi,
i love your asset. It works perfectly fine and i could integrate it to my project.
However, once i open the videostream the app runs really slow.
I already tried to disable the video panel and camera stream gameobject.
I also disabled the video panel app script on the main camera.
But even after this the app runs really slow.

Is there any way to keep the performance high after using the video stream?

Thanks,
Dinesh

Save Byte[] as Image but at a framerate of 1 fps

I'm new to Hololens + Unity, so if I ask anything stupid, sorry in advance.
Currently I'm trying to record each frame and corresponding camera position and rotation from a video stream. I add the following part inside of "UnityEngine.WSA.Application.InvokeOnAppThread":
` UnityEngine.WSA.Application.InvokeOnAppThread(() =>
{
var texture = new Texture2D(_resolution.width, _resolution.height, TextureFormat.BGRA32, false);
texture.LoadRawTextureData(_latestImageBytes);
texture.Apply();

        byte[] ImageBytes = texture.EncodeToJPG();
        string file = string.Format(@"Image_{0:yyyy-MM-dd_hh-mm-ss-fff-tt}.jpg", DateTime.Now);
        string pathToSave = System.IO.Path.Combine(Application.persistentDataPath, file);
        File.WriteAllBytes(pathToSave, ImageBytes);

    }, false);`

As a result, I can save the frame from the video but at a framerate of 1 fps. I've change the framerate to the highest using function "CameraStreamHelper.Instance.GetHighestFrameRate(_resolution)", but it doesn't work.
So, I was wondering if I place the frame saving codes in a wrong place? If so, what's the correct way to do it? Also, I'm not very sure about how to save the byte[] as an image. Is there any other way to do it more decently?
Thanks in advance for your help.

Can not start HoloLens App after adding this Plugin

I've a working HoloLens App and added your HoloLensCameraStream Plugin. I can build the app and deploy it to the HoloLens. But after starting the app, it's crashing. The only log i get is "Loading native plugins".
When i comment out the parts where I'm using the Plugin and rebuild the App, everything is working fine.

I followed the steps in the readme, added both plugins (double checked, if the right plugin is in the right Folder) and for the real one I set "UWP", "Dot net" and the placeholder Plugin

Trying to use RequestNextFrameSample (Exception)

As recommended in VideoCapture I am trying to use RequestNextFrameSample instead of subscribing tro the FrameSampleAcquiredCallback event.
So inside MatrixUsageApp.css I wrote

//Called every frame
    private void Update()
    {
        //Here we will call _videoCapture.RequestNextFrameSample()
        //But first we have to deactivate the subscription of FrameSampleAcquired
        //and then call it
        _videoCapture.RequestNextFrameSample(OnFrameSampleAcquired);   
    } 


Of course I commented the lines where the event subscription ocurred. To me this should have worked but I got an exception thrown in RequestNextFrameSample System.NullReferenceException
So I am guessing I am using this badly,
Can I get some help and advice on this issue? Thanks in advance

The error I got is 1073740791 (0xc0000409) which according to microsoft forums means “Stack Buffer Overrun”.

It seems don't acquire frames after video mode started

`
/* -------------------------------
Codes for creating and setting VideoCapture object
----------------------------------*/
private void OnVideoStarted(VideoCaptureResult result)
{
if (result.success)
{
Debug.Log("---------Started---------");
_videoCapture.RequestNextFrameSample(VideoCapture_FrameSampleAcquired);
}
}

private void VideoCapture_FrameSampleAcquired(VideoCaptureSample videoCaptureSample)
{
    Debug.Log("go");
}`

In the console, ---------Started---------is printed but "go" never shows up. I tried add event before, but it didn't work either. Is anywhere going wrong with me?

Exception: Could not find an encoding property set that matches the given camera parameters.

I got this exception after I put the initialisation of my camera parameters in the callback function(?) for VideoCapture.CreateAync().
I googled it and saw it is an exception thrown by the plugin it self on this line. I looked over there but that didn't really help me.
Does anyone have a suggestion?

VideoCapture _videoCapture;

void Start () 
{ 
        VideoCapture.CreateAync(OnVideoCaptureInstanceCreated);
}
...
private void OnVideoCaptureInstanceCreated(VideoCapture videoCapture)
    {
        if (videoCapture == null)
        {
            Debug.LogError("No VideoCapture Instance was created");
        }
        else
        {
            _videoCapture = videoCapture;

            _resolution = _videoCapture.GetSupportedResolutions().OrderBy((r) => r.width * r.height).FirstOrDefault();
            int frameRate = 2;

            videoCapture.FrameSampleAcquired += OnFrameSampleAcquired;

            CameraParameters cameraParams = new CameraParameters();
            cameraParams.cameraResolutionHeight = _resolution.height;
            cameraParams.cameraResolutionWidth = _resolution.width;
            cameraParams.frameRate = frameRate;
            cameraParams.pixelFormat = CapturePixelFormat.JPEG;
            cameraParams.enableHolograms = false;

            videoCapture.StartVideoModeAsync(cameraParams, OnVideoModeStarted);
        }
    }

VideoCaptureSample.CopyRawImageDataIntoBuffer () returns the byte sequence of the image rotated by 180 degrees.

Thank you very much for the wonderful asset.

I am a developer of OpenCV for Unity.
https://www.assetstore.unity3d.com/#!/content/21088

I tested a project that combines HoloLensVideoCaptureExample and OpenCVforUnity ,and it works fine. FPS has improved compared to using WebCamTexture.
However, since the byte sequence by CopyRawImageDataIntoBuffer () is rotated by 180 degrees, it is necessary to rotate again before image processing with OpenCV.

Is there a way to get the byte sequence not rotated by 180 degrees?

Make locatable camera attributes useful to Unity

The locatable camera attributes that come with the frame sample are returned as raw byte arrays and are not usable in the Unity world coordinate system. The viewTransform and projectionTransform can be used to map 2D pixel locations to 3D points in space (and vice versa), but not as they are currently.

Some research needs to be done to understand how to accomplish this.

get error on Unity

Hi
First thank you so much for contributing the code.
I want to apply OpenCV on image from Hololens camera for object recognition and I found your code.
While trying to running sample, I encountered this error.
image
Then, should I install this package manually?
or did I miss something?
(I opened the unity project, was trying to import HoloLensCameraStream unity package into the project and got the error)
I'm looking forward to your reply.
Thanks.

Vague Readme file...

When the readme says "Find the DLLs you just build: Look in the output window" this does not help without the names of the DLL files. There's a LOT in the output window. Are you talking about "Assembly-CSharp.dll"? I see two of those. Kind of weird you'd name them THAT, but OK. I'm not feeling so good about going forward at this point.

"Paste the plugin DLL into Unity" Should I be looking for a "plugin.dll"? I don't see that anywhere. I hope we're still talking about Assembly-CSharp.dll.

"Copy the plugin DLL from the output directory" None of the DLLs are in a directory named \output. Should they be? I've got one in \Release\ and one in \Release\Unprocessed. Is this normal?

I hope I don't set my laptop on fire, but I'll try going forward with "Assembly-CSharp.dll" and see how far I get.

NotImplementedException: The requested feature is not implemented.

Hello. I am using this project to capture live frames. When I run example in "HoloLensVideoCaptureExample\Assets\CamStream\Examples"
for example "video panel example" I met the exception

NotImplementedException: The requested feature is not implemented.
HoloLensCameraStream.VideoCapture.CreateAync (HoloLensCameraStream.OnVideoCaptureResourceCreatedCallback onCreatedCallback)
CameraStreamHelper.Awake () (at Assets/CamStream/Scripts/CameraStreamHelper.cs:93)

It seems that the code hasn't been implemented?
I don't know if I am wrong or the code have been deleted.Can anyone help me?

Mirrored Video Feed

First of all, great work on this Camera Stream provider. Everything is working really well!

I have seen in some previously closed issues that there has been som problems with the video feed being mirrored. This also seems to be the case for me, and I cannot find a fix for it. By enabling the rotate180degrees flag, it is indeed not upside-down anymore, but the left part of the image is shown on the right side etc. This poses problems for me as I am trying to use it for pattern recognition(tracking real world position of a pattern).

I saw some of the resources linked in #1 but I trouble implementing it. Any ideas? (I know I can simply swap the bytes from the resulting image, but this seems terribly inefficient...)

Thanks!

Editorsupport for Development

Hello,

can you add support for the Editor Play mode.
This make it lot easyer to test and evaluate for computer Vision

How do I actually get a frame?

This might be a stupid question, but how do I actually use this? I call videoCapture.StartVideoModeAsync and... That is where I'm stuck. Any help would be greatly appreciated

deploying on VS .Net 4.6

Hi and thank you for this amazing project.
I am trying to run some processing and I need OpenCvSharp.Dnn to be included in the project. I couldn't find a version other than OpenCvSharp4 4.0.0.20190108 that included this library. However I had to change the target program to :
Scripting Runtime: .NET 4.6
for the library to be included and then I could install OpenCvSharp4 4.0.0.20190108 add in:
using OpenCvSharp.Dnn
Now before I even included the new " using OpenCvSharp.Dnn" I gave it a go on my hololens and I got the following message:

Setting up 1 worker threads for Enlighten.

Thread -> id: 24c -> priority: 1

You're integrating from APP thread, call item directly instead.

(Filename: C:\buildslave\unity\build\PlatformDependent/MetroPlayer/AppCallbacks.cpp Line: 438)

The program '[3356] HoloLensVideoCaptureExample.exe' has exited with code -2147483645 (0x80000003).

And the application for the "HololensVideoCapture" seems to be running fine. (I'm not sure if it actually uploaded or if it ran into a problem and Just rolled back to the previous version - I'm a beginner with the Hololens )
So I wanted to see if anyone has tried running this program in a runtime .Net 4.6 environment and are there any major problems I should be aware of .

Thank you for your amazing work.

Is it possible to run this plugin with the Hololens Emulator?

Hello, I am working remotely on a Hololens project and don't have the actual device. I downloaded the Hololens emulator and I am trying to test the plugin with it but I am so lost and getting some run-time errors. I don't know if this is due to the fact that I am running the plugin with the emulator, unity and visual studio versions compatibility, or some other cause.

Any Hints?

Hololens streaming in Android

Hi,
I mean, I have to build an Android app that streams Hololens video.
Is it possible with that code? Any suggestions?

Cannot get frame samples when setting camera pixelFormat to PNG

I am so thankful that you provided access to HoloLens camera stream. But I found a problem when I tried to get video frames as png format.
In the example unity project, I only changed the following line in OnVideoCaptureCreated of MatrixUsageApp.cs.

cameraParams.pixelFormat = CapturePixelFormat.PNG;

Then I found that OnFrameSampleAcquired was never called.
Is there something else I have to change?

Unity 2018.2 IL2CPP support

Hello,

I have been working recently on trying to get this working on 2018.2 using IL2CPP since .NET is being deprecated. To make things easier for myself untangled the dlls and wrapped it in compiler directives. But for some reason I can not, for the life of me get, past this "No capture devices available" when initializing the MediaCapture. I tried dumbing it down as much as possible into:

var allFrameSourceGroups = await MediaFrameSourceGroup.FindAllAsync();

        var candidateFrameSourceGroups = allFrameSourceGroups.Where(group => group.SourceInfos.Any((a) => a.SourceKind == MediaFrameSourceKind.Color && a.MediaStreamType == MediaStreamType.VideoPreview));
        var selectedGroup = candidateFrameSourceGroups.First();

        _mediaCapture = new MediaCapture();

        var mediaCaptureInitSettings = new MediaCaptureInitializationSettings()
        {
            SourceGroup = selectedGroup,
            SharingMode = MediaCaptureSharingMode.ExclusiveControl,
            MemoryPreference = MediaCaptureMemoryPreference.Cpu,
            StreamingCaptureMode = StreamingCaptureMode.Video
        };

        try
        {
            await _mediaCapture.InitializeAsync(mediaCaptureInitSettings);
        }
        catch (Exception e)
        {
            Debug.Log("Camera initialization failed: " + e.Message);
        }

But using il2cpp just really brakes the ability to run InitializeAsync(). Starting to suspect that there is a Unity bug going on here. Any tips?

FrameSampleAcquired not triggered when the camera is turned on

Hi, thank you for the plugin!

I tried it and it works just fine when the camera is not already used, but when I launched another thread for video chat, I couldn’t access to the camera values, the event FrameSampleAcquired is not triggered, do you know how I can fix that?

Thank you for your help

Repeatedly calling Starting and Stopping the VideoCapture crashes after a while. (Unity 5.6.3.f1)

The process crashes, even with a clean project, when repeatedly calling StartVideoModeAsync and StopVideoModeAsync to start and stop the camera stream respectively. Does anyone know what causes this?

Attached is a test project that demonstrates the issue. It's made in Unity 5.6.3f1.

Repro steps (using the test project):

  1. Open the project and modify the TimeBetweenDestroyAndCreate value as wanted. Try to keep the value sensible, a value of at least 1 should suffice.
  2. Build the project for Hololens as you would normally.
  3. Run the built solution on the Hololens. The app should automatically call StartVideoModeAsync and StopVideoModeAsync, so the privacy light on the Hololens will turn on and off repeatedly.
  4. Wait until it crashes. Usually this displays error code 0xc000027b.

Yuv frame format

Hello, It is possible to get the frame as YUV (NV12) directly from the camera? if yes how to access the yuv buffer?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.