Coder Social home page Coder Social logo

ndi-python's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ndi-python's Issues

Installation for Python 3.11?

Hi,
I encountered an issue while installing this package on Arch Linux with Python 3.11.3. The installation fails with the following output:

$ pip3 install ndi-python
Defaulting to user installation because normal site-packages is not writeable
Collecting ndi-python
  Using cached ndi-python-5.1.1.1.tar.gz (16 kB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: numpy in /usr/lib/python3.11/site-packages (from ndi-python) (1.24.3)
Building wheels for collected packages: ndi-python
  Building wheel for ndi-python (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [36 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-cpython-311
      creating build/lib.linux-x86_64-cpython-311/NDIlib
      copying NDIlib/__init__.py -> build/lib.linux-x86_64-cpython-311/NDIlib
      running build_ext
      cmake .. -DCMAKE_INSTALL_PREFIX=/tmp/pip-install-pqore8mz/ndi-python_d1f9a3e91bdf4ed18a7998572c4cb231/build/install
      -- The C compiler identification is GNU 13.1.1
      -- The CXX compiler identification is GNU 13.1.1
      -- Detecting C compiler ABI info
      -- Detecting C compiler ABI info - done
      -- Check for working C compiler: /usr/bin/cc - skipped
      -- Detecting C compile features
      -- Detecting C compile features - done
      -- Detecting CXX compiler ABI info
      -- Detecting CXX compiler ABI info - done
      -- Check for working CXX compiler: /usr/bin/c++ - skipped
      -- Detecting CXX compile features
      -- Detecting CXX compile features - done
      CMake Error at CMakeLists.txt:10 (add_subdirectory):
        add_subdirectory given source "lib/pybind11" which is not an existing
        directory.
      
      
      CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
        Could NOT find NDI (missing: NDI_DIR FALSE)
      Call Stack (most recent call first):
        /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
        cmake/Modules/FindNDI.cmake:45 (find_package_handle_standard_args)
        CMakeLists.txt:12 (find_package)
      
      
      -- Configuring incomplete, errors occurred!
      error: command '/usr/bin/cmake' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for ndi-python
  Running setup.py clean for ndi-python
Failed to build ndi-python
ERROR: Could not build wheels for ndi-python, which is required to install pyproject.toml-based projects

Support the NDI|HX (h264) driver on Linux

Got the wrapper compiled (NDIlib.cpython-38-x86_64-linux-gnu.so), and examples running, with no errors after installing the NDI SDK on Ubuntu 20.04.

However, using the recv.py example I am having trouble receiving a video stream from a device broadcasting on our wifi network and I suspect the video format used is the cause. The example just shows a window with a looping video of a countdown.
EDIT: I must have goofed up the initial linking of the installed NDI SDK. Re-installed and now recv.py receives and shows the stream nicely.

My question still stands though:
Are there plans to support the NDI|HX linux driver? It doesn't seem to be supported in the current wrapper.
The driver can be downloaded from this site and the NDI SDK should pick it up from what the docs tell me.

NDI Routing uses 127.0.0.1 for routing source URL

Running on MacOS, ndi-python version 5.1.1.5 installed through pip/brew
pip install ndi-python
Requirement already satisfied: ndi-python in /opt/homebrew/lib/python3.10/site-packages (5.1.1.5)

I'm trying to implement an NDI router following the example in examples/router.py

I thought I had it set up correctly, and NDI players can see it, but they do not properly switch to the routed source.
I modified examples/find.py to print out the URL associated with the NDI source and discovered that it was being mapped to localhost (127.0.0.1)
e.g.:
dans-macbook:example dan$ python find.py
Network sources (12 found).
..
3. DANS-MACBOOK.BXB (HDMI1)
127.0.0.1:5961
4. DANS-MACBOOK.BXB (HDMI2)
127.0.0.1:5962
5. DANS-MACBOOK.BXB (HDMI3)
127.0.0.1:5963
6. DANS-MACBOOK.BXB (HDMI4)
127.0.0.1:5964
7. DANS-MACBOOK.BXB (HDMI5)
127.0.0.1:5965
...

I do not find anything in the NDI SDK to specify the local address which should be used (am I missing something?).
Is this a problem with ndi-python, or is it a bug in the Mac version of the SDK?

Process closes without reason using CV2

Hi, I'm trying to use NDI to process some image from another software with CV2, so, at the moment, I just trasformed the received fram in numpy array and display it.
After a few seconds I get this message: Process finished with exit code -1073741819 (0xC0000005).
I'm using Python 3.9.18 on Windows 10 in a I7 7th generation

This is the code:

import sys
import numpy as np
import NDIlib as ndi
import cv2

def main():

if not ndi.initialize():
    return 0

ndi_find = ndi.find_create_v2()

if ndi_find is None:
    return 0

sources = []
while not len(sources) > 1:
    print('Looking for sources ...')
    ndi.find_wait_for_sources(ndi_find, 1000)
    sources = ndi.find_get_current_sources(ndi_find)

for i, s in enumerate(sources):
    print('%s. %s' % (i + 1, s.ndi_name))

ndi_recv_create = ndi.RecvCreateV3()
ndi_recv_create.color_format = ndi.RECV_COLOR_FORMAT_BGRX_BGRA

ndi_recv = ndi.recv_create_v3(ndi_recv_create)

if ndi_recv is None:
    return 0

ndi.recv_connect(ndi_recv, sources[1])

ndi.find_destroy(ndi_find)

while True:
    t, v, a, _ = ndi.recv_capture_v2(ndi_recv, 5000)

    if t == ndi.FRAME_TYPE_NONE:
        print('No data received.')
        continue

    if t == ndi.FRAME_TYPE_VIDEO:

        print('Video data received (%dx%d).' % (v.xres, v.yres))
        ndi.recv_free_video_v2(ndi_recv, v)
        image = np.copy(v.data)
        cv2.imshow('NDI', image)
        continue

    if t == ndi.FRAME_TYPE_AUDIO:
        print('Audio data received (%d samples).' % a.no_samples)
        ndi.recv_free_audio_v2(ndi_recv, a)
        continue

ndi.recv_destroy(ndi_recv)

ndi.destroy()

return 0

if name == "main":
sys.exit(main())

thread in python

Hello, i want recv two single together in python.How can i do?

NDI routing: can't set name

Hi, for some reason I can't set the ndi_name property for the NDIlib.RoutingCreate object.

Example:

if not ndi.initialize():
   return 0

route_settings = ndi.RoutingCreate()
route_settings.ndi_name = "test"

Result:

route_settings.ndi_name
>>> '`;\x12\x1d'

I'm using the develop branch code with NDI SDK 4. Any ideas on how to fix this?

install error on windows 11 64

Hi
I tried to install on windows, but term return a wheels building error.
I have all requirements installed (python, ndi sdk), but when I type "pip install ndi-python" in powershell or cmd, with or without admin rights, I always get an error message :

Collecting ndi-python
  Using cached ndi-python-5.1.1.1.tar.gz (16 kB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: numpy in c:\python311\lib\site-packages (from ndi-python) (1.24.2)
Building wheels for collected packages: ndi-python
  Building wheel for ndi-python (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [35 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-cpython-311
      creating build\lib.win-amd64-cpython-311\NDIlib
      copying NDIlib\__init__.py -> build\lib.win-amd64-cpython-311\NDIlib
      running build_ext
      cmake .. -DCMAKE_INSTALL_PREFIX=C:\Users\Graux\AppData\Local\Temp\pip-install-h2kvsnzw\ndi-python_6ea5817216b84309b2c9fd1f986e82d6\build\install
      -- Building for: Visual Studio 16 2019
      -- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.22621.
      -- The C compiler identification is MSVC 19.29.30143.0
      -- The CXX compiler identification is MSVC 19.29.30143.0
      -- Detecting C compiler ABI info
      -- Detecting C compiler ABI info - done
      -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped
      -- Detecting C compile features
      -- Detecting C compile features - done
      -- Detecting CXX compiler ABI info
      -- Detecting CXX compiler ABI info - done
      -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped
      -- Detecting CXX compile features
      -- Detecting CXX compile features - done
      CMake Error at CMakeLists.txt:10 (add_subdirectory):
        add_subdirectory given source "lib/pybind11" which is not an existing
        directory.


      -- Found NDI: C:/Program Files/NDI/NDI 5 SDK
      CMake Error at CMakeLists.txt:19 (pybind11_add_module):
        Unknown CMake command "pybind11_add_module".


      -- Configuring incomplete, errors occurred!
      error: command 'C:\\Python311\\Scripts\\cmake.exe' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for ndi-python
  Running setup.py clean for ndi-python
Failed to build ndi-python
ERROR: Could not build wheels for ndi-python, which is required to install pyproject.toml-based projects

Have you got an idea of what I should do to solve this ?
Thanks

Compiled and imported library but can't run functions

Hello. Thanks for this library.

I'm running it on my Windows 10 using an RTX3070 but after the cmake and the build configuration for my OS I'm not really able to call the functions of the library. I can import it using the build files but when I run (e.g.) ndi_send = ndi.send_create() I get this error:

Traceback (most recent call last):
  File "ok.py", line 19, in <module>
    ndi_send = ndi.send_create()
AttributeError: module 'NDIlib' has no attribute 'send_create'

I'm importing through import NDIlib as ndi with a local folder


<pyfile>
<NDIlib>
    <NDIlib.cp35-win_amd64.pyd>
    <NDIlib.exp>
    <NDIlib.lib>
    <Processing.NDI.Lib.x64.lib>

Any idea what is this?
Thanks

Typo in main.cpp

Spurious '(' in m.def:

m.def(
"routing_get_source_name(", <<<<<*** should be "routing_get_source_name"
[](py::capsule instance) {
auto p_instance =
static_cast<NDIlib_routing_instance_type *>(instance.get_pointer());

Cant read ndi audio object data

Hi There,

I can receive an audio object;

while True:
# type, video, audio, metadata
t,v,a,m = ndi.recv_capture_v2(ndi_recv, 5000)

if t == ndi.FRAME_TYPE_AUDIO:
print("Audio data received (%d channels %d sample rate)." % (a.no_channels, a.sample_rate))

But i cant seem to do anything with it;

print(a.data)

results in;

AttributeError: unreadable attribute

Is this by design/has it not been implemented?

(BTW thanks very much, im loving this project!)

Issues on Ubuntu

I'm having trouble finding the sources using the example code.

The environment is Ubuntu 20.04 and latest ndi-python.

I can find the ndi source with obs studio and also the avahi in the terminal:
❯ avahi-browse -a

  • wlp0s20f3 IPv6 mevo-24V3K _ls-cameraman._tcp local
  • wlp0s20f3 IPv6 mevo-24V3K _mevo-studio._tcp local
  • wlp0s20f3 IPv4 mevo-24V3K _ls-cameraman._tcp local
  • wlp0s20f3 IPv4 mevo-24V3K _mevo-studio._tcp local
  • wlp0s20f3 IPv4 MEVO-24V3K (Mevo-24V3K) _ndi._tcp local

the ndi.find_get_current_sources(ndi_find) will always return empty list and i'm not sure where to start debugging.

Thanks in advance for any suggestions.

Can't receive frames being sent

Hi! I'm sending video frames using send_video.py and trying to receive them using either recv.py or recv_cv.py. On the sending side, it is printed that frames are being sent like this:

image

But on the receiving side, it is only showing 'Looking for sources' when running both files like this:
image

What should I do?

Pip install failing on Raspberry Pi

Pi version: Model 4 B
Mmake version: 3.18.4

pi@raspberrypi:~ $ pip install ndi-python
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting ndi-python
  Using cached ndi-python-5.1.1.1.tar.gz (16 kB)
Requirement already satisfied: numpy in ./.local/lib/python3.9/site-packages (from ndi-python) (1.23.1)
Building wheels for collected packages: ndi-python
  Building wheel for ndi-python (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-vc5djfcr/ndi-python_2ebd18bddf8c4ff3998aee43ddf2563c/setup.py'"'"'; __file__='"'"'/tmp/pip-install-vc5djfcr/ndi-python_2ebd18bddf8c4ff3998aee43ddf2563c/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-kj3ci06v
       cwd: /tmp/pip-install-vc5djfcr/ndi-python_2ebd18bddf8c4ff3998aee43ddf2563c/
  Complete output (34 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-armv7l-3.9
  creating build/lib.linux-armv7l-3.9/NDIlib
  copying NDIlib/__init__.py -> build/lib.linux-armv7l-3.9/NDIlib
  running build_ext
  cmake .. -DCMAKE_INSTALL_PREFIX=/tmp/pip-install-vc5djfcr/ndi-python_2ebd18bddf8c4ff3998aee43ddf2563c/build/install
  -- The C compiler identification is GNU 10.2.1
  -- The CXX compiler identification is GNU 10.2.1
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - done
  -- Check for working C compiler: /usr/bin/cc - skipped
  -- Detecting C compile features
  -- Detecting C compile features - done
  -- Detecting CXX compiler ABI info
  -- Detecting CXX compiler ABI info - done
  -- Check for working CXX compiler: /usr/bin/c++ - skipped
  -- Detecting CXX compile features
  -- Detecting CXX compile features - done
  CMake Error at CMakeLists.txt:10 (add_subdirectory):
    add_subdirectory given source "lib/pybind11" which is not an existing
    directory.
  
  
  -- Found NDI: /usr
  CMake Error at CMakeLists.txt:19 (pybind11_add_module):
    Unknown CMake command "pybind11_add_module".
  
  
  -- Configuring incomplete, errors occurred!
  See also "/tmp/pip-install-vc5djfcr/ndi-python_2ebd18bddf8c4ff3998aee43ddf2563c/build/CMakeFiles/CMakeOutput.log".
  error: command '/usr/bin/cmake' failed with exit code 1
  ----------------------------------------
  ERROR: Failed building wheel for ndi-python
  Running setup.py clean for ndi-python
Failed to build ndi-python
Installing collected packages: ndi-python
    Running setup.py install for ndi-python ... error
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-vc5djfcr/ndi-python_2ebd18bddf8c4ff3998aee43ddf2563c/setup.py'"'"'; __file__='"'"'/tmp/pip-install-vc5djfcr/ndi-python_2ebd18bddf8c4ff3998aee43ddf2563c/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-il66tt0h/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/pi/.local/include/python3.9/ndi-python
         cwd: /tmp/pip-install-vc5djfcr/ndi-python_2ebd18bddf8c4ff3998aee43ddf2563c/
    Complete output (20 lines):
    running install
    running build
    running build_py
    creating build/lib.linux-armv7l-3.9
    creating build/lib.linux-armv7l-3.9/NDIlib
    copying NDIlib/__init__.py -> build/lib.linux-armv7l-3.9/NDIlib
    running build_ext
    cmake .. -DCMAKE_INSTALL_PREFIX=/tmp/pip-install-vc5djfcr/ndi-python_2ebd18bddf8c4ff3998aee43ddf2563c/build/install
    CMake Error at CMakeLists.txt:10 (add_subdirectory):
      add_subdirectory given source "lib/pybind11" which is not an existing
      directory.
    
    
    CMake Error at CMakeLists.txt:19 (pybind11_add_module):
      Unknown CMake command "pybind11_add_module".
    
    
    -- Configuring incomplete, errors occurred!
    See also "/tmp/pip-install-vc5djfcr/ndi-python_2ebd18bddf8c4ff3998aee43ddf2563c/build/CMakeFiles/CMakeOutput.log".
    error: command '/usr/bin/cmake' failed with exit code 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-vc5djfcr/ndi-python_2ebd18bddf8c4ff3998aee43ddf2563c/setup.py'"'"'; __file__='"'"'/tmp/pip-install-vc5djfcr/ndi-python_2ebd18bddf8c4ff3998aee43ddf2563c/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-il66tt0h/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/pi/.local/include/python3.9/ndi-python Check the logs for full command output.

send audio 16bpp example

Hello,
I am noticing something not quite right with the send_audio_16bpp.py example. I have installed on both Windows and Raspberry Pi, and testing with NDI Monitor on Windows.

The audio is not silent, but instead sounds like a taser. Same behavior coming from both Windows and Raspberry Pi. If I run the C++ NDIlib_Send_Audio_16bpp example, I get a source of silent audio.

Anybody else experience this?

import NDIlib as ndi errror

Screenshot 2020-09-23 143844

Hi I ran both cmake commands and attached 2 files that it generated to the "example" folder but still getting this error. Any idea? See screenshots of my folder structure below

Screenshot 2020-09-23 143420

Screenshot 2020-09-23 143324

Screenshot 2020-09-23 143844

Inspecting some NDI instance variables makes program close

I've come across this problem several times while developing an application but i've always just let it pass since it's a debug problem. I'll open this issue since its becoming more prevalent:

Example:
source_object = ndi.Source() source_object.ndi_name = ndi_name print(source_object.url_address)

Expected Behavior:
print(source_object.url_address) should print None or output an error

Actual Behavior:
Exits the application immediately
When debugging using VS Code and PTVSD, Server[1] closes unexpectedly

Unable to import loaded module.

I compiled the module successfuly but attempting to load it while in the same directory as the so fields yields the below error.

Traceback (most recent call last):
  File "input.py", line 3, in <module>
    import NDIlib as ndi
ModuleNotFoundError: No module named 'NDIlib'

Potential for memory leak if using the examples with this implementation.

TLDR: The example code is incorrect for the current implementation and does not align with the original NDI spec. This means it is easy to create a memory leak if you're using the example code.

In the NDI SDK documentation, they specifically call NDIlib_recv_capture_v3 (or NDIlib_recv_capture_v2) with a receiver and then the pointers for each frame. You can also supply NULL if you don't want a frame.

However in the code base for ndi-python we specify ALL 3 pointers, which means we need to free all 3 of these pointers.

ndi-python/src/main.cpp

Lines 456 to 488 in 8aad19d

m.def(
"recv_capture_v2",
[](py::capsule instance, uint32_t timeout_in_ms) {
auto p_instance =
static_cast<NDIlib_recv_instance_type *>(instance.get_pointer());
NDIlib_video_frame_v2_t video_frame;
NDIlib_audio_frame_v2_t audio_frame;
NDIlib_metadata_frame_t metadata_frame;
auto type =
NDIlib_recv_capture_v2(p_instance, &video_frame, &audio_frame,
&metadata_frame, timeout_in_ms);
return std::tuple<NDIlib_frame_type_e, NDIlib_video_frame_v2_t,
NDIlib_audio_frame_v2_t, NDIlib_metadata_frame_t>(
type, video_frame, audio_frame, metadata_frame);
},
py::arg("instance"), py::arg("timeout_in_ms"));
m.def(
"recv_capture_v3",
[](py::capsule instance, uint32_t timeout_in_ms) {
auto p_instance =
static_cast<NDIlib_recv_instance_type *>(instance.get_pointer());
NDIlib_video_frame_v2_t video_frame;
NDIlib_audio_frame_v3_t audio_frame;
NDIlib_metadata_frame_t metadata_frame;
auto type =
NDIlib_recv_capture_v3(p_instance, &video_frame, &audio_frame,
&metadata_frame, timeout_in_ms);
return std::tuple<NDIlib_frame_type_e, NDIlib_video_frame_v2_t,
NDIlib_audio_frame_v3_t, NDIlib_metadata_frame_t>(
type, video_frame, audio_frame, metadata_frame);
},
py::arg("instance"), py::arg("timeout_in_ms"));

In the examples folder, we do not explicitly free them, so there is potential for memory leaks if this is running for a long time (I got to 10GB after 17hours while testing)

while True:
t, v, _, _ = ndi.recv_capture_v2(ndi_recv, 5000)
if t == ndi.FRAME_TYPE_VIDEO:
print('Video data received (%dx%d).' % (v.xres, v.yres))
frame = np.copy(v.data)
cv.imshow('ndi image', frame)
ndi.recv_free_video_v2(ndi_recv, v)

Suggest changing the C++ implementation, or changing the examples so that the other 2 frames are freed.

For anyone looking for a quick solution in their own code you can do something like:

(
    frame_type,
    video_frame,
    audio_frame,
    meta_frame,
) = ndi.recv_capture_v3(ndi_connection, 5000)

# As this implementation of NDI implicitly gives you ALL 3 frame types
# You must make sure you free them, else you will get a memory leak!

if frame_type == ndi.FRAME_TYPE_VIDEO:
    # do stuff
    ndi.recv_free_video_v2(ndi_connection, video_frame)

if frame_type == ndi.FRAME_TYPE_AUDIO:
     # do stuff
    ndi.recv_free_audio_v3(ndi_connection, audio_frame)

if frame_type == ndi.FRAME_TYPE_METADATA:
     # do stuff
    ndi.recv_free_metadata(ndi_connection, meta_frame)

How could I get the whole video from a ndi resource?

According to your example, i can get image by recv_capture ,but it depends on how the while circulation fast. if a ndi resource is playing a video, how can I get a while video to save as v1.mov in local file.

Thank you for everything.

[Install Error - Windows] ERROR: Could not build wheels for ndi-python, which is required to install pyproject.toml-based projects

Hi,

I am getting an error when installing ndi-python to my Python Environment of ComfyUI.

My environment and packages.

Python 3.11.6
pip 23.3.2

cmake 3.28.1
setuptools 69.0.3
wheel 0.42.0

Collecting ndi-python
  Using cached ndi-python-5.1.1.1.tar.gz (16 kB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: numpy in c:\users\XXXX\documents\comfyui_windows_portable\python_embeded\lib\site-packages (from ndi-python) (1.26.2)
Building wheels for collected packages: ndi-python
  Building wheel for ndi-python (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [10 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-cpython-311
      creating build\lib.win-amd64-cpython-311\NDIlib
      copying NDIlib\__init__.py -> build\lib.win-amd64-cpython-311\NDIlib
      running build_ext
      cmake .. "-DCMAKE_INSTALL_PREFIX=C:\Users\XXXX\AppData\Local\Temp\pip-install-ku5u0ijp\ndi-python_48e2298972944fb19f0655d32b84425f\build\install"
      error: command 'cmake' failed: None
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for ndi-python

There are many similar problems online, and they mostly seem to be solved by downgrading specific packages or installing cmake.
My current packages are all updated. Is there any help...?

Install Error on MAC M1 Pro(13.3.1 )

Hi,

I am trying to install in my mac
I have all requirements installed (python, ndi sdk), but when I type "pip install ndi-python" in terminal, with or without sudo rights, I always getting the below error message :

Collecting ndi-python
Downloading ndi-python-5.1.1.1.tar.gz (16 kB)
Preparing metadata (setup.py) ... done
Requirement already satisfied: numpy in ./venv/lib/python3.11/site-packages (from ndi-python) (1.24.3)
Building wheels for collected packages: ndi-python
Building wheel for ndi-python (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [33 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.9-universal2-cpython-311
creating build/lib.macosx-10.9-universal2-cpython-311/NDIlib
copying NDIlib/init.py -> build/lib.macosx-10.9-universal2-cpython-311/NDIlib
running build_ext
cmake .. -DCMAKE_INSTALL_PREFIX=/private/tmp/pip-install-zea9xikg/ndi-python_2d44c946686a4d6a82d70f978cec3258/build/install
-- The C compiler identification is AppleClang 14.0.3.14030022
-- The CXX compiler identification is AppleClang 14.0.3.14030022
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:10 (add_subdirectory):
add_subdirectory given source "lib/pybind11" which is not an existing
directory.

  -- Found NDI: /Library/NDI SDK for Apple
  CMake Error at CMakeLists.txt:19 (pybind11_add_module):
    Unknown CMake command "pybind11_add_module".
  
  
  -- Configuring incomplete, errors occurred!
  error: command '/opt/homebrew/bin/cmake' failed with exit code 1
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for ndi-python
Running setup.py clean for ndi-python
Failed to build ndi-python
ERROR: Could not build wheels for ndi-python, which is required to install pyproject.toml-based projects

I have seen the same error in windows machine also.

Please provide solution to fix this issue.

Thank you 😃

Doesn't build with Python 64bit

CMAKE doesn't build with 64bit python version:

CMake Error at lib/pybind11/tools/FindPythonLibsNew.cmake:127 (message):
  Python config failure: Python is 64-bit, chosen compiler is 32-bit
Call Stack (most recent call first):
  lib/pybind11/tools/pybind11Tools.cmake:16 (find_package)
  lib/pybind11/CMakeLists.txt:33 (include)

Build error on windows

"Error in configuration process, project files may be invalid" CMakeOutput.log contains nothing either. Win 10 x64. CMake v3.20.0-rc1 using the GUI.

Select source downloaded from git, select empty folder as output, click configure, get error.

Edit: also tried in debian with the same error.

Video decoder not found

I am trying to run the recv_cv.py example on Ubuntu 20.04 and I keep getting a frame which displays the error "Video decoder not found please visit ndi.tv/formats for help and information." Do you have an idea on how to solve this? Thank you.

Add support for CMAKE to compile on aarch64-rpi4

The current FindNDI.cmake will compile fine on aarch64-rpi4, but requires modification to include the arch. Could we add it as a supported aarch for building, as it works just fine when modifications are made.

example modification to FindNDI.cmake that worked:
set(NDI_ARCH "aarch64-rpi4")

set(NDI_LIBRARY_DIR "${NDI_DIR}/lib/${NDI_ARCH}-linux-gnueabi")

Currently the cmake file does not do arch, only 32 or 64 bit, as far as I can tell.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.