Search Unity

[Released] AVPro DeckLink - Broadcast video input and output for Unity

Discussion in 'Assets and Asset Store' started by SunriseRH, Aug 5, 2016.

  1. AndrewRH

    AndrewRH

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

    AVPro DeckLink is only for BlackMagic DeckLink (and some Intensity) capture/playback hardware. This plugin doesn't support other webcam/capture hardware.

    For other webcams you could either use our Live Camera plugin, or just use the Unity WebCamTexture class.

    Thanks,
     
  2. AndrewRH

    AndrewRH

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

    Sorry for the late reply.
    AVPro DeckLink is only for BlackMagic DeckLink hardware. If you wan to use webcams as well, then you would either need to also use Unity's WebCamTexture class (not recommended), or use our AVPro Live Camera plugin.
    There are free trial versions of both of these plugins available to download from our website so you can test them for your use case.

    Thanks,
     
  3. AndrewRH

    AndrewRH

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

    AVPro DeckLink version 1.7.6 has just been released!

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

    Changes include:

    Features
    • Upgraded from DeckLink 11.1.0 to 11.4.0
    Fixes
    • Regression where a full duplex card would report not being full duplex, and so input and output couldn’t be done on the same card

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

    ** Please remember to download the latest version of BlackMagic's Desktop Video (11.4.0+) when upgrading to this new version.


    Thanks,
     
  4. max_coding13

    max_coding13

    Joined:
    Apr 24, 2016
    Posts:
    34
    Sorry guys, could you clarify - does this package not work AT ALL with HDRP (specifically in 2019.2), or is there only some features that don't work with it?
     
  5. max_coding13

    max_coding13

    Joined:
    Apr 24, 2016
    Posts:
    34
    pinging on this @AndrewRH . Could you please let me know what the current status of HDRP is. I'm not getting any output from Decklink in my HDRP scene. (also, my company has purchased the package - FYI)
     
  6. AndrewRH

    AndrewRH

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

    For best results it's good to post issue to our Github Issues page. We already have a posting about HDRP which you can see here:
    https://github.com/RenderHeads/UnityPlugin-AVProDeckLink/issues/4

    Perhaps you could post there with details of your setup and what you're trying to do.

    Thanks,
     
  7. narengenet

    narengenet

    Joined:
    May 27, 2017
    Posts:
    5
    I wonder if you tell me how I can output UI through Decklink Output?
    I've searched all scripts and internet and didn't find where you ignore UI layer from output.
     
  8. shotlink

    shotlink

    Joined:
    Jan 29, 2019
    Posts:
    1
    Hello
    Does anybody know if graphics on the Unity Canvas can be rendered to the AVPRO DECKLINK output? Thanks & Happy New Year in advance!
    -Johnny F.
    PGA TOUR
     
  9. NathanRH

    NathanRH

    Joined:
    Oct 24, 2012
    Posts:
    447
    Yes, UI can be output from the plugin.

    In some of our demos the UI we're using is built using IMGUI and because we're rendering the scene to a texture, the IMGUI UI doesn't get rendered. This is more as a debugging UI.

    If you use the normal Unity UI system (uGUI) then you can have UI rendered to the DeckLinkOutput component. You would just have to make sure that the camera you assign to the DeckLinkOutput component has the UI layer set in its Culling Mask field. If you have any problems just let us know or post to the GitHub Issues page.
     
  10. NathanRH

    NathanRH

    Joined:
    Oct 24, 2012
    Posts:
    447
    If you use the normal Unity UI system (uGUI) then you can have UI rendered to the DeckLinkOutput component. You would just have to make sure that the camera you assign to the DeckLinkOutput component has the UI layer set in its Culling Mask field. If you want to ONLY output UI, then you should assign a camera to the DeckLinkOutput component that is only set to render the UI layer in the Culling Mask.

    If you have any problems just let us know or post to the GitHub Issues page.
     
  11. Haru_Happy

    Haru_Happy

    Joined:
    Sep 4, 2015
    Posts:
    11
    hello i used free version 1.7.6 build on win10, i used output script , why gpu used is 90% ,but editor is 50?
    • Unity version: 2019.3.0f6

    • AVPro DeckLink version: 1.7.6

    • Operating system version: Windows10

    • Hardware model: DeckLink SDI 4K

    • Desktop Video version: 11.5

    • Video mode: 1080i 25p

    • Device Detail
      CPU Intel Core i7 8700
      RAM DDR4 16GB
      NIC 1G on Board
      GPU Nvidia Geforce 2070
     
  12. NathanRH

    NathanRH

    Joined:
    Oct 24, 2012
    Posts:
    447
    Good question. I believe when running with the DeckLinkOutput component, we disable vsync so that we can get the desired frame rate as accurately as possible. This means the GPU will render many frames that aren't displayed. This is something we want to improve in the future, as it can be very wasteful.

    I have created an issue on GitHub to track this issue here:
    https://github.com/RenderHeads/UnityPlugin-AVProDeckLink/issues/17

    Thanks,
     
  13. Haru_Happy

    Haru_Happy

    Joined:
    Sep 4, 2015
    Posts:
    11
    got it
    thanks
     
  14. Haru_Happy

    Haru_Happy

    Joined:
    Sep 4, 2015
    Posts:
    11
    and why i choose outputdevice on this one upload_2020-2-26_18-37-20.png
    Decklink SDI 4K Audio

    the output voice is noise in output demo scene?
     
  15. NathanRH

    NathanRH

    Joined:
    Oct 24, 2012
    Posts:
    447
    umm..i'm not sure... what do you mean by "noise"? like white noise?
     
  16. Haru_Happy

    Haru_Happy

    Joined:
    Sep 4, 2015
    Posts:
    11
    sorry,i fixed this

    and how to controll sdi output volume when use audiolistener?
     
  17. NathanRH

    NathanRH

    Joined:
    Oct 24, 2012
    Posts:
    447
    Hmm i'm not quite sure what you mean?
     
  18. Haru_Happy

    Haru_Happy

    Joined:
    Sep 4, 2015
    Posts:
    11
    1.The DeckLinkOutput component not set OutputAudioSource,then it will use AudioListener,How to change Output Audio volume ?
    2.Is there a way use multi camera on output component?
     
  19. UDN_31531f55-d82f-47e5-aeb6-20f4aaa3f82b

    UDN_31531f55-d82f-47e5-aeb6-20f4aaa3f82b

    Joined:
    Aug 5, 2016
    Posts:
    11
    Hi , would like to check out the genlock and timecode function of avpro decklink ... will it sync the frame update with the actual camera?
     
  20. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    If your camera has support to output a genlock signal, or you have a common genlock signal source that is connected to both the decklink card and the camera, then they will be in sync. You can test it out for yourself using the free trial version of the plugin.
    Thanks,
     
    Last edited: Apr 16, 2020
  21. AndrewRH

    AndrewRH

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

    AVPro DeckLink version 1.7.8 has just been released!

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

    Changes include:

    Features
    • Added ability for DeckLinkOutput component to specify a Texture as the source instead of a Camera
    • Refactored DeckLinkOutput class
    • Improved compatibility with Unity 2019 and 2020
    • Upgraded from DeckLink SDK 11.4.0 to 11.5.0

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

    ** Please remember to download the latest version of BlackMagic's Desktop Video (11.5.0+) when upgrading to this new version.


    Thanks,
     
  22. wechat_os_Qy02DpBu6_xkPmMhMbMmIjBdI

    wechat_os_Qy02DpBu6_xkPmMhMbMmIjBdI

    Joined:
    Mar 26, 2020
    Posts:
    1
    I just bought this plugin today(1.7.8).Error of output demo, LeftEye is empty.How can I solve this problem
     
  23. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Yes sorry about this, we're releasing a new version today that fixes this regression.

    Thanks,
     
  24. AndrewRH

    AndrewRH

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

    AVPro DeckLink version 1.7.9 has just been released!

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

    Changes include:

    Fixes
    • Fixed script regression from 1.7.8 that caused errors with DeckLinkOutput component

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

    ** Please remember to download the latest version of BlackMagic's Desktop Video (11.5.0+) when upgrading to this new version.


    Thanks,
     
  25. H4ppyTurtle

    H4ppyTurtle

    Joined:
    Aug 20, 2019
    Posts:
    18
    Hello! Your plugin is doing great work at our university's TV studio.
    I have two questions for you:

    I want to do CPU processing on the captured frame from the DeckLink card before rendering. So I have to transfer the frame from a RenderTexture/Material to a Unity Texture2D with ReadPixels() and then do some processing. The Gfx.ReadbackImage takes some time for this and I get occasional spikes in the profiler. I looked into your plugin code and saw some hints, that you might be getting a Texture2D from the capture card first? Can I somehow grab this texture before it gets loaded to the GPU?

    And for the second question, I just wanted to know if you have some general performance tips. We have a quite heavy HDRP scene, that runs in the Editor with ~60fps. But the SDI output with the AVPro DeckLink Plugin only manages to output ~25fps. Do you have some general performance tips or known bottlenecks that might cause this difference?
     
  26. NathanRH

    NathanRH

    Joined:
    Oct 24, 2012
    Posts:
    447
    Hi,

    Doing CPU processing can be very slow because the GPU will have to stall the rendering pipeline if you want to grab the texture immediately from GPU memory into CPU memory. This is a very expensive opertion. This is why https://docs.unity3d.com/ScriptReference/Rendering.AsyncGPUReadback.html was created - however it is a scheduled event, so it will add latency to your video feed.
    If possible I would recommend trying to find a way to do any modification of the texture on the GPU. Uploading to the GPU happens inside out DLL plugin, so currently there is no way to get hold of it before then. The frame is also usually in an intermediate format like YUV422, so it's not ideal to use even if you could get hold of the memory.

    The DeckLinkOutput component uses a Camera that you specify for it's rendering. This could mean that the scene is rendered twice if you are usual an additional camera just for the DeckLinkOutput. One possible way around this would be to only use a single camera and then to blit the Camera.targetTexture to the screen after it has rendered. In the future we hope to add more options to avoid this need for a second camera.

    I hope this helps to answer some of your questions. If you have any issues/questions please post to our GitHub so that our support team can reply:
    https://github.com/RenderHeads/UnityPlugin-AVProDeckLink/issues

    Thanks,
     
    H4ppyTurtle likes this.
  27. PANcoltd

    PANcoltd

    Joined:
    Feb 6, 2019
    Posts:
    1
    Hello,

    I am using your asset with DeckLink Quad HDMI recorder which has 4 HDMI input.
    The DeckLinkInput's preview is showing a correct image that is fed to ApplyToMaterial.
    And the ApplyToMaterial also seems to succeed to pass the image to the Material.
    When I attached the material to primitives, it shows the image from decklink capture board.
    But when I try to use the texture inside the material, It only shows Default texture, even it is showing the correct image on the primitive.
    I left the Texture Name blank, so it will be stored in mainTexture, right?




    I read the document and found some of the options of ApplyToMaterial are not described yet.
    *Eye*,
    *Right Texture Name*
    Should I do something with these options?

    View attachment 683547

    Any suggestions to be much appreciated.
    Thanks in Advance.
     
  28. H4ppyTurtle

    H4ppyTurtle

    Joined:
    Aug 20, 2019
    Posts:
    18
    Thank you for your answer. The AsyncGPUReadback helped a lot. I think the delay will be ok.

    Blitting of the final texture is a good suggestion. I couldn't get that to work with HDRP though. I tried to Blit to the screen backbuffer, but the camera texture was only copied to the scene view. For better scene control we need to run in the editor.
     
  29. NathanRH

    NathanRH

    Joined:
    Oct 24, 2012
    Posts:
    447
    Yeah there are some subtleties regarding blitting to the backbuffer. The Unity script reference docs on Blit discuss most of those. It should be possible to blit to the backbuffer with some work. I'm not sure if HDRP has any extra quirks in this regard (it certainly has a few).

    Thanks,
     
  30. NathanRH

    NathanRH

    Joined:
    Oct 24, 2012
    Posts:
    447
    You should be able to get the texture that's applied to the material. Perhaps you just need to adjust your script ordering because initially the DeckLink texture won't be applied to the material - it could take a few frames until it is applied.

    Alternatively you can just grab the texture directly from the DeckLinkInput component via the OutputTexture property.

    I hope that helps.
     
  31. NathanRH

    NathanRH

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

    AVPro DeckLink version 1.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
    • Audio input and output has better support for arbitrary number of channels (up to 64)
    • Audio input and output performance and latency optimisations
    • Added Audio Mixer component for controlling levels of multiple audio channels
    • Refactored FrameConverter class
    Changes
    • Plugin now requires Unity 5.6 as a minimum
    Fixes
    • Fixed genlock pixel offset not being set correctly
    • Fixed issue where switching from an 8-bit to a 10-bit mode would just show a blank screen
    • Fixed support for 10-bit 720p, 2K, 4K DCI modes where they wouldn’t be displayed correctly
    • Fixed IL2CPP support (by correct bool return size)

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

    ** Please remember to download the latest version of BlackMagic's Desktop Video (11.5.0+) when upgrading to this new version.


    Thanks,
     
  32. NathanRH

    NathanRH

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

    AVPro DeckLink version 1.8.4 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 capturing RGB-10 bit
    • Added support for auto-detection of input video bit depth
    Changes
    • Upgraded from DeckLink SDK 11.5.0 to 11.6.0
    Fixes
    • Fixed issue where images were vertically flipped
    • Fixed issue where interlaced frames wouldn’t display
    • Fixed stereo issue where right eye would render from left eye

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

    ** Requires the latest BlackMagic's Desktop Video (version 11.6.0 or newer)


    Thanks,
     
  33. shu-ko

    shu-ko

    Joined:
    Sep 2, 2020
    Posts:
    2
    Hello,

    Thanks for your great product!

    I tried the following setting using AVPro Decklink and Decklink 8K Pro.
    It works well on Unity scene editor, but it does not work (crash) on an exe file generated by Unity.
    I attach the error log files (converting file extension .log to .txt for uploading purpose).

    Input Source: 8K 60p YUV 4:2:2 10bit
    OS: Windows 10 Pro
    Unity Version: Unity 2020.1.3
    Desktop Video Version: 11.6

    I look forward to your response.
     

    Attached Files:

  34. shu-ko

    shu-ko

    Joined:
    Sep 2, 2020
    Posts:
    2
    HI,

    I resolved this problem.
    I applied wrong build setting.
    I changed build architecture x86 to x86_64, then it works well on the exe file.

    Thank you so much!
     
    NathanRH likes this.
  35. NathanRH

    NathanRH

    Joined:
    Oct 24, 2012
    Posts:
    447
    Thanks for reporting this issue - we will take a look to work out why it's crashing in 32-bit build.
     
  36. NathanRH

    NathanRH

    Joined:
    Oct 24, 2012
    Posts:
    447
    I think we have fixed the issue where 32-bit builds can produce an error. We will include this fix in the next release of the plugin.

    Thanks,
     
  37. NathanRH

    NathanRH

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

    AVPro DeckLink version 1.8.5 has just been released!

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

    Changes include:

    Fixes
    • Fixed crash in 32-bit builds with IL2CPP due to C++ calling convention mismatches

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

    ** Requires the latest Blackmagic's Desktop Video (version 11.6.0 or newer)


    Thanks,
     
  38. NathanRH

    NathanRH

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

    AVPro DeckLink version 1.8.6 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 10-bit RGB option as a forcible input mode
    Fixes
    • Fixed issue where field mode would be returned incorrectly causing deinterlacer to run when it shouldn’t, which resulted in reduced quality
    • Fixed 8-bit ARGB shader applying gamma transform to wrong channel
    • Fixed Save PNG option to resolve to sRGB first
    • Fixed HDR option not being applied to automatic mode detection
    • Fixed explorer demo so that visual zoom of preview now works

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

    ** Requires the latest Blackmagic's Desktop Video (version 11.6.0 or newer)


    Thanks,
     
  39. KazamaKazuki

    KazamaKazuki

    Joined:
    Dec 14, 2020
    Posts:
    1
    When uGUIDisplay Compornent is used, the channel specified in Device Index is not automatically displayed.
     
  40. seabits

    seabits

    Joined:
    Dec 3, 2019
    Posts:
    199
    Hi @KazamaKazuki

    Not sure what you mean by this, could you please provide some more information?

    Thanks.
     
  41. AndrewRH

    AndrewRH

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

    AVPro DeckLink version 1.9.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 adjusting Unity frame-rate based on output health status, and added proactive rather than reactive late/dropped frame correction resulting in more robust frame drop prevention
    • Added support to DeckLinkOutput to generate timecode output, and if synced to input stream it will pass that timecode through
    • Automated multi-output support
    • Performance improvement by removing lock (within lock) from frame expected display time tracking
    • Split frame reading and writing from GPU and placed writing on DeckLink consumer thread via custom render context for more optimal throughput
    • Added better detection of already in-use devices
    • Added new UI element to show output buffer health
    Changes
    • Updated DeckLink SDK to 12.0
    • Internal rendering system heavily refactored
    • Removed multi-output frame blending
    • Removed multiple initialisation calls at startup
    Fixes
    • Fixed startup bug with first frame not being output
    • Fixed bug with DeckLink output frame completed callback being out of expected order
    • Fixed bug in device selection by index script

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

    ** Requires the latest Blackmagic's Desktop Video (version 12.0.0 or newer)


    Thanks,
     
  42. highlyinteractive

    highlyinteractive

    Joined:
    Sep 6, 2012
    Posts:
    116
    How does this plugin work with framelock/genlock?

    If I have a sync signal going into my DeckLink, will both the input and output be synced to it? Will it pass that through to the graphics card as well, or would I need extra hardware, like a quadro sync card for example?

    Or does the plugin not support it at all?

    Thanks for any help or recommendations you can give
     
  43. seabits

    seabits

    Joined:
    Dec 3, 2019
    Posts:
    199
    This might be a question for Blackmagic - but as far as we know if you have a genlock signal coming in it will output that as well. You would need extra hardware like a quadro, not just the graphics card.
     
  44. highlyinteractive

    highlyinteractive

    Joined:
    Sep 6, 2012
    Posts:
    116
    Thanks. So based on your answer, it sounds like you don't specifically do anything with genlock when writing to the SDI output?

    This is from your input/output demo with a sync generator plugged into the card:


    It doesn't seem to be picking up any kind of genlock here.

    Any more information you can give me about how you're handling this would be really helpful, thanks
     
  45. seabits

    seabits

    Joined:
    Dec 3, 2019
    Posts:
    199
    Right, sure, sorry, misunderstood your question slightly.

    Please see these images here. Currently in the DeckLink plugin we only have support for genlock detection and offset, for internal keying. We have however started work on genlock support for external/no keying, but it's still underway. Please see this issue on our Github page. You're welcome to follow it to hear of any updates.

    Does that make sense?
     
  46. highlyinteractive

    highlyinteractive

    Joined:
    Sep 6, 2012
    Posts:
    116
    That does make sense - thanks!

    I'm holding out for DirectX 12 support as well, so probably won't be able to use DeckLink this time around, but hopefully I'll get a chance one day :)
     
  47. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    We're working on DirectX 12 support :)

    Thanks,
     
  48. AndrewRH

    AndrewRH

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

    AVPro DeckLink version 1.9.1 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 colour space and HDR metadata on output (rec 709, 2020 and 2100 - HLG)
    Changes
    • Updated to compile against DeckLink 12.2 SDK
    Fixes
    • Fixed issue with input/outputs failing to start on full duplex devices
    • Fixed a warning if trying to reattach an eye input texture to a camera target texture
    • Fixed Windows 7 support (compatibility issue with D3D11.1)

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

    ** Requires the latest Blackmagic's Desktop Video (version 12.2.0 or newer)


    Thanks,
     
  49. Kaimen001

    Kaimen001

    Joined:
    Aug 25, 2014
    Posts:
    14
    Hi, the plugin works great but I have a problem with the audio. I have a DeckLink Quad HDMI Recorder. I am capturing video and audio over HDMI. I have verified that the audio and video are synchronized but after capturing it with DeckLinkInput the audio comes out with a considerable delay. How can I solve that?
    Thank you.
     
  50. seabits

    seabits

    Joined:
    Dec 3, 2019
    Posts:
    199
    How big is the delay? Could you please create an issue on our Github with all relevant details requested in the template.

    Thanks!