Search Unity

AVPro Live Camera

Discussion in 'Assets and Asset Store' started by AndrewRH, May 24, 2012.

  1. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Thanks for reporting this. We will investigate further and fix any issues in the next version :)
     
  2. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Wow I remember this camera and driver....blast from the past :)

    Is the driver 64-bit or 32-bit? I think most people are running 64-bit Unity these days so you would need a 64-bit driver. Even if it does have 64-bit support, you might want to try a 32-bit download of Unity (5.6.7 I think was the last version with 32-bit support) anyway.

    Hope you can get it to work.
     
  3. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Thanks for reporting this. Where does it say that it should display a fallback image?
    Also, how are you switching between inputs?
    And how is the texture different from the inspector preview? Is it showing an image from another camera, or just an old frame from this camera, or something else?

    Thanks,
     
  4. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    It's quite hard to say exactly which hardware is supported. We have a list of hardware that we have tested in the PDF documentation that comes with the plugin. In general all DirectShow compatible devices are supported, but if the device drivers have bugs then they may not work well.

    Thanks,
     
  5. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hi All,

    AVPro Live Camera version 2.8.0 has just been released!

    You can find the updated version on the Asset Store and the free trial version on our website.

    Changes include:

    Improvements
    • Added support for XSplit-VCam virtual webcam
    • Added support for virtual webcams that support transparency
    • Improved resolution selection UI
    Thanks to everyone that reported bugs that were fixed in this release :)

    Please report any issues here on the forum, or to our Github Issues

    Thanks,
     
  6. lionrigstudio

    lionrigstudio

    Joined:
    Jul 4, 2018
    Posts:
    3
    Hi everybody, is there any way to remove or modify the automatic settings of the webcam with this plugin? Thanks !
     
  7. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    What do you mean by the automatic settings?

    Like the default exposure etc?

    I think any settings that you want modified you need to apply each time you start the camera up.
     
  8. teamamplify

    teamamplify

    Joined:
    Nov 24, 2016
    Posts:
    12
    Hi,
    is it possible to get a notification or callback every time the camera delivers a new frame?
    Thanks
     
  9. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    There currently is no events system, but you can poll to see whether the number of frames processes has changed:

    Code (CSharp):
    1. int frameCount;
    2.  
    3. int newFrameCount = liveCamera.Device.FramesTotal;
    4. if (frameCount != newFrameCount)
    5. {
    6.      framecount = newFrameCount;
    7.      // YOUR LOGIC HERE
    8. }
     
  10. teamamplify

    teamamplify

    Joined:
    Nov 24, 2016
    Posts:
    12
    That worked, thank you.

    Now i encountered another problem.
    I'm using two See3Cam_CU55 that i run at 1920*1080 @ 60Hz.

    Sometimes, after starting up my Application, one or both cameras stop sending frames. Their status in
    AVProLiveCamera
    remains active, connected, running and not paused.

    I am only able to detect that they stopped working by monitoring the
    Device.FramesTotal
    . Then I can reconnect them using HotSwapping by unplugging and plugging in again.

    But I'm not able to restart them using AVProLiveCamera.
    Currently I'm trying
    Code (CSharp):
    1. LiveCamera.Device.Close();
    2. yield return new WaitForSeconds(2);
    3. LiveCamera.Begin();
    AVProLiveCamera responds with:
    Code (CSharp):
    1. [AVProLiveCamera] unable to start camera
    2. [AVPro Live Camera] Device failed to start.
    My Questions are:
    Why does AVProLiveCamera not detect that there is something wrong and camera stopped sending frames. What could be the cause of the problem?
    If the problem can not be fixed I want to be able to restart the camera. How could i achive that?
     
    Last edited: Jul 26, 2019
  11. WelchCompositions

    WelchCompositions

    Joined:
    Sep 30, 2013
    Posts:
    29
    Hello! I've been looking to build a slow motion photobooth and found traditional webcams don't capture at a high enough frame rate. Im looking for assistance in a camera and black magic card recomendation to get at least 120fps capturing using this plugin. Any help would be greatly appreciated!
     
  12. sanrriazu

    sanrriazu

    Joined:
    Feb 19, 2019
    Posts:
    2
    Hello! I am having trouble trying to use a sentech usb3 vision camera. The first time I start Unity and play it works fine. But after the second time does not recognize the camera and throws the error "Could not find the device".

    Thanks
     
  13. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hmm that's strange.. I'm afraid we're not familiar with Sentech cameras. Do you have the latest drivers?
     
  14. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    First you need a high-speed camera..then you need to disable vsync if you want to display at a high frame rate (more than the display device).
    In the past we have used Point Grey (now FLIR) cameras for high-speed.
    If you use a BlackMagic card then I would recommend our AVPro DeckLink plugin. I believe DeckLink cards can only go up to a maximum of 120fps. All our plugins have free trial versions which can be download from our website.

    I don't have any other specific recommendations but I hope that helps.

    Cheers,
     
  15. sanrriazu

    sanrriazu

    Joined:
    Feb 19, 2019
    Posts:
    2
    Yes. If I restart Unity, the problem is solved but it only works the first time I reproduce it. It is as if Unity did not release the camera drivers and for windows they are in use by another application and cannot access it.
    note: the camera is running at 2048 x 1088 @ 167 frames.
    thanks
     
  16. teamamplify

    teamamplify

    Joined:
    Nov 24, 2016
    Posts:
    12
    Following up on this issue.

    After more testing it seems to be an issue with the USB bandwidth. I'm able to reproduce the issue when adding an external SSD und copying data. When using additional USB cards just for the cameras the issue is gone.

    I think AVProLiveCamera could handle such cases better, or at least not run into the described undefined state.
     
  17. crownhin120

    crownhin120

    Joined:
    Feb 9, 2018
    Posts:
    1
    Is there any way to support background removal function?
    Thx!
     
  18. newgaze

    newgaze

    Joined:
    Oct 27, 2012
    Posts:
    13
    Hello!
    I'm using 120 fps and 300 fps cameras.
    120fps is the BRIO of logitech.
    300 fps is FLIR.

    From AVProLiveCamera, I want to bring as many frames as possible.

    1.
    FLIR cameras are not recognized by AVProLiveCamera. Is there a way to get frames from cameras?


    2.
    I'm setting with QualitySettings.vSyncCount = 0, Application.targetFrameRate = -1.
    Is this the only way to get as many frames as possible?
    Is there any way to bring the frame of the camera, regardless of FrameRate? like calling DLL directly to bring frames?

    3.
    I save the frame of the camera to use it later.
    Code (CSharp):
    1. //save textures
    2. RenderTexture.active = (RenderTexture)OutputTexture;
    3. PlayTextures[frameCount].ReadPixels(new Rect(0, 0, OutputTexture.width, OutputTexture.height), 0, 0, false);
    4. PlayTextures[frameCount].Apply(false, false);
    5. RenderTexture.active = null;
    Is there any other better way?


    4.
    What is the difference between CaptureFPS and DisplayFPS?

    Thanks!
     
    Last edited: Sep 20, 2019
  19. Captivate_Gee

    Captivate_Gee

    Joined:
    Oct 25, 2016
    Posts:
    1
    Sorry for my lack of knowledge but how would do the following:

    I have a 2 laptop setup, the 1st has our VR unity application playing and 2nd laptop would be used to play videos stored locally plus a webcam attached to it.

    I would need to display whatever is on the 2nd laptop into the 1st laptop directly into the unity application that would display on a gameobject plane? Would this setup be offline or online, what additional hardware/software would I need and which one of your assets would I need achieve this setup?


    Many thanks in advance for your help.
     
  20. eparinib

    eparinib

    Joined:
    Jun 9, 2018
    Posts:
    1
    Hi,
    we have a little problem with AVProLiveCameraGrabber.

    The live video is rotated 180 degrees when I use this script, but it works fine if I turn it off.
    Please see the Attach (a little blurred for privacy)
    What can it depend on?

    Unity 2019.2.5f1
    Logitech Brio
    AVProLive Camera 2.8.0


    Thanks
     

    Attached Files:

    tokushima802 likes this.
  21. danUnity

    danUnity

    Joined:
    Apr 28, 2015
    Posts:
    229
    Hi, I just brought the AVPro Live camera and I'm trying to get the 4K feed from the ZCAM E2 I just brought. It's working flawlessly in OBS studio but not in Unity for some reason. I'm getting a black screen and not available resolutions. The ZCam E2 has his own Streaming software that I have installed on my PC which converts the signal coming from the camera to 8 virtual webcams. It does not work in Unity for some reason though! Any idea? Should work since it works in OBS right?
     
  22. tetship

    tetship

    Joined:
    Sep 3, 2013
    Posts:
    1
    Hello,
    I'm having an issue with AvPro live camera view turning black in editor, after regaining application focus.
    It happens even with all the demo scenes in the asset package.

    Windows 10
    Unity 2019.2.11f1
    AVProLive camera 2.8.0


    To reproduce :
    - Open for example DefaultCameraDemo scene
    - Click play and select webcam -> everything works just as it's supposed to work.
    - Change focus to another program -> everything is still working in the editor, and the video is showing.
    - Change focus back to unity -> the video turns black, on the viewport and in the AV Pro Live Camera script.

    It's still showing the 'Displaying at xx.x fps" text, and it's changing.
    Only way to get it back is stopping the camera and starting it again.

    It also happens when closing the camera config window.
    (ie : In playmode, from AV Pro Live Camera script on the inspector, press "Show Config Window".
    Then close the config popup window. And voila, screen is black again)

    As far as I can tell, it only happens in the editor, and not in builds.

    I did manage to hack a temporary solution for restarting the camera on application refocus that works for me,
    but there might be some issues:
    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4.  
    5. public class focusFixer : MonoBehaviour
    6. {
    7.     public RenderHeads.Media.AVProLiveCamera.AVProLiveCamera liveCamRef;
    8.  
    9.     private void OnApplicationFocus(bool focus)
    10.     {
    11.         // hack to make avLive not stop passing frames on application refocus
    12.         if (Application.isEditor) {
    13.             if (focus)
    14.             {
    15.                 Debug.Log("Fixing focus issue");
    16.                 liveCamRef.OnDestroy();
    17.                 liveCamRef.Begin();
    18.             }
    19.         }
    20.     }
    21. }
    To use, add to a gameobject in scene and assign the AVPro Live Camera Script reference to scripts liveCamRef field.

    Thanks.
     
    Last edited: Dec 11, 2019
  23. klvo

    klvo

    Joined:
    Mar 24, 2013
    Posts:
    31
    Just as honorlulu mentioned, a FLIR (Point Grey) camera is not recognized on my system either.
    In my case, it is a Flea 3 USB3 camera in Windows 10 pro, on Unity 2019.2.3f1.
    I can use the camera in Point Grey FlyCap2 software with no issues.

    There is mention on previous responses on this forum thread about these cameras working, and they are included in the documentation as being officially supported. That is the reason this camera was chosen for this project.

    Is there a specific process to get these cameras to work?
    Thank you in advance
     
  24. Turkoz

    Turkoz

    Joined:
    Aug 16, 2015
    Posts:
    8
    Hi, im trying to configure the camera in vertical not in horizontal is there any setting to change this ? if there is i couldn't find it.
    At the moment the only thing that i could do is to Scale and Crop it using a portrait resolution on the app.
    Thanks!
     
    Last edited: Jan 8, 2020
  25. klvo

    klvo

    Joined:
    Mar 24, 2013
    Posts:
    31

    We still have this issue, the FLIR camera is not being detected by the Live Camera software, but works well with other software.

    @honorlulu did you get it to work?

    @AndrewRH do you have any suggestions on this problem?
     
  26. rexcheung

    rexcheung

    Joined:
    Feb 2, 2017
    Posts:
    35
    Hi Sir,

    I just brought AVPro Live Camera.
    It enhanced my Frame rate.
    I have two questions on adoption as follows:

    (1) Is there any function to stop camera at script?
    I find an "Stop" button at "AV Pro Live Camera.cs" after run and camera enabled.
    I want my script able to stop the current selected web camera and then switch to another camera after build.

    (2) There is a "Show Config Window" button at "AV Pro Live Camera.cs" after run in editor.
    I wan to access the corresponding function in script so that user can press a button to trigger the window after build.

    Much Thanks
     
  27. rexcheung

    rexcheung

    Joined:
    Feb 2, 2017
    Posts:
    35
    In addition, the AVPro Live Camera plugin works in editor mode. It can detect my C920 webcam
    But after build, it always show "No Webcam / capture devices found".
    I am trying your given demo scene "DefaultCameraDemo".
    My unity is 2019.2.18f1 with latest AVPro Live Camera version.
     
  28. rexcheung

    rexcheung

    Joined:
    Feb 2, 2017
    Posts:
    35
    I found the problem comes from build windows Architecture.
    If i picked x86, the build output is ok.
    If i picked x86_64, the build output always shows "No Webcam / capture devices found".
     
  29. danUnity

    danUnity

    Joined:
    Apr 28, 2015
    Posts:
    229
    I found the reason it wasn't working at all... I was missing some codec. I installed https://codecguide.com/download_kl.htm K-Lite codec pack and it fixed it. At least I'm getting an image now.
    Now it does work with WebcamTexture but the performance is not that good (running at 9fps at 4K).

    AVPro shows the camera image but the colors are off and it's running at 0.02 fps which is basically nothing.

    I'm running Unity 2019.2.0f1, Windows 10, 4096x2160 RAW_BGRA32 ...
     
  30. danUnity

    danUnity

    Joined:
    Apr 28, 2015
    Posts:
    229
    Actually, is it suppose to work with 4K streaming? I saw HD written on the trailer of the plugin...

    I still can't make my camera work! It does show a proper image on WebcamTexture so why would it be not working with that plugin if its supposed to be better than WebcamTexture implementation? Is there any support available? I really gotta make this work...
     
  31. NathanRH

    NathanRH

    Joined:
    Oct 24, 2012
    Posts:
    447
    Thanks, I believe we have moved the issue thread to GitHub here:
    https://github.com/RenderHeads/UnityPlugin-AVProLiveCamera/issues/13
     
  32. NathanRH

    NathanRH

    Joined:
    Oct 24, 2012
    Posts:
    447
    I'm not sure...did you install both the 32-bit and 64-bit driver? You may have to look for the DirectShow driver specifically.
     
  33. NathanRH

    NathanRH

    Joined:
    Oct 24, 2012
    Posts:
    447
    Hi Rex,

    Yes you can look at the demo scenes or the documentation to learn more about the scripting.

    1) To stop the camera you can call:

    _liveCamera.Device.Close();

    2) To show the config window you can called:

    _liveCamera.Device.ShowConfigWindow()

    Thanks,
     
  34. NathanRH

    NathanRH

    Joined:
    Oct 24, 2012
    Posts:
    447
    No we don't have any native support for this...You would have to add your own step to rotate the texture for how you want it...
     
  35. NathanRH

    NathanRH

    Joined:
    Oct 24, 2012
    Posts:
    447
    Hmm...it sounds like an issue with the D3D textures being invalidated due to changing focus...We haven't seen this before. Which version of Unity + AVPro Live Camera are you using?
     
  36. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hi All,

    AVPro Live Camera version 2.8.2 has just been released!

    You can find the updated version on the Asset Store and the free trial version on our website.

    Changes include:

    Improvements
    • More frame rate options exposed
    • ApplyMesh and ApplyMaterial better API and behaviour, with texture property selector and editor hints for HDRP usage
    Bug fixes
    • Fixed a bug where switching webcams would sometime cause the UGUI component to stop showing the new texture frames, even though new frames were coming through
    • Fixed gamma for ZCam device as it was using a shader without gamma correction causing the image to be too bright
    • Fixed issue where disabling the gameobject with LiveCamera component would prevent component from working even when re-enabled
    Thanks to everyone that reported bugs that were fixed in this release :)

    Please report any issues here on the forum, or preferably to our Github Issue tracker

    Thanks,
     
    danUnity likes this.
  37. newgaze

    newgaze

    Joined:
    Oct 27, 2012
    Posts:
    13
    Hello Andrew,

    AVProLiveCamera is very useful. I love it.

    I save all frames of 120fps camera for a few seconds and then save only some parts as a video.

    In order to store all frames at a rate of 120 fps, Unity's framerate must be greater than 120 fps.

    Is there any way to get all the frames of the camera regardless of Unity's frame?

    For example, if I register the callback function and get a frame from the camera, I can save all frames regardless of the frame of Unity.

    If you don't have this function, I would like you to add this function.
     
  38. NathanRH

    NathanRH

    Joined:
    Oct 24, 2012
    Posts:
    447
    Yes, Unity would have to have vsync disabled and then a fast machine to run at 120fps so you can retrieve all of the frames from the camera.

    We don't currently provide any mechanism to receive frames at a faster rate than Unity can run at.

    The plugin does however have methods that we have used internally for this, but they're not documented. You can have a try with them if you want to. They're in AVProLiveCameraPlugin.cs:

    Code (CSharp):
    1.  
    2.         //////////////////////////////////////////////////////////////////////////
    3.         // Internal Frame Buffering
    4.  
    5.         [DllImport("AVProLiveCamera")]
    6.         public static extern void SetFrameBufferSize(int deviceIndex, int read, int write);
    7.  
    8.         [DllImport("AVProLiveCamera")]
    9.         public static extern long GetLastFrameBufferedTime(int deviceIndex);
    10.  
    11.         [DllImport("AVProLiveCamera")]
    12.         public static extern System.IntPtr GetLastFrameBuffered(int deviceIndex);
    13.  
    14.         [DllImport("AVProLiveCamera")]
    15.         public static extern System.IntPtr GetFrameFromBufferAtTime(int deviceIndex, long time);
    I'm really not sure how useful this is, as it's not something we support yet. In theory you could poll GetLastFrameBufferedTime() until the time changes, which means there is a new frame available, and then use GetFrameFromBufferAtTime() to retrieve a pointer to it. You would then need to copy it out. I'm not sure what format the data would be in either - it would depend on the camera device...

    Thanks,
     
    newgaze likes this.
  39. newgaze

    newgaze

    Joined:
    Oct 27, 2012
    Posts:
    13
    Thank you very much.
    I'll try it.
     
  40. rhinderer

    rhinderer

    Joined:
    Dec 12, 2016
    Posts:
    1
    I am having the same issue:

    I am working on a project that is using version 2.6.2 of your software running on Unity version 2017.4.4f1 64bit. I am currently trying to use a Flir Blackfly BFLY-PGE-23S6C-C GigE camera. This is being connected to my PC by an Ethernet to USB 3.0 adapter. This is all running on windows 10 pro. I can get the camera to show up in the FlyCap2 software but it does not show up in your demo project. I also tried with a Chameleon3 CM3-U3-13Y3C with the same results.

    I also tried with your most up to date version of 2.8.2t running in Unity version 2019.2.13f1 with the same results.
     
    Last edited: Jul 1, 2020
  41. NathanRH

    NathanRH

    Joined:
    Oct 24, 2012
    Posts:
    447
    Hi,

    AVPro Live Camera only supports DirectShow devices. You would need to install the DirectShow filters here:
    https://www.flir.eu/support-center/...owledge-base/live-streaming-using-directshow/

    Thanks,
     
  42. ferdinho

    ferdinho

    Joined:
    Sep 29, 2016
    Posts:
    6
    Hello!
    Since the last post that mentioned audio support dates back to 2018 I thought I try my luck and ask if any kind of audio capability was added since then :)
     
  43. NathanRH

    NathanRH

    Joined:
    Oct 24, 2012
    Posts:
    447
    Ahhh sadly not yet :) It's on the list, but we have a lot of different things on the list... Thanks for checking again!
     
    ferdinho likes this.
  44. LitoNavarro

    LitoNavarro

    Joined:
    Jul 31, 2019
    Posts:
    1
    Hello @NathanRH , I have a project were I get a stereo video signal through capture USB card. With the DEMO is fantastic, I can see all my inputs resolutions and so on...

    I need it to be able to play on Oculus Quest and Oculus Rift. I activated the XR Plugin management, but the video on the left and on the right does not match and overlaps...
    I do have 2D inputs and a Streoscopic input. All in desktop look ok, but doesn't work on the HMDs...

    Is there something I need to do on the setting of the plug in to watch it ok?
     
  45. NathanRH

    NathanRH

    Joined:
    Oct 24, 2012
    Posts:
    447
    Hi LitoDesign,

    That sounds promising! I'm not sure though what you're doing to display the different eyes.. Perhpas you could give more information about your setup?

    Thanks,
     
  46. INGTONY

    INGTONY

    Joined:
    Oct 13, 2014
    Posts:
    24
    hi, im testing the plugin evrything works well , but im having an issue , i have an external camera conected with CAMLINK , the video its pretty good and the the high 60 fps just run good but when i make an screen capture the image gets blur when the subject its moving, there is anotherr way to make the screen capture lets say faster? to aovid the blur
     
  47. NathanRH

    NathanRH

    Joined:
    Oct 24, 2012
    Posts:
    447
    I'm not sure...it depends how you're doing the screen capture?
     
  48. INGTONY

    INGTONY

    Joined:
    Oct 13, 2014
    Posts:
    24
  49. Lordmin

    Lordmin

    Joined:
    Mar 9, 2017
    Posts:
    62
    Hi Thank you for making a great asset.

    We are testing with the'free trial version' for purchase, and the following bug has occurred, so please contact us.


    1. In AvProLiveCamera.cs, Resolution is set to 1280x720, Frame Rate is set to 30, and Format is set to Automatic Format.
    test0.png


    2. When playing in Unity Editor, Frame Rate is set to 10
    test1.png


    Is there a way to set the desired resolution, frame rate and format at the same time?

    Changing one often turns the other.

    If only this is possible, I will buy an asset!
     
  50. NathanRH

    NathanRH

    Joined:
    Oct 24, 2012
    Posts:
    447
    That's capturing a screenshot - so the image on the camera itself must just be blurry. The only way to get non-blurry image on the camera would be to increase the frame rate, or the shutter speed. If you're looking for a fast video capture solution then I can recommend our plugin : AVPro Movie Capture.

    Thanks,