A video input (V4L2) to NDI converter that works with Raspberry Pi (32-bit and 64-bit), and Intel/AMD CPUs

Overview

V4L2 to NDI

V4L2 to NDI is an application that connects to attached V4L2 devices and encodes the video signal into NDI

It uses the NDI library, allowing for auto-discovery of streams on the local network.

Supported devices

This software is tested with Raspberry Pi 4 and Intel Mini PCs. It typically runs well on a dual or quad core CPU that is clocked at or above 1.4 GHz, though results vary. This also works well with the TC358743 HDMI to CSI-2 adapter for Raspberry Pi. This particular HDMI adapter handles an HDMI input up to 1080p30 with no framedrops.

Install on Raspberry Pi OS 64-bit (recommended)

Make sure git is installed.

sudo apt update
sudo apt install git

Clone this repository and cd into it.

git clone https://github.com/windows10luke/V4L2-to-NDI.git && cd V4L2-to-NDI

Compile and install

sudo bash ./easy-install-rpi-aarch64.sh

Installation is now complete!

Install on Raspberry Pi OS 32-bit (not recommended)

Make sure git is installed.

sudo apt update
sudo apt install git

Clone this repository and cd into it.

git clone https://github.com/windows10luke/V4L2-to-NDI.git && cd V4L2-to-NDI

Compile and install

sudo bash ./easy-install-rpi-armhf.sh

Installation is now complete!

Install on x86_64 bit (Intel/AMD)

Make sure git is installed.

sudo apt update
sudo apt install git

Clone this repository and cd into it.

git clone https://github.com/windows10luke/V4L2-to-NDI.git && cd V4L2-to-NDI

Compile and install

sudo bash ./easy-install-x86_64.sh

Installation is now complete!

Usage

Once the installation process is complete, it will create an executable file located at /opt/v4l2ndi/bin/v4l2ndi

The installer also creates a symlink to /usr/bin so that it can be run from a normal terminal.

To see all the available options run the following

v4l2ndi -h

Typically, this app is run with a 30fps input with a pixel format input of YUV2. This command creates the NDI stream for that given input

v4l2ndi -d /dev/video0 -f

In case a 60fps input is needed, this command would be used instead

v4l2ndi -d /dev/video0 -f -n 60000 -e 1001

Suggested Hardware

The following latency observations are based on a Raspberry Pi 4 running Raspberry Pi OS 64-bit.

If needing 1080p60, a USB 3.0 HDMI capture interface is required. In this case, I would suggest an Elgato capture card or one that I used made by Hornettek. Latency will be a little higher when using this method compared to the CSI input (about 120ms)

If only using 1080p30, an HDMI to CSI adapter works good and provides lower latency (about 90ms). CPU usage is higher using this method however, and will reduce the number of NDI clients that can be connected at one time.

Comments
  • Add proper threaded mode

    Add proper threaded mode

    Migrate YUY2 conversion and sending to NDI stack to a separate thread when called with --threaded. Requires using c++14 (for make_unique).

    Signed-off-by: Charles Steinkuehler [email protected]

    opened by cdsteinkuehler 3
  • V4L2 at 1080p60

    V4L2 at 1080p60

    I have received the Hornettek HDMI to USB 3.0 adapter, but testing results in very poor video performance. This is not dropped frames, but bursty/choppy video. The system is under fairly low load, with htop reporting about 30-35% CPU usage.

    The issue appears to be caused by V4L2, as when I instrument the code to report when it receives a frame (just print a "." and fflush()) I see the issue even when I entirely disable the call to process_image.

    Are there any tweaks required to get good V4L2 input performance (eg: config.txt modifications or similar)?

    P.S. Feel free to email me directly (see Signed-off-by: in my commit) if you'd prefer.

    opened by cdsteinkuehler 2
  • Question - Has anyone tried this with a Raspberry Pi HQ Camera?

    Question - Has anyone tried this with a Raspberry Pi HQ Camera?

    I'm looking to set up a couple of (relatively) cheap NDI cameras in my studio for different angles, and wanted to know if there is any unusual settings I would need to know about to make it work with the HQ Camera.

    opened by SBCV-apegram 8
  • Mjpeg workaround

    Mjpeg workaround

    So I've come up with a work around for grabbing a mjpeg USB type deice using the v4l2 lookback

    //install and enable sudo apt install v4l2loopback-dkms sudo modprobe v4l2loopback

    //find which dev it is. v4l2-ctl --list-devices

    //generate the loopback; note the -i /dev and output /dev for output will be different for different machines ffmpeg -f v4l2 -video_size 1920x1080 -input_format mjpeg -i /dev/video2 -pix_fmt yuyv422 -f v4l2 /dev/video4

    //stream to ndi v4l2ndi -d /dev/video4 -f

    opened by crazy-logic 0
  • Could we add screen grabbing to this?

    Could we add screen grabbing to this?

    So I've come up with a work around for grabbing the display output on x11 based systems using the v4l2 lookback

    //install and enable sudo apt install v4l2loopback-dkms sudo modprobe v4l2loopback

    //find which dev it is. v4l2-ctl --list-devices

    //generate the loopback; note the -i for input and /dev for output will be different for different machines ffmpeg -video_size 1920x1080 -f x11grab -framerate 15 -i :1.0 -c:v rawvideo -pix_fmt yuyv422 -f v4l2 /dev/video4

    //stream to ndi v4l2ndi -d /dev/video4 -f

    So this works for me, the gotcha was the pix_fmt, and getting it to the YUYV that v4l2ndi required. Without which would give the following error; v4l2ndi -d /dev/video4 -f Path: /dev/video4 Driver: v4l2 loopback /dev/video4 support output /dev/video4 support capture /dev/video4 support read/write /dev/video4 support streaming Current pixel format: BGR4 Current frame width: 1920 Current frame height: 1080 Setting pixel format to: YUYV Cannot set format VIDIOC_S_FMT error 22, Invalid argument\n

    If you have any ideas how we could add this without the need for the loopback that would be great, happy to jump into code or test if you can point me where to start?

    opened by crazy-logic 1
  • Multiple USB video devices -

    Multiple USB video devices - "No space left on device"

    So been testing this today and ran into a problem that's not v4l2ndi's fault but something to be aware of with multiple USB video interfaces.

    https://stackoverflow.com/questions/11394712/libv4l2-error-turning-on-stream-no-space-left-on-device

    Sums up the issue and moving devices over multiple root hubs worked for me.

    opened by crazy-logic 0
Owner
Luke Plassman
Luke Plassman
NDI to JACK

NDI to JACK is an application that connects an NDI audio source to JACK for use as an audio output into other JACK compatible applications.

Luke Plassman 6 Aug 23, 2022
Fix some extrinsic parameter importing problems. 6-axis IMU works now. Lidar without ring works now.

LVI-SAM-MODIFIED This repository is a modified version of LVI-SAM. Modification Add function to get extrinsic parameters.The original code assumes the

null 77 Sep 28, 2022
Basic EFI with Opencore for AMD Ryzen and Threadripper

BASE EFI AMD - Ryzen and Threadripper (1XXX, 2XXX, 3XXX, 4XXX, 5XXX) and Athlon 2xxGE Note Description Initial macOS Support macOS 10.13, High Sierra.

Gabriel Luchina 39 Sep 19, 2022
AMD K6-2 (CXT) / K6-2+ / K6-3 / K6-3+ Write Allocate / Write Combine / Write Ordering / Frequency Multiplier Initialization driver for MS-DOS

K6INIT What is this? This is a driver for MS-DOS to replace k6dos.sys which is a bit useless and unflexible. It does not support the CXT versions of t

null 10 Sep 11, 2022
The implementation of the 'vSGX: Virtualizing SGX Enclaves on AMD SEV' paper

vSGX: Virtualizing SGX Enclaves on AMD SEV About the Project This is a research project aims to enable binary compatibility execution of Intel SGX enc

Computer Security Laboratory @ OSU 30 Sep 29, 2022
OpenDCDiag is an open-source project designed to identify defects and bugs in CPUs.

OpenDCDiag is an open-source project designed to identify defects and bugs in CPUs. It consists of a set of tests built around a sophisticated CPU testing framework. OpenDCDiag is primarily intended for, but not limited to, Data Center CPUs.

OpenDCDiag 24 Aug 27, 2022
Prueba del Raspberry PI PICO con un display Raspberry PI TFT 3.5"

Raspberry-PI-PICO-display-RPI35 Prueba del Raspberry PI PICO con un display Raspberry PI TFT 3.5" Con ayuda de la libreria https://github.com/khoih-pr

null 1 Nov 10, 2021
A C++ bare metal environment for Raspberry Pi with USB (32 and 64 bit)

A C++ bare metal environment for Raspberry Pi with USB (32 and 64 bit)

Rene Stange 1.4k Sep 27, 2022
An experimental dynamic malware unpacker based on Intel Pin and PE-sieve

Pin'n'Sieve A dynamic malware unpacker based on Intel Pin and PE-sieve (deploys PE-sieve scan on specific triggers). Caution: during the process the m

hasherezade 53 Sep 21, 2022
Kexts enabling native support for Intel Bluetooth chipsets in macOS.

IntelBluetoothFamily Kexts enabling native support for Intel Bluetooth chipsets in macOS. Most of the code is complete, and I am now in the testing ph

null 134 Sep 21, 2022
Mobile platform for analysis of localization methods using the Intel RealSense T265 sensor

OptiBot Mobile platform for analysis of localization methods using the Intel RealSense T265 sensor About | Content | Implementation | License | Author

Kamil Goś 2 Feb 17, 2022
Protobuf for Proxyman app - Include Apple Silicon & Intel architecture

Protobuf for Proxyman macOS app Protobuf for Proxyman app - Include Apple Silicon & Intel architecture How to build Open the project on the latest Xco

Proxyman 6 Nov 29, 2021
per - Simple unix permission viewer and converter

Per is a simple utility that can verbosely print unix permissions and convert between symbolic and numeric notations and vice-versa.

jarmuszz 5 Feb 27, 2022
CRServoF - The CSRF serial protocol to PWM servo converter

CRServoF - The CSRF serial protocol to PWM servo converter I wanted to create a small project to mess around with PWM servo output for ExpressLRS, and

Bryan Mayland 93 Sep 21, 2022
IR2USB - IR to USB HID Converter based on ATtiny45/85

IR2USB - IR to USB HID Converter based on ATtiny45/85 IR2USB receives signals from an infrared remote control and converts them into keyboard inputs,

Stefan Wagner 13 Aug 10, 2022
I2C to WS2812 (RGB LED) converter

i2c_ws2812 I2C to WS2812 (RGB LED) converter MCU and Peripherals The code is tested on ATtiny 0 & 1 series (ATtiny212 & ATtiny402). I2C, CCL, SPI, and

null 1 Oct 15, 2021
usb to 5 din midi converter-filter-router, sound generator

multi What is multi? It's a PCB (shield/hat) hosting a seeeduino Xiao. It has 6 potentiometers, 2 pushbuttons and a 1/8" audio out connected to the Xi

pangrus 25 Aug 24, 2022
Simple IEEE 754 float point to register converter

i3ecnv Simple IEEE 754 float point to register converter Usage IEEE 754 converter: Type: i3ecnv <double value> Example 1 ./i3ecnv 1.2 Value DO

Fábio Pereira da Silva 1 Nov 28, 2021