Search Unity

AVPro Live Camera

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

  1. Eric-Pratt

    Eric-Pratt

    Joined:
    Apr 28, 2014
    Posts:
    30
    I'm using the CameraExplorerDemo.unity to test my input from a Decklink Mini Recorder and the feed is divided in half top/bottom and then overlaid over each other (interlaced). Camera is a Hero2, looks good on the BM Capture/Logger, don't have any other hdmi cameras handy to see if it's the camera. Other devices (non BM) look fine) Asking if this is a familiar problem. I'm getting a 4K next week but wanted to have the code ready for when it gets here. Thanks.
     
  2. Lumen-Digital

    Lumen-Digital

    Joined:
    Aug 3, 2012
    Posts:
    16
    Hi
    I am wanting to connect 2 GoPro cameras to my laptop and view both video streams in Unity at once. I am guessing the most cost effective solution is to use 2 Blackmagic DesignUltraStudio Mini Recorder Capture Devices and a thunderbolt hub. Is this what you would suggest?
     
    Last edited: Feb 25, 2015
  3. kapetas

    kapetas

    Joined:
    Mar 11, 2015
    Posts:
    1
    Dear AndrewRH,

    I would like to know if it is possible to connect a camera and managing video records, also manage stored data to be backed up on a remote pc.
    PLease let me know.
     
  4. Ameal

    Ameal

    Joined:
    Feb 18, 2015
    Posts:
    1
    Hello!

    Does anyone know if this plugin can be used together with Metaio (AR framework)?

    Cheers,
    Ameal
     
  5. darkhus

    darkhus

    Joined:
    Nov 30, 2012
    Posts:
    17
    Hello,
    How to get Texture2D using this framework, I need raw texture/image data from camera. Is it possible with this framework? I got Texture but dont know how to convert it...

    Thanks!
     
  6. darkhus

    darkhus

    Joined:
    Nov 30, 2012
    Posts:
    17
    ok, I found solution, it's simple, I missed info that "The OutputTexture member is actually a RenderTexture"...
     
  7. 3DJayC

    3DJayC

    Joined:
    Jul 29, 2014
    Posts:
    33
    Hi!

    I tried your demo with a camera connected to a blackmagic ultrastudio SDI.

    It found two cameras ( Blackmagic WDM capture and Decklink Video Capture ).

    I think I missed something... Could you help me please?

    Thank you

    JC
     
  8. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hi JC, that is correct. The Decklink appears as 2 devices. We recommend just using the second one and ignoring the WDM. It's just 2 different video capture drivers.

    Also we have updated the plugin and demo/trial packages today to have better Decklink support. Thanks,
     
  9. AndrewRH

    AndrewRH

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

    I don't see why not...We have not tried any AR with this so we don't know how they would connect. It is possible to grab the raw pixels to an array so with a bit of scripting passing the pixels to an AR plugin should be possible. There is a free trial version on the website if you want to test these things out.

    Thanks,
     
  10. AndrewRH

    AndrewRH

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

    I guess this is possible, but this plugin doesn't have any ability to do recordings so you would need to get another solution to connect to it. We have done something similar in the past with our own plugins and scripting.

    Thanks,
     
  11. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hmmm, yes that makes sense to me! We don't have any experience with the Mini Recorders but it should work.
     
  12. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Perhaps you could share a screenshot of the problem? If it's just interlacing you can try hitting the 'deinterlace' button in the demo. Also we have a new version out now that has better support for DeckLink hardware. Thanks,
     
  13. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    If you have a look in AVProLiveCamera. cs at the bottom we have a function SavePNG() that takes Rendertexture and converts it to Texture2D and then extracts the pixels.

    It is still very slow though, so you can also look at using a more direct method of getting the pixels:
    Take a look at the AVProLiveCameraGrabber.cs file, as demonstrates how to use the GetFrameAsColor32() function which is very fast and writes directly into an existing Color32 array.

    I hope that helps,
     
  14. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Also we did some more testing and found a few more issues...we've just today released a new version of the plugin with much better DeckLink support.

    Thanks,
     
  15. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hi everyone, after a few months there is finally a new version!

    The main thing that has been fixed in v2.10 is better support for the newer DeckLink hardware.

    Otherwise there are just some minor improvements with greater compatibility for other hardware.

    Please find the new asset on the Asset Store, or try the updated free trial version on the website.

    Thanks,
     
  16. cai_bisabaik

    cai_bisabaik

    Joined:
    May 6, 2013
    Posts:
    2
    Hi AndrewRH,

    Is it possible to capture two or more different cameras and record it into two or more video files at the same time using AVPro?
     
  17. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    AVPro Live camera can handle multiple cameras at the same time (there's no limit on this really). The plugin doesn't handle any recording though but the scripts do allow frames to be grabbed so adding recording shouldn't be a problem. The amount of cameras you'd be able to record from at the same time would be largely down to the hardware it runs on.

    Thanks,
     
  18. Ben-BearFish

    Ben-BearFish

    Joined:
    Sep 6, 2011
    Posts:
    1,204
    Do you know if this plugin works with the Kinect v2 camera?
     
  19. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hmm that's a good question.. I'm not sure. The plugin has a free trial version available on the website so you can download and try it yourself really easily. Do let us know :)
    I suspect it will work... I think I read that the Kinect2 exposes the camera to DirectShow... I'm not sure about the depth though..
    I've just googled for 'kinect v2 webcam' and it seems that some people have made a plugin to expode Kinect2 as a webcam, so if you use that then it should definitely work...We haven't tried it ourselves though.
     
  20. Ben-BearFish

    Ben-BearFish

    Joined:
    Sep 6, 2011
    Posts:
    1,204
    Ok, thanks for the info. I'll try the trial version. Also, is it possible to grab the video captured from the webcams in the plugin and convert it to HDR (.hdr or .exr) or is that above and beyond the plugin's functionality?
     
  21. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Yes you can grab the frames to a buffer, but the plugin doesn't support any floating point formats currently so I don't think there would be much to gain writing to an HDR format. The plugin also doesn't handle writing to any HDR itself, it just displays camera feeds.
     
  22. eXntrc

    eXntrc

    Joined:
    Jan 12, 2015
    Posts:
    21
    I just tried this plugin with AVerMedia Live Gamer Portable (C875) and the plugin does not see the device at all (AVProLiveCameraManager.Instance.NumDevices is zero). I'm surprised at this since Unity's own WebCamTexture sees the device (but fails to initialize it with a very unhelpful "Couldn't config the stream!"). This is not a HUGE deal because I've decided to return the LGP and buy the AVerMedia CV710 instead, but I'm concerned I won't fair any better with the CV710. I noticed the 2.10 release notes specifically call out AVerMedia TV cards. Are there any plans to test or be compatible with the CV710? Its one of the most attractively priced devices right now that can capture 1080p at 60 FPS with no notable lag.

    Thanks
     
  23. Delky

    Delky

    Joined:
    Jun 4, 2015
    Posts:
    1
    Hi,
    I have a problem : when i try the demo .exe (downlaoded on the website) , all devices on my pc are working :


    But, when i try with the unity scene , it doesn't work (the display rate is null) :(

    What can i do to fix this problem ?
    thanks,
     
  24. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Unfortunately we don't have the capability to test all the hardware out there with our plugin. I'm surprised to hear that the C875 wasn't detected though. The CV710 should work as it's DirectShow compatible. It could be that there is a bug and if it doesn't work we can always send you a debug build to help us fix the issue. Thanks,
     
  25. savvvy86

    savvvy86

    Joined:
    Jun 11, 2015
    Posts:
    4
    Hi Andrew,
    I'm currently battling with multiple capture inputs. I've got it all running for one input, but the second one doesn't start automatically, just says "stopped". How can I get it to start automatically?
    Thanks.
     

    Attached Files:

  26. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Do you have two AVProLiveCamera components in your scene each set to a different device index/name? Are you able to start them both in the CameraExplorer demo?
     
  27. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Version 2.12 has just been released. This version is mainly to fix compatibility with the new Unity 5.1.

    Links:
    Update at the Unity Asset Store
    Visit Website (FREE demo download and detailed docs)

    Thanks,
     
  28. savvvy86

    savvvy86

    Joined:
    Jun 11, 2015
    Posts:
    4
    I've tried all combinations of device names/indexes, no luck so far. It doesn't seem to be influenced by index or name.

    It shows both devices (Datapath VisionRGB), but only ever plays one input at a time.
    The Explorer demo works, but I have to start the second input manually.
    This is how I've set it up (everything set to default):
    upload_2015-6-15_17-52-19.png
     
  29. AndrewRH

    AndrewRH

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

    From the screenshot I can see the name of the device in both components is the same (the name is displayed below the preview texture). You need to make sure the second instance is using the second device. This should be achievable for example by changing the device selection method to 'index' for both and using index 0 for the first device and index 1 for the second device. If that doesn't work you could change the device selection method to 'name' and set the first one to the name of the first device (exactly as printed in the preview), and the second to the second device (ends with "02"). I hope that helps,
     
  30. savvvy86

    savvvy86

    Joined:
    Jun 11, 2015
    Posts:
    4
    Yep tried all that already. The plugin just chooses one of them for both instances.
     
  31. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hmm strange! We'll look into it. In the meantime if you want you could always debug the function that selects the device based on index/name and see what's going wrong there.

    Thanks,
     
  32. savvvy86

    savvvy86

    Joined:
    Jun 11, 2015
    Posts:
    4
    I got it to work. I needed to specify the entire name of the device (including 01 and 02) AND the index of the input to get it to work.
     
  33. eco_bach

    eco_bach

    Joined:
    Jul 8, 2013
    Posts:
    1,601
  34. Akakama

    Akakama

    Joined:
    Jul 5, 2015
    Posts:
    2
    Hello, guys!
    I tried, but didnt find some information about assigning several different streams to several different materials.
    If this task have the solution within whis nice asset, share it please)
    My method of scientific poke didnt help :(
     
  35. TheElumenati

    TheElumenati

    Joined:
    Jan 22, 2014
    Posts:
    38
    Hello, I am using the plugin with a Blackmagic Decklink 4k Extreme 12g.

    I have been able to get a 4k feed (4096x2160) from an external computer to the computer with the blackmagic card on it. Unfortunately, I am only getting about 1fps display.

    After some digging this is what i have found:
    The sample program off the renderheads website works at 4096x2160@24fps capture and display.
    When i build the same "camera explorer" demo I am only getting 4096x2160@24fps capture but only 1fps display.
    I have tried to replicate the sample application's settings as close as possible using untouched source code, the same version of unity(4.1.5) and forcing a 32bit build to be single threaded (UnityEditor.PlayerSettings.MTRendering = false;)

    When i run a diff on the output log i am getting almost identical output logs except the demo download is running avprolive version 2.10 and my build from the latest asset store version is running 2.12.

    My goal is to understand why the demo app i'm building is running slow so i can fix an identical performance issue in a app that uses the plugin.
     
    Last edited: Jul 15, 2015
  36. TheElumenati

    TheElumenati

    Joined:
    Jan 22, 2014
    Posts:
    38
    I'm going to answer my own question here.

    I had an IP based camera that had drivers installed but not plugged in. This was causing a slow down in the Manager. There is a checkbox in the manager to disables polling every frame. That solved the problem in my case.

    If you need that functionality, my suggestion to renderheads is the polling should be moved into a separate thread. Another simpler option is to check the box programatically when you are in menu systems and need to make changes, but otherwise leave it unchecked when performance is critical.
     
  37. zhoy

    zhoy

    Joined:
    Mar 24, 2015
    Posts:
    10
    Hi AndrewRH
    I Want to but AVPro-Live -Camera. I want to know can you provide technical support when we find bug of it.
    Or the other option is to sell a version including Full source Code。
     
  38. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    It's not possible to convert to a WebcamTexture but it is fairly easy to integrate AVPro Live Camera into OpenCV, we have done this in the past. You basically just have to grab each frame into a color32 array and pass that into OpenCV.
     
  39. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    there is a component called ApplyToMaterial. This allows you to render a LiveCamera to a material. So you create a material for each camera and set up an ApplyToMaterial script for each camera. Let me know if this doesn't work for you.
     
  40. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Great find! Yes the 'hot swap' polling is quite heavy. We'll make it disabled by default in the future.
     
    DrShimizu likes this.
  41. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Yes we provide technical support. There is also a free demo which you can download from the website.

    Thanks,
     
  42. DrShimizu

    DrShimizu

    Joined:
    Apr 13, 2011
    Posts:
    30
    Does anyone know of a camera solution that would work for doing high frame rate capture 150fps at 1080p+ live at high quality. Im looking into GigE machine vision cameras, but none of the vendors are providing image samples...
     
  43. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    This Point Grey cameras seem to have the right specs:
    http://www.ptgrey.com/grasshopper3-23-mp-color-usb3-vision-sony-pregius-imx174
     
  44. edufurla

    edufurla

    Joined:
    Mar 7, 2014
    Posts:
    19
    Hi Everyone.
    I trying save a screenshot using Playmaker and the final part of AV Live Pro Camera Script but I am finding some difficulties because I do not know programming.
    Any help will be welcome.
    I need call this function and specify a path and a file name each time I need to save a picture.
    I have something working like this saving a string to text like example below.
    ____________________________________
    [FONT=Helvetica, Arial, sans-serif]public class savescript : MonoBehaviour {
    List<Jogador> ListaJogadores = new List<Jogador>();

    public string Ranking = "";
    public int RankCount = 0;

    public void Salvar (string TEXTO, string LOCAL){
    //File.WriteAllText(LOCAL, TEXTO); substitui
    File.AppendAllText(LOCAL, TEXTO+"\r\n"); // adiciona
    //}
    [/FONT]
    ______________________________________________

    [FONT=Helvetica, Arial, sans-serif]Basic I need a way to define a public variable to file name and save path when I call this Method.

    Thx
    [/FONT]
     

    Attached Files:

  45. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Take a look at the class AVProLiveCamera.cs at the bottom of it there is a function called SavePNG - you should be able to use this to save your image, you might just need to make the function public and remove the #IFDEF EDITOR #endif lines. Email me unitysupport@renderheads.com if you need further help with this. Thanks,
     
  46. edufurla

    edufurla

    Joined:
    Mar 7, 2014
    Posts:
    19
    Hi Andrew. Thank you for your reply.
    I did that and worked, in part.
    The image has a random name and was saved always in the project directory.
    I need to be able to specify the name and the path, but the biggest problem is I do not know C#.
    I use Playmaker. From Playmaker I can call a function inside the script like the example I post.
    If you could change the script to the PNG File name and Path become a public string I thing I can use it from Playmaker.
    Thx
    Eduardo
     
  47. AndrewRH

    AndrewRH

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

    You should try C# programming, i'm sure you would get it easily :) You can modify the script to pass in a string parameter, here is the code:

    Code (CSharp):
    1.  
    2.     public void SavePNG(string filename)
    3.     {
    4.         if (OutputTexture != null && _device != null)
    5.         {
    6.             Texture2D tex = new Texture2D(OutputTexture.width, OutputTexture.height, TextureFormat.ARGB32, false);
    7.             RenderTexture.active = (RenderTexture)OutputTexture;
    8.             tex.ReadPixels(new Rect(0, 0, tex.width, tex.height), 0, 0, false);
    9.             tex.Apply(false, false);
    10.            
    11.             byte[] pngBytes = tex.EncodeToPNG();
    12.             System.IO.File.WriteAllBytes(filename, pngBytes);
    13.            
    14.             RenderTexture.active = null;
    15.             Texture2D.Destroy(tex);
    16.             tex = null;
    17.         }
    18.     }
     
  48. edufurla

    edufurla

    Joined:
    Mar 7, 2014
    Posts:
    19
    Thank you very much, Andrew.
    This is exactly what I need.
    Works perfect.:)
    I am studding, but as I am not a programmer, is a sloooow learning curve to understand C#.
    Playmaker keeps the things much easier for me.
    Best regards.
     
  49. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Good luck Eduardo!
     
  50. wmaass88

    wmaass88

    Joined:
    Dec 23, 2012
    Posts:
    45
    Hello,

    I am using AVPRO Live Camera with a Blackmagic Design Intensity Pro card - works great I love it. The card has HDMI and Component input (via break out cable). I am able to capture using both inputs but only if I set the input in the Blackmagic Design Control Panel manually to HDMI or Component accordingly. Is there a way to pragmatically do this with AVPRO Live Camera via script? It would be great to be able to switch to HDMI or Component on the fly.

    Regards