Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

videoDECKLINK plugin code outdated #240

Open
kubriel opened this issue Nov 5, 2019 · 11 comments

Comments

@kubriel
Copy link

@kubriel kubriel commented Nov 5, 2019

i tried to compile videoDECKLINK plugin with Blackmagic_DeckLink_SDK_11.3, but found some errors because of to API change i believe:

videoDECKLINK.cpp: In member function ‘virtual bool gem::plugins::videoDECKLINK::open(gem::Properties&)’:
videoDECKLINK.cpp:453:5: error: ‘IDeckLinkAttributes’ was not declared in this scope
     IDeckLinkAttributes*dlAttribs=0;
     ^~~~~~~~~~~~~~~~~~~
videoDECKLINK.cpp:453:5: note: suggested alternative: ‘BMDDeckLinkAttributeID’
     IDeckLinkAttributes*dlAttribs=0;
     ^~~~~~~~~~~~~~~~~~~
     BMDDeckLinkAttributeID
videoDECKLINK.cpp:453:25: error: ‘dlAttribs’ was not declared in this scope
     IDeckLinkAttributes*dlAttribs=0;
                         ^~~~~~~~~
videoDECKLINK.cpp:455:38: error: ‘IID_IDeckLinkAttributes’ was not declared in this scope
     if (S_OK == m_dl->QueryInterface(IID_IDeckLinkAttributes,
                                      ^~~~~~~~~~~~~~~~~~~~~~~
videoDECKLINK.cpp:455:38: note: suggested alternative: ‘BMDDeckLinkAttributeID’
     if (S_OK == m_dl->QueryInterface(IID_IDeckLinkAttributes,
                                      ^~~~~~~~~~~~~~~~~~~~~~~
                                      BMDDeckLinkAttributeID
videoDECKLINK.cpp:469:3: error: ‘BMDDisplayModeSupport’ was not declared in this scope
   BMDDisplayModeSupport displayModeSupported;
   ^~~~~~~~~~~~~~~~~~~~~
videoDECKLINK.cpp:469:3: note: suggested alternative: ‘bmdDisplayModeSupports3D’
   BMDDisplayModeSupport displayModeSupported;
   ^~~~~~~~~~~~~~~~~~~~~
   bmdDisplayModeSupports3D
videoDECKLINK.cpp:474:10: error: ‘displayModeSupported’ was not declared in this scope
         &displayModeSupported,
          ^~~~~~~~~~~~~~~~~~~~
videoDECKLINK.cpp:474:10: note: suggested alternative: ‘bmdDisplayModeSupports3D’
         &displayModeSupported,
          ^~~~~~~~~~~~~~~~~~~~
          bmdDisplayModeSupports3D
videoDECKLINK.cpp:478:7: error: ‘displayModeSupported’ was not declared in this scope
   if (displayModeSupported == bmdDisplayModeNotSupported) {
       ^~~~~~~~~~~~~~~~~~~~
videoDECKLINK.cpp:478:7: note: suggested alternative: ‘bmdDisplayModeSupports3D’
   if (displayModeSupported == bmdDisplayModeNotSupported) {
       ^~~~~~~~~~~~~~~~~~~~
       bmdDisplayModeSupports3D
videoDECKLINK.cpp:478:31: error: ‘bmdDisplayModeNotSupported’ was not declared in this scope
   if (displayModeSupported == bmdDisplayModeNotSupported) {
                               ^~~~~~~~~~~~~~~~~~~~~~~~~~
videoDECKLINK.cpp:478:31: note: suggested alternative: ‘bmdDisplayModeSupports3D’
   if (displayModeSupported == bmdDisplayModeNotSupported) {
                               ^~~~~~~~~~~~~~~~~~~~~~~~~~
                               bmdDisplayModeSupports3D
make[1]: *** [Makefile:572: gem_videoDECKLINK_la-videoDECKLINK.lo] Error 1
make[1]: Leaving directory '/home/kubriel/Downloads/Gem/plugins/videoDECKLINK'
make: *** [Makefile:444: all] Error 2

note that 11.4 SDK was already released,
and with 10.9.5 it builds fine, but i never got a reasonable picture out of it.

we still can use gstreamer to route stream from decklink to v4l2loopback and read it with [pix_video], but i believe with this plugin it should be lower latency.

@umlaeute

This comment has been minimized.

Copy link
Owner

@umlaeute umlaeute commented Nov 5, 2019

the joys of "professional" APIs :-(

@kubriel

This comment has been minimized.

Copy link
Author

@kubriel kubriel commented Nov 23, 2019

i sadly cannot get it work even with plugins/videoDECKLINK/SDK "imported DeckLink-SDK (10.8?) from gst-plugins-bad1.0"
this works gst-launch-1.0 decklinkvideosrc mode=16 connection=2 video-format=3 ! videoconvert ! xvimagesink

pd console prints:

GEM: video capture plugins: dc1394 decklink v4l v4l2
[pix_video]: backend #0='v4l2' : v4l2 analog
[pix_video]: backend #1='v4l' : v4l analog
[pix_video]: backend #2='dc1394' : dc1394 iidc
[pix_video]: backend #3='decklink' : decklink
videoctl: driver decklink
info: proplist numread 2
info: proplist read height float 64
info: proplist read width float 64
info: proplist numwrite 2
info: proplist write connection symbol auto
info: proplist write format symbol auto

videoctl: enumerate
info: devices 1
info: device DeckLink Mini Recorder 4K decklink

@umlaeute

This comment has been minimized.

Copy link
Owner

@umlaeute umlaeute commented Dec 4, 2019

the Pd-console printout doesn't look bad.
what does not work then?

@kubriel

This comment has been minimized.

Copy link
Author

@kubriel kubriel commented Dec 4, 2019

i had feeling that plugin reports dimensions of video as 64x64 beause of this:

info: proplist read height float 64
info: proplist read width float 64

also because i can see that picture is something like static black texture which can be 64x64 with some random colorful pixels, mostly on the borders. i can take screenshot of it if it can help. was trying to set properties with subpatch from pix_video-help.pd but no visible change happened.

@umlaeute

This comment has been minimized.

Copy link
Owner

@umlaeute umlaeute commented Dec 5, 2019

i downloaded the new DecklinkSDK, updated the firmware on my "Mini Recorder", connected my laptop to the HDMI-input and started Gem (as shipped with Debian).

The card was detected properly, but - as you say - the capturing was only random pixels at 64x64.

However, setting the connection-type manually from auto to HDMI ([set connection HDMI() fixed the problem, and i could capture the 2nd screen of my laptop onto my desktop.

(you might need to restart the capturing).

looking at the code, it seems that the default connection is hardcoded to SDI (rather than auto as the connection property suggests).
the width and height properties are initialized to default values, and will be updated once an image is captured.

@umlaeute

This comment has been minimized.

Copy link
Owner

@umlaeute umlaeute commented Dec 5, 2019

sidenote: when compiling yourself, just pass --with-DeckLink=local to configure to use some headers that are included with Gem ( rather than the ones from blackmagic, which broke compatibility...)

@kubriel

This comment has been minimized.

Copy link
Author

@kubriel kubriel commented Dec 6, 2019

now i was testing debian buster shipped gem, and i dont have similar results. i have also "Mini Recorder" here. first time i start rendering i see 64x64 random stuff. second time i start it i get a white picture. and [set connection HDMI( or [set format 16( sended to pix_video doesnt affect nothing i can see. what is version of desktopvideo you are using? or it is irelevant?

@umlaeute

This comment has been minimized.

Copy link
Owner

@umlaeute umlaeute commented Dec 6, 2019

the sdk version should be irrelevant. iirc, i'm using DeckLink-11.4.

you do have an HDMI-stream connected?
and i don't know what "format 16" would do, but here the default ("auto") always worked nicely so far.

you could also play with requesting and explicit device (eg [device 3( to select the correct stream).

when playing around i noticed that i would get an image with the second instance of [pix_video] running simultaneously (as i opened the help patch while having a [pix_video] open

@kubriel

This comment has been minimized.

Copy link
Author

@kubriel kubriel commented Dec 6, 2019

i meant dektopvideo package as it provides libDeckLinkAPI.so and kernel modules. so i upgraded 11.3 to 11.4 but without any visible change.
i allways check if hardware is working and im getting signal with

DISPLAY=:0 gst-launch-1.0 decklinkvideosrc mode=16 connection=2 video-format=3 ! videoconvert ! xvimagesink

and it is, as i can see my video.
in gst, with 'mode' i can set if stream is supposed to be 1080i50 or 1080p60 or whatever, which i misunderstood for [format $1(
and about "[device $1(" for the first started render, device 0 is colorful 64x64, all other are white. and after switching render off and on is device 0 also white. i think i tried maybe all combinations of messages without luck. i think im missing something what is obvious to you. very strange to me is that when send "[enumProps(, pd console allways prints "info: proplist write connection symbol auto". this seems to me that im not able to write properties.
edit:
yes, this seems to be my problem. im not able to write properties to decklink. i tested also v4l2 device where im able to write props. im still trying with fresh gem from git and also buster debian gem. maybe interesting fact can be that im using debian stable puredata 0.49.0

@umlaeute

This comment has been minimized.

Copy link
Owner

@umlaeute umlaeute commented Dec 6, 2019

@kubriel

This comment has been minimized.

Copy link
Author

@kubriel kubriel commented Dec 6, 2019

i understand. everything seems ok, no error reported, im just not getting picture. i tried two desktop computers with debian, different HDMI sources to decklink, fresh git gem, debian stable gem, combinations of messages, running it with sudo or altering /dev/blackmagic/io0 permissions. all i can get is having picture in gstreamer. lost all ideas.
either i get random dot 64x64 picture or white.

E1: i can say that gem is doing something with decklink device, as im not able to open stream with gstreamer while gem with pix_video is running.

E2: i even tried to change line 329 of videoDECKLINK.cpp to m_connectionType(bmdVideoConnectionHDMI)
without any visible change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.