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 11 Dec 9, 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 88 Dec 9, 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 58 Dec 26, 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 35 Dec 13, 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 30 Dec 14, 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.5k Jan 2, 2023
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 54 Dec 16, 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 136 Dec 19, 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
Add virtual monitors to your windows 10 device! Works with Oculus software, obs, and any desktop sharing software

License MIT and CC0 or Public Domain, whichever is least restrictive -- Use it AS IS - NO IMPLICIT OR EXPLICIT warranty This may break your computer,

Rashi Abramson 230 Jan 6, 2023
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 Oct 23, 2022
Obfuscate calls to imports by patching in stubs. ICO works on both X86 and X64 binaries.

ICO adds a new section into the image, then begins building stubs for each import that uses a extremely basic routine to decrypt an RVA and places them into the section.

null 43 Dec 15, 2022
Unix pager (with very rich functionality) designed for work with tables. Designed for PostgreSQL, but MySQL is supported too. Works well with pgcli too. Can be used as CSV or TSV viewer too. It supports searching, selecting rows, columns, or block and export selected area to clipboard.

Unix pager (with very rich functionality) designed for work with tables. Designed for PostgreSQL, but MySQL is supported too. Works well with pgcli too. Can be used as CSV or TSV viewer too. It supports searching, selecting rows, columns, or block and export selected area to clipboard.

Pavel Stehule 1.9k Jan 4, 2023
Vectron VGA Plus generates a 640x480@60Hz VGA signal and has an interface that works with retro computers or microcontrollers.

Vectron VGA Plus Vectron VGA Plus generates a 640x480@60Hz VGA signal and has an interface that works with retro computers or microcontrollers. Screen

Nick Bild 32 Dec 14, 2022
An efficient, small mobile key-value storage framework developed by WeChat. Works on Android, iOS, macOS, Windows, and POSIX.

中文版本请参看这里 MMKV is an efficient, small, easy-to-use mobile key-value storage framework used in the WeChat application. It's currently available on Andr

Tencent 15.4k Jan 8, 2023