Skip to content

lplassman/FFMPEG-NDI

Repository files navigation

FFMPEG NDI

Builds FFMPEG with NDI enabled

Linux

Download required installation files

Make sure git is installed.

sudo apt update
sudo apt install git

Clone this repository

git clone https://github.com/lplassman/FFMPEG-NDI.git

Clone the FFMPEG repository and cd into it

git clone https://git.ffmpeg.org/ffmpeg.git && cd ffmpeg

Checkout 4.4 or later version of FFMPEG

git checkout n5.1

Apply Generic GitHub Email

git config user.email "you@example.com"

Apply Patch to revert changes when NDI was removed from FFMPEG

sudo git am ../FFMPEG-NDI/libndi.patch
sudo cp ../FFMPEG-NDI/libavdevice/libndi_newtek_* libavdevice/

At this point, FFMPEG is now reverted back to the way it was before NDI was removed from it.

Install Prerequisites for building FFMPEG with base libraries

sudo bash ../FFMPEG-NDI/preinstall.sh

Choose the appropriate NDI install for the CPU architecture

Install NDI Libraries on Raspberry Pi 4 64-bit

sudo bash ../FFMPEG-NDI/install-ndi-rpi4-aarch64.sh

Install NDI Libraries on Raspberry Pi 4 32-bit

sudo bash ../FFMPEG-NDI/install-ndi-rpi4-armhf.sh

Install NDI Libraries on Raspberry Pi 3 32-bit

sudo bash ../FFMPEG-NDI/install-ndi-rpi3-armhf.sh

Install NDI Libraries on x86_64 bit (Intel/AMD)

sudo bash ../FFMPEG-NDI/install-ndi-x86_64.sh

Install NDI Libraries on generic ARM64

Compiling on generic ARM64 requires use of the NDI Advanced SDK. Due to licensing restrictions, the NDI Advanced SDK must be downloaded manually from NDI's website: ndi.tv Extract the downloaded NDI Advanced SDK .tar file and copy it to the ffmpeg directory on the target device. This can be achieved by using FTP, SCP, or Samba.

sudo bash ../FFMPEG-NDI/install-ndi-generic-aarch64.sh

Install NDI Libraries on generic ARM32

Compiling on generic ARM32 requires use of the NDI Advanced SDK. Due to licensing restrictions, the NDI Advanced SDK must be downloaded manually from NDI's website: ndi.tv Extract the downloaded NDI Advanced SDK .tar file and copy it to the ffmpeg directory on the target device. This can be achieved by using FTP, SCP, or Samba.

sudo bash ../FFMPEG-NDI/install-ndi-generic-armhf.sh

Build and Install FFMPEG (Linux)

The following is the bare minimum needed for sending and receiving NDI and more options can be added for a more feature filled FFMPEG build.

./configure --enable-nonfree --enable-libndi_newtek
make -j $(nproc)
sudo make install

Installation is now complete


macOS

Prerequisites

Install Homebrew if you don't have it, then clone the repositories:

git clone https://github.com/lplassman/FFMPEG-NDI.git
git clone https://git.ffmpeg.org/ffmpeg.git && cd ffmpeg
git checkout n5.1

Install the NDI SDK for Apple

Download and install the NDI SDK for Apple from ndi.video. The installer places files in /Library/NDI SDK for Apple/ by default.

Apply Patches

git config user.email "you@example.com"
git am ../FFMPEG-NDI/libndi.patch
cp ../FFMPEG-NDI/libavdevice/libndi_newtek_* libavdevice/

Install build prerequisites

bash ../FFMPEG-NDI/preinstall-macos.sh

Install NDI libraries to system paths

This copies headers and libraries from the NDI SDK to /usr/local/ so FFmpeg's configure can find them:

sudo bash ../FFMPEG-NDI/install-ndi-macos.sh

Apply mathops patch (Intel Macs only)

If building on an Intel Mac, apply the clang inline assembly fix:

git am ../FFMPEG-NDI/mathops.patch

This patch is not needed on Apple Silicon (ARM64) Macs.

Build and Install FFMPEG (macOS)

./configure --enable-nonfree --enable-libndi_newtek
make -j $(sysctl -n hw.ncpu)
sudo make install

If the NDI headers or libraries are not found, you can specify their paths explicitly:

./configure --enable-nonfree --enable-libndi_newtek \
    --extra-cflags="-I/Library/NDI SDK for Apple/include" \
    --extra-ldflags="-L/Library/NDI SDK for Apple/lib/macOS"

Usage for FFMPEG with NDI

List all sources on the network

ffmpeg -f libndi_newtek -find_sources 1 -i dummy

Stream a webcam to NDI (Linux)

ffmpeg -f v4l2 -framerate 30 -video_size 1280x720 -pixel_format mjpeg -i /dev/video1 -f libndi_newtek -pix_fmt uyvy422 CameraOut

Stream a webcam to NDI (macOS)

ffmpeg -f avfoundation -framerate 30 -video_size 1280x720 -i "0" -f libndi_newtek -pix_fmt uyvy422 CameraOut

Monitor a NDI stream

ffplay -fs -alwaysontop -fflags nobuffer -f libndi_newtek -bandwidth 0 -i 'NDI-SOURCE (Stream 1)'

Monitor a NDI stream (low latency)

ffplay -fs -alwaysontop -fflags nobuffer -flags low_delay -framedrop -analyzeduration 0 -max_probe_packets 1 -max_delay 0 -probesize 100000 -f libndi_newtek -bandwidth 0 -i 'NDI-SOURCE (Stream 1)'

The bandwidth argument can accept a few options when receiving:

  • 0 = High Bandwidth
  • 1 = Low Bandwidth
  • 2 = Audio Only

Helpful Tips

To view help

ffmpeg --help

To compress ffmpeg source to .tar file

tar -zcvf ffmpeg.tar.gz ffmpeg

About

FFMPEG with NDI support

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors