Results 1 to 6 of 6

Thread: Manually configuring NDI source to connect to

  1. #1
    Registered User
    Join Date
    Sep 2018
    Location
    Tel Aviv
    Posts
    8

    Manually configuring NDI source to connect to

    Hello all,
    We're working on an app that utilizes a set of NDI cameras.
    We need the app to switch between cameras as the user in pressing the corresponding key, for example;
    I have 6 cameras key-mapped like this
    cam - |1| |2| |3| |4| |5| |6|
    ------------------------
    key - |1| |2| |3| |4| |5| |6|

    Each cam is a predefined source, so cam 1 will always be the same physical camera.


    Now out issue is we can't really understand how the "NDIlib_recv_connect()" function works.

    How can we do something like this:
    ndilib_recv_connet(receiver, 10.0.0.24:5599)

    Or how can we predefine a source so this will work:
    ndilib_recv_connet(receiver, predefinedsource1)


    Thanks in advance for any help!

  2. #2
    Registered User
    Join Date
    Oct 2017
    Location
    NY
    Posts
    27
    Hi.
    NDIlib_recv_create_v3_t -> source_to_connect_to -> p_ndi_name is "a UTF8 string that provides a user readable name for this source.
    his can be used for serialization, etc... and comprises the machine name and the source name on that machine. In the form MACHINE_NAME (NDI_SOURCE_NAME)"
    Each camera has own host name and you can connect to it by MACHINE_NAME (NDI_SOURCE_NAME). Also you can connect by IP but the problem is that port number is dynamic and you still have to find it by MACHINE_NAME (NDI_SOURCE_NAME) via finder API.

    Dmitry
    Last edited by ddv2005; 09-22-2018 at 06:44 PM.

  3. #3
    Registered User
    Join Date
    Sep 2018
    Location
    Tel Aviv
    Posts
    8
    Hi Dmitry,
    Thanks for your answer, but I already know the source is made of the name and address of the camera in a struct.
    problem is, when I try to define it manually like this:
    ndisource("cameraname", 123.1.2.3)
    connect(ndisource)
    it gives me an error


    how would i write this correctly:
    source1("cam1", 127.0.0.3)
    source2("cam2", 127.0.0.4)
    ..
    ..
    ..
    ..
    connect(source1)




    Thanks,
    Nimrod

  4. #4
    Registered User
    Join Date
    Oct 2017
    Location
    NY
    Posts
    27
    Hi Nimrod,

    If you want to known NDI name of your cameras then run "NDIAnalysis.exe /find" from latest SDK or NDIlib_Find example. It will show you list of all NDI sources in your network. Then use this name as p_ndi_name and p_url_address_ = NULL .

    P.S. NDI name can't be "cam1" because NDI name format is MACHINE_NAME (NDI_SOURCE_NAME)...for example "cam1 (INPUT1)"

  5. #5
    Registered User
    Join Date
    Sep 2018
    Location
    Tel Aviv
    Posts
    8
    Thanks for the suggestion Dmitry, though I get a different error now.

    This is my code:

    NDIlib_source_t* source1 = NULL;
    source1->p_ndi_name = "BIRDDOG-XXXXX (SDI)";
    source1->p_url_address = NULL;


    When I run the this VS highlights the ndi_name string and I get this runtime error :

    Exception thrown at 0x000000013F72148F in opencvtest.exe: 0xC0000005:
    Access violation writing location 0x0000000000000000.


    What is the issue now?
    Can this be acheived?

    Thanks again,
    Nimrod

  6. #6
    Registered User
    Join Date
    Sep 2018
    Location
    Tel Aviv
    Posts
    8
    Ok, Problem solved!

    This is my code now:

    NDIlib_source_t source1 = NULL;
    source1.p_ndi_name = "BIRDDOG-XXXXX (SDI)";
    source1.p_url_address = NULL;


    NDIlib_recv_instance_t pNDI_recv = NDIlib_recv_create_v3();
    if (!pNDI_recv) return 0;

    NDIlib_recv_connect(pNDI_recv, &source1);



    Thanks for the help Dmitry!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •