ndi-python

repository·master·Indexed 41 days ago

https://github.com/buresu/ndi-python

A Python wrapper for the NewTek NDI (Network Device Interface) SDK version 6.3.2.4, enabling developers to discover and capture NDI video sources within Python applications.

Tokens
761
Snippets
6
Records
6
Agent score
2%

What's inside ndi-python

  1. Setup Avahi on Linux

    master

    Linux users must install and enable the Avahi daemon to allow the library to search for NDI sources on the network.

    Ubuntu: Install avahi-daemon and enable it via systemctl.

    Arch Linux: Install avahi and enable the daemon via systemctl.

    # Ubuntu
    sudo apt install avahi-daemon
    sudo systemctl enable --now avahi-daemon
    
    # Arch Linux
    sudo pacman -S avahi
    sudo systemctl enable --now avahi-daemon
  2. Install ndi-python via pip

    master

    You can install ndi-python using pip if you are using a supported environment.

    Supported Environments:

    • Windows x64: Python 3.10-3.14
    • macOS arm64 (>=13.0): Python 3.10-3.14
    • Linux (x64, aarch64, armv7l): Python 3.10-3.14
    pip install ndi-python
  3. Capture NDI|HX sources on Linux

    master

    Capturing NDI|HX sources requires H.264 decoding capabilities. On Linux, the NDI SDK dynamically loads FFmpeg libraries. You must install a version of FFmpeg that is compatible with your NDI SDK.

    You can identify the required libavcodec version by running strings on your NDI library file. For example, if the output is libavcodec.so.61, you need FFmpeg 7.x.

    strings /path/to/ndilib/libndi.so | grep libavcodec
    # Example output: libavcodec.so.61 (indicates FFmpeg 7.x)
  4. Build ndi-python from source

    master

    To build the package from source, clone the repository and use pip install ..

    You can pass CMAKE_ARGS to specify the NDI SDK directory or target a specific Python executable.

    # Standard build
    git clone https://github.com/buresu/ndi-python.git
    cd ndi-python
    pip install .
    
    # Build with explicit NDI SDK directory
    CMAKE_ARGS="-DNDI_SDK_DIR=/path/to/ndisdk" pip install .
    
    # Build for a specific Python version
    CMAKE_ARGS="-DNDI_SDK_DIR=/path/to/ndisdk" /path/to/python3.12 -m pip install .
  5. Run ndi-python examples

    master

    To run the ported Python examples, clone the repository, install the necessary requirements, and run the find.py script.

    git clone https://github.com/buresu/ndi-python.git
    cd ndi-python/example
    pip install -r requirements.txt
    python find.py