Code Monkey home page Code Monkey logo

raspindi's Introduction

RaspiNDI

RaspiNDI is a simple NDI send library for Raspberry Pi. It was initially developed to allow a streaming setup for a church during the COVID-19 outbreak in 2020.

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

❗ This software does not work with USB cameras. It uses the native libary for the on-board camera port. ❗

Supported boards

This software is tested with Raspberry Pi 3B+ boards. Some users have had success running it on a Rapsberry Pi 4. The Pi Zero W does not have enough memory to run this software

Latency Notes

Raspberry Pi 3b+ = ~600ms
Raspberry Pi 4b (4GB Model Tested) = ~200ms

Getting started - pre-compiled

Against the latest relase there are three files you need:

  • raspindi-${arch}
  • libndioutput-${arch}.so
  • libndi-${arch}.tar.gz

You will need to download the config file: wget -o /etc/raspindi.conf https://raw.githubusercontent.com/raspberry-pi-camera/raspindi/main/etc/raspindi.conf.default

Put the two sets of libraries in /usr/lib, and the raspindi binary somewhere in your PATH (eg /usr/local/bin), and run it

Getting started - compile your own

These intructions are for a clean installation of Raspberry Pi OS. All steps are performed on the command line.

tl;dr

  • git clone https://github.com/raspberry-pi-camera/raspindi.git && cd raspindi
  • ./easy-setup.sh
  • /opt/raspindi/raspindi.sh

Step by step

Make sure git is installed.

sudo apt update
sudo apt install git

Clone this repository and cd into it.

git clone https://github.com/raspberry-pi-camera/raspindi.git && cd raspindi

Install compilation dependencies.

sudo apt update
sudo apt install libconfig++-dev cmake libboost-program-options-dev libevent-dev libcamera-dev

Compile.

./build.sh

Install.

sudo ./install.sh

Install runtime dependencies.

sudo apt update
sudo apt install libavahi-client3 libevent-pthreads-2.1-7 libevent-core-2.1-7

Run it. (It does not require root to run.)

/opt/raspindi/raspindi.sh

Open an NDI receiver somewhere on the same network. It should detect the Raspberry Pi camera after a few seconds.

OBS Studio with the OBS-NDI plugin works well.

Changelog

v3.0.4

Updated libcamera code to fit with libcamera changes.

v3.0.3

Fixed NeoPixel code.

v3.0.2

Moved to using ndi 5.

v3.0.0

Changed to using libcamera rather than MMAL directly; MMAL will not be supported in Raspberry Pi OS after the current release

v2.0.2

Upgraded NDI library to v5.0.0

v2.0.1

Added config parameters for various camera settings (AWB, exposure etc.)

v2.0.0

Completely new method of acquiring the images - now calling mmal directly.
This, as well as using YUV colour, drastically improves the speed of the system, and the smoothness of the outputted video.

v1.1.1

Upgraded NDI library to v4.6.2

v1.1.0

Removed OpenCV integration

raspindi's People

Contributors

heathbarpunch avatar miniman13 avatar rf152 avatar rudolfbyker avatar sbcv-apegram avatar skarard avatar sq3tle avatar

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  avatar  avatar  avatar  avatar

raspindi's Issues

Expose more options from mmal to config file

Expose more of the options to be configured by the user (if desired):

  • Auto White Balance
  • Saturation
  • Sharpness
  • Contrast
  • Brightness
  • ISO
  • Exposure Mode
  • Metering Mode
  • Rotation (#7)
  • Mirror
  • Video Stabilisation

Segmentation Fault (again)

Describe the bug*
I think the segfault from issue 49 happens on line 162 of main.cpp. Commenting that out results in a bad_alloc on line 134 of main.cpp. That's as far as I could get with my limited knowledge of C++.

Raspberry Pi OS Lite (64bit) - Debian Bullseye on a Raspberry Pi 4B (2GB) (I switched in the 64bit NDI modules as I mentioned in my other issue.

My original device (CM4 4GB/32GB) is still working flawlessly, I have not installed any updates or patches, and will not until this starts working...

Ability to set brightness and contrast

hello, is there the possibility to change the parameters of the camera, like the contrast or the color thanks to a python command ? before installing Raspindi I used the command

CONTRAST IMG -100 - 100 (step1)

def imgSetContrast(self,m):
    if -100<=m<=100:
        subprocess.call(['v4l2-ctl', '--set-ctrl', f'contrast={m}'], shell=False)
        self.imgContrast=m
        print (f'Contrast={m}')

necessarily now it is no longer valid
thank you for your help and your work

Just showing support!

Sorry for putting this in the issues tracker (feel free to mark this as closed). Just wanted to say that this is super awesome as the NDI SDK isn't even available for ARM processors anymore. This really turns $30 board with the really nice high quality pi cameras into powerful tools for livestreams at events. Keep up the good work (already made a public GUI for this btw ;) )

camera models applicable

could you just drop a word whether this solution is meant for raspberry camera modules or USB connected webcams also and how to configure?

Cannot find libraries

Hello! I'm getting this issue I'm not able to solve... Does anybody know how to fix it?

pi@raspberrypi:~/raspindi $  ./build.sh
-- Configuring done
-- Generating done
-- Build files have been written to: /home/pi/raspindi/build
[ 50%] Built target ndioutput
[ 75%] Linking CXX executable raspindi
/usr/bin/ld: cannot find -lencoders
/usr/bin/ld: cannot find -loutputs
/usr/bin/ld: cannot find -lcamera_app
collect2: error: ld returned 1 exit status
make[2]: *** [src/CMakeFiles/raspindi.dir/build.make:85: src/raspindi] Error 1
make[1]: *** [CMakeFiles/Makefile2:96: src/CMakeFiles/raspindi.dir/all] Error 2
make: *** [Makefile:84: all] Error 2

Thank you! 🙏

Is there a method to adjust camera settings while the NDI stream is running?

Is your feature request related to a problem? Please describe.
I would like to be able to adjust camera settings on the fly, is this possible? or do we need to change the config file and reload the service?

Describe the solution you'd like
Ability to adjust live, via control app, python interface, or some sort of web interface?

Preview tally status not correct with OBS 30.0.2 on Mac OS X

Describe the bug
The preview tally status is not updated correctly. Program tally works as expected.

To Reproduce
Start raspindi on the Pi in a terminal window, and observe the tally status being printed to stdout.
Create two scenes in OBS, one containing the raspindi source, the other one empty.
Cue the raspindi scene into the preview. The PVW tally shows "1", PGM tally is "0". Ok so far.
Cut into the raspindi scene. The PGM tally shows "1". PVW tally remains at 1, wrong!
Cue the empty scene into preview. Still the PVW tally does not go back to zero.

Expected behavior
PVW tally should be a zero when not cued.

Additional context
Might as well be an OBS bug, can't test with other tools atm.

Error while loading shared libraries: libcamera.so.0

Hi! I wanted to try and get this working but I'm running into the following message when I try to run raspindi.sh:

/opt/raspindi/bin/raspindi: error while loading shared libraries: libcamera.so.0: cannot open shared object file: No such file or directory

I'm doing this on a currently fresh Raspbian Bullseye Lite install. I found this issue from another project that might suggest something has changed concerning libcamera in Raspbian. But I'm not skilled enough to look in your source and try to correct for it, if that is even the problem.

I've tried the precompiled files, easy-setup script, and step-by-step instructions each on clean installations but I continue to get to the same error message.

I might be overlooking something very basic here. Sorry if that's the case.

Adding audio to NDI stream from local audio capture

Something that would really make this project shine is the ability to add audio along with the video source, this way full microphone and video setups could run just off the raspberry pi! This might be a bit much to request but if its possible I bet it would be a great addition.

Another feature could be the ability to see all the config options or pass options in the command line. The changelog shows that you can add config parameters but doesn't say where.

Build fails

I Tried to use the compiled version (on raspberry pi 4 running bookworm) but there is a lib compatibility error:

./raspindi-aarch64: error while loading shared libraries: libcamera_app.so.1.2.1: cannot open shared object file: No such file or directory

Then I tried to build it as well and it seems there was again some breaking changes in libcamera. Or I'm doing something wrong ?

ln: failed to create symbolic link 'lib/lib-aarch64': File exists
-- Configuring done
-- Generating done
-- Build files have been written to: /home/AlexPi/raspindi/raspindi/build
[ 50%] Built target ndioutput
[ 75%] Linking CXX executable raspindi
/usr/bin/ld: CMakeFiles/raspindi.dir/main.cpp.o: in function `event_loop(LibcameraEncoder&)':
main.cpp:(.text+0x884): undefined reference to `LibcameraApp::OpenCamera()'
/usr/bin/ld: main.cpp:(.text+0x890): undefined reference to `LibcameraApp::ConfigureVideo(unsigned int)'
/usr/bin/ld: main.cpp:(.text+0x8a0): undefined reference to `LibcameraApp::StartCamera()'
/usr/bin/ld: main.cpp:(.text+0x8b4): undefined reference to `LibcameraApp::Wait()'
/usr/bin/ld: main.cpp:(.text+0x924): undefined reference to `LibcameraApp::VideoStream(StreamInfo*) const'
/usr/bin/ld: CMakeFiles/raspindi.dir/main.cpp.o: in function `LibcameraApp::GetVerbosity()':
main.cpp:(.text._ZN12LibcameraApp12GetVerbosityEv[_ZN12LibcameraApp12GetVerbosityEv]+0x0): undefined reference to `LibcameraApp::verbosity'
/usr/bin/ld: main.cpp:(.text._ZN12LibcameraApp12GetVerbosityEv[_ZN12LibcameraApp12GetVerbosityEv]+0x4): undefined reference to `LibcameraApp::verbosity'
/usr/bin/ld: CMakeFiles/raspindi.dir/main.cpp.o: in function `LibcameraEncoder::LibcameraEncoder()':
main.cpp:(.text._ZN16LibcameraEncoderC2Ev[_ZN16LibcameraEncoderC5Ev]+0x38): undefined reference to `LibcameraApp::LibcameraApp(std::unique_ptr<Options, std::default_delete<Options> >)'
/usr/bin/ld: main.cpp:(.text._ZN16LibcameraEncoderC2Ev[_ZN16LibcameraEncoderC5Ev]+0xcc): undefined reference to `LibcameraApp::~LibcameraApp()'
/usr/bin/ld: CMakeFiles/raspindi.dir/main.cpp.o: in function `LibcameraEncoder::EncodeBuffer(std::shared_ptr<CompletedRequest>&, libcamera::Stream*)':
main.cpp:(.text._ZN16LibcameraEncoder12EncodeBufferERSt10shared_ptrI16CompletedRequestEPN9libcamera6StreamE[_ZN16LibcameraEncoder12EncodeBufferERSt10shared_ptrI16CompletedRequestEPN9libcamera6StreamE]+0x64): undefined reference to `LibcameraApp::GetStreamInfo(libcamera::Stream const*) const'
/usr/bin/ld: main.cpp:(.text._ZN16LibcameraEncoder12EncodeBufferERSt10shared_ptrI16CompletedRequestEPN9libcamera6StreamE[_ZN16LibcameraEncoder12EncodeBufferERSt10shared_ptrI16CompletedRequestEPN9libcamera6StreamE]+0x94): undefined reference to `LibcameraApp::Mmap(libcamera::FrameBuffer*) const'
/usr/bin/ld: CMakeFiles/raspindi.dir/main.cpp.o: in function `LibcameraEncoder::createEncoder()':
main.cpp:(.text._ZN16LibcameraEncoder13createEncoderEv[_ZN16LibcameraEncoder13createEncoderEv]+0x20): undefined reference to `LibcameraApp::VideoStream(StreamInfo*) const'
/usr/bin/ld: CMakeFiles/raspindi.dir/main.cpp.o: in function `LibcameraEncoder::~LibcameraEncoder()':
main.cpp:(.text._ZN16LibcameraEncoderD2Ev[_ZN16LibcameraEncoderD5Ev]+0x50): undefined reference to `LibcameraApp::~LibcameraApp()'
/usr/bin/ld: CMakeFiles/raspindi.dir/main.cpp.o:(.data.rel.ro._ZTI16LibcameraEncoder[_ZTI16LibcameraEncoder]+0x10): undefined reference to `typeinfo for LibcameraApp'
collect2: error: ld returned 1 exit status
make[2]: *** [src/CMakeFiles/raspindi.dir/build.make:98: src/raspindi] Error 1
make[1]: *** [CMakeFiles/Makefile2:100: src/CMakeFiles/raspindi.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

Raspberry PI 5 support?

Greetings Friends,

Feature / question:

Has anyone tried this with a Raspberry PI 5?

Does it work with a Raspberry PI 5?

USB capture cam

Hello!
Nice job! congratulations!
Its possible change source cam for USB capture cam?
thnak you!

Segfault after a few minutes of streaming

Describe the bug
After a few minutes of streaming, the process terminates with a SIGSEGV. The build fixes from #72 were applied to the tree. This is on RaspiOS 12.4 Bookworm

Additional context

(gdb) bt
#0  0x0000007fb5ccaf64 in NDIlib_send_get_tally () from /opt/raspindi/lib/libndi.so.5
#1  0x0000007fb6211984 in NdiOutput::outputBuffer(void*, unsigned long, long, unsigned int) () from /opt/raspindi/lib/libndioutput.so
#2  0x0000007fb61c68b0 in Output::OutputReady(void*, unsigned long, long, bool) () from /lib/aarch64-linux-gnu/rpicam_app.so.1.4.1
#3  0x000000557156600c in void std::__invoke_impl<void, void (Output::*&)(void*, unsigned long, long, bool), Output*&, void*, unsigned long, long, bool>(std::__invoke_memfun_deref, void (Output::*&)(void*, unsigned long, long, bool), Output*&, void*&&, unsigned long&&, long&&, bool&&) ()
#4  0x0000005571565648 in std::__invoke_result<void (Output::*&)(void*, unsigned long, long, bool), Output*&, void*, unsigned long, long, bool>::type std::__invoke<void (Output::*&)(void*, unsigned long, long, bool), Output*&, void*, unsigned long, long, bool>(void (Output::*&)(void*, unsigned long, long, bool), Output*&, void*&&, unsigned long&&, long&&, bool&&) ()
#5  0x00000055715646b8 in void std::_Bind<void (Output::*(Output*, std::_Placeholder<1>, std::_Placeholder<2>, std::_Placeholder<3>, std::_Placeholder<4>))(void*, unsigned long, long, bool)>::__call<void, void*&&, unsigned long&&, long&&, bool&&, 0ul, 1ul, 2ul, 3ul, 4ul>(std::tuple<void*&&, unsigned long&&, long&&, bool&&>&&, std::_Index_tuple<0ul, 1ul, 2ul, 3ul, 4ul>) ()
#6  0x000000557156384c in void std::_Bind<void (Output::*(Output*, std::_Placeholder<1>, std::_Placeholder<2>, std::_Placeholder<3>, std::_Placeholder<4>))(void*, unsigned long, long, bool)>::operator()<void*, unsigned long, long, bool, void>(void*&&, unsigned long&&, long&&, bool&&) ()
#7  0x0000005571561b60 in void std::__invoke_impl<void, std::_Bind<void (Output::*(Output*, std::_Placeholder<1>, std::_Placeholder<2>, std::_Placeholder<3>, std::_Placeholder<4>))(void*, unsigned long, long, bool)>&, void*, unsigned long, long, bool>(std::__invoke_other, std::_Bind<void (Output::*(Output*, std::_Placeholder<1>, std::_Placeholder<2>, std::_Placeholder<3>, std::_Placeholder<4>))(void*, unsigned long, long, bool)>&, void*&&, unsigned long&&, long&&, bool&&) ()
#8  0x000000557155f2d4 in std::enable_if<is_invocable_r_v<void, std::_Bind<void (Output::*(Output*, std::_Placeholder<1>, std::_Placeholder<2>, std::_Placeholder<3>, std::_Placeholder<4>))(void*, unsigned long, long, bool)>&, void*, unsigned long, long, bool>, void>::type std::__invoke_r<void, std::_Bind<void (Output::*(Output*, std::_Placeholder<1>, std::_Placeholder<2>, std::_Placeholder<3>, std::_Placeholder<4>))(void*, unsigned long, long, bool)>&, void*, unsigned long, long, bool>(std::_Bind<void (Output::*(Output*, std::_Placeholder<1>, std::_Placeholder<2>, std::_Placeholder<3>, std::_Placeholder<4>))(void*, unsigned long, long, bool)>&, void*&&, unsigned long&&, long&&, bool&&) ()
#9  0x000000557155c7f0 in std::_Function_handler<void (void*, unsigned long, long, bool), std::_Bind<void (Output::*(Output*, std::_Placeholder<1>, std::_Placeholder<2>, std::_Placeholder<3>, std::_Placeholder<4>))(void*, unsigned long, long, bool)> >::_M_invoke(std::_Any_data const&, void*&&, unsigned long&&, long&&, bool&&) ()
#10 0x0000007fb61b7b24 in NullEncoder::outputThread() () from /lib/aarch64-linux-gnu/rpicam_app.so.1.4.1
#11 0x0000007fb592e9dc in ?? () from /lib/aarch64-linux-gnu/libstdc++.so.6
#12 0x0000007fb56eee18 in start_thread (arg=0x7fdfb44217) at ./nptl/pthread_create.c:442
#13 0x0000007fb5757e9c in thread_start () at ../sysdeps/unix/sysv/linux/aarch64/clone.S:79

Discussion: Deterministic timing

Is there a way to make the delay more deterministic? Maybe by timestamping the NDI stream somehow and then making sure all of my PCs are using the same NTP source?

I'm having the issue that I have to modify the delay on a weekly basis to get the RPI-NDI camera (on the same gigabit switch as the streaming PC) in sync with the audio, which is captured directly through an audio interface (not connected to the RPI). It is usually around 333ms, but this past Sunday it was more than 1s, while nothing changed in the hardware or software setup on either the RPI or the streaming PC.

Connected but no image

Clean install of Debian GNU/Linux 11 (bullseye) 64Bit on a Pi4B

Everything appears to be ok. I can grab a still image from the camera with libcamera-still -o test.jpg

raspindi appears to start cleanly.
I can see the NDi source available in NDi Studio Monitor
image

But I have no image at all, black screen.

What am I missing?

pi@ndipi1:~ $ /opt/raspindi/raspindi.sh
Options:
    verbose: 0
    info_text:
    timeout: 0
    width: 1920
    height: 1080
    output:
    post_process_file:
    rawfull: 0
    preview: none
    qt-preview: 0
    transform: identity
    roi: all
    metering: average
    exposure: auto
    ev: 0
    awb: auto
    flush: false
    wrap: 0
    brightness: 0
    contrast: 1
    saturation: 1
    sharpness: 1
    framerate: 25
    denoise: off
    viewfinder-width: 0
    viewfinder-height: 0
    tuning-file:
    lores-width: 0
    lores-height: 0
    autofocus-mode:
    autofocus-range:
    autofocus-speed:
    autofocus-window: all
    mode: unspecified
    viewfinder-mode: unspecified
    metadata:
    metadata-format:
    bitrate: 0
    profile:
    level:
    intra: 0
    inline: 0
    save-pts:
    codec: YUV420
    quality (for MJPEG): 0
    keypress: 0
    signal: 0
    initial:
    split: 0
    segment: 0
    circular: 0
Running without preview window
Opening camera...
[0:38:59.976511638] [2286]  INFO Camera camera_manager.cpp:299 libcamera v0.0.3+40-9b860a66
[0:39:00.026632142] [2294]  INFO RPI raspberrypi.cpp:1425 Registered camera /base/soc/i2c0mux/i2c@1/ov5647@36 to Unicam device /dev/media4 and ISP device /dev/media1
Acquired camera /base/soc/i2c0mux/i2c@1/ov5647@36
Configuring video...
Mode selection:
    SGBRG10_CSI2P 640x480 - Score: 8093.33
    SGBRG10_CSI2P 1296x972 - Score: 5797.33
    SGBRG10_CSI2P 1920x1080 - Score: 3000
    SGBRG10_CSI2P 2592x1944 - Score: 23450.2
Stream configuration adjusted
[0:39:00.037774787] [2286]  INFO Camera camera.cpp:1028 configuring streams: (0) 1920x1080-YUV420 (1) 1920x1080-SGBRG10_CSI2P
[0:39:00.038101035] [2294]  INFO RPI raspberrypi.cpp:805 Sensor: /base/soc/i2c0mux/i2c@1/ov5647@36 - Selected sensor format: 1920x1080-SGBRG10_1X10 - Selected unicam format: 1920x1080-pGAA
Camera streams configured
Available controls:
    AeEnable : [false..true]
    ExposureTime : [118..969249]
    NoiseReductionMode : [0..4]
    FrameDurationLimits : [32660..969367]
    ColourCorrectionMatrix : [-16.000000..16.000000]
    Saturation : [0.000000..32.000000]
    AeMeteringMode : [0..3]
    Contrast : [0.000000..32.000000]
    ExposureValue : [-8.000000..8.000000]
    AwbMode : [0..7]
    AeConstraintMode : [0..3]
    ScalerCrop : [(0, 0)/64x64..(0, 0)/1928x1080]
    AnalogueGain : [1.000000..63.937500]
    ColourGains : [0.000000..32.000000]
    Brightness : [-1.000000..1.000000]
    AeExposureMode : [0..3]
    AwbEnable : [false..true]
    Sharpness : [0.000000..16.000000]
Buffers allocated and mapped
Video setup complete
Opened NullEncoder
Requests created
Camera started!
PGM: 0 PVW: 0
PGM: 0 PVW: 0
PGM: 0 PVW: 0
PGM: 0 PVW: 0

Possibly broken by a recent Windows update?

My RPI 4 running raspindi has been working well for a few months now, until about a week ago.

Symptoms

raspindi source is detected, but video is just black. Other sources, like NDI's own screen capture, is still working.

What changed?

The only thing that changed was a recent windows update, although I'm not sure which one. It stopped working on multiple Windows PCs, while continuing to work on other Windows PCs and all Linux PCs (using the exact same RPI4).

  • The Windows PCs on which it does NOT work are all on update 10.0.19042.
  • The Windows PCs on which it DOES work are all on update 10.0.18363.
  • It's working on LinuxMint.

Whose fault?

At first, I though this was a problem with the obs-ndi plugin that I'm using. See DistroAV/DistroAV#651 . But NDI Studio Monitor is showing the exact same symptoms.

Since nothing changed in raspindi, it's probably not the raspindi's fault.

However, since other NDI sources are still working, it might be possible to get this working again from raspindi's side?

Upgrade NDI library to NDI 5

With the announcement today of NDI 5, I would like to look at using NDI 5 as the library.

It reports to have performance improvements, as well as new features.

`raspindi.sh` hangs on Raspberry Pi 3B

Describe the bug
Running /opt/raspindi/raspindi.sh hangs in the terminal; nothing happens.
This is on a Raspberry Pi 3B with a Pi Camera Module 1.2.

To Reproduce
Steps to reproduce the behavior:

  1. Follow installation instructinos based on Raspberry Pi OS; assure no errors
  2. Run /opt/raspindi/raspindi.sh

Expected behavior
Something happens.

Additional context
Should this work with a pi camera module?

Cannot change fps

Describe the bug
Modifying /etc/raspindi.conf does not change the framerate of the NDI stream.

To Reproduce
Steps to reproduce the behavior:

  1. sudo nano /etc/raspindi.conf
  2. Change "fps" to 25 (line 5)
  3. exit, save, restart raspindi
  4. NDI stream still at 29.97p

Expected behavior
I would expect the fps to change accordingly.

Additional context
Changing the size of the video works (i.e. 1920x1080).
Also changing rotation and/or mirroring works.

I have also changed tried altering the name of the parameter in line 5 (fps, framerate, frame-rate...) - to no avail.
I also tried changing the format of the framerate to 25.00 - also no difference.

thanks, ahoi, j

raspindi stop a second after start with OBS plugin

hi, I am trying to deploy two raspberry as cameras for a small church in the center of Madrid (spain), our idea is to broadcast the sunday by instagram, for this we have two raspberry with camera and a PC, in the pc we have obs last version with the plugin: https://github.com/obs-ndi/obs-ndi, before it worked fine but with the last versions we got errors compiling so now we move raspberrpi os to image (raspindi-3.0.3.img.gz) and raspberry works well but we start OBS...

./opt/raspindi/raspindi.sh
Buffers allocated and mapped
Video setup complete
Opened NullEncoder
Requests created
Camera started!
PGM: 0 PVW: 0
PGM: 0 PVW: 0
PGM: 0 PVW: 0
PGM: 0 PVW: 0
PGM: 0 PVW: 0
PGM: 0 PVW: 0
PGM: 0 PVW: 0
PGM: 0 PVW: 0
PGM: 0 PVW: 0
PGM: 0 PVW: 0
PGM: 0 PVW: 0
PGM: 0 PVW: 0
PGM: 0 PVW: 0
PGM: 0 PVW: 0
PGM: 0 PVW: 0
PGM: 0 PVW: 0
PGM: 0 PVW: 0
PGM: 0 PVW: 0
PGM: 0 PVW: 0
PGM: 0 PVW: 0
PGM: 0 PVW: 0
PGM: 1 PVW: 1

thanks all

Unable to build main branch

Describe the bug
Building using easy-setup.sh or manually results in the following error:

/usr/bin/ld: skipping incompatible /home/apegram/raspindi/src/../lib/ndi/libndi.so when searching for -lndi
/usr/bin/ld: cannot find -lndi
/usr/bin/ld: skipping incompatible /home/apegram/raspindi/src/../lib/ndi/libndi.so when searching for -lndi
collect2: error: ld returned 1 exit status
make[2]: *** [src/CMakeFiles/raspindi.dir/build.make:104: src/raspindi] Error 1
make[1]: *** [CMakeFiles/Makefile2:142: src/CMakeFiles/raspindi.dir/all] Error 2
make: *** [Makefile:103: all] Error 2

To Reproduce
git clone https://github.com/raspberry-pi-camera/raspindi.git && cd ./raspindi
./easy-setup.sh

Expected behavior
A completed, usable build

Additional context
This is run on a clean install of Raspberry Pi OS Lite (64-bit) on a Raspberry Pi CM4104032

Installer does not find a folder

In the step of "sudo ./install":
the script tries to copy a folder "lib/raspicam/*" while there is no folder that is call like that.
image

Documentation

Hi, would you add some documentation to help those who are new to NDI to get this up and running on their PI4?

No video when viewing Raspberry Pi NDI source.

Describe the bug
Connecting to the Raspberry Pi NDI source doesn't display an output. I don't receive an error.

To Reproduce

  1. Run /opt/raspindi/raspindi.sh
  2. Use Obs-NDI plugin (or NDI Tools Webcam Input)
  3. View RASPBERRY PI>Video Feed

Expected behavior
Stream video coming from the Raspberry Pi

Additional context
There were no errors.
This is a fresh installation of the latest Raspberry Pi OS (kernel 5.10)
I installed Barrier (for remote mouse and keyboard)
Followed the tl;dr (easy-setup.sh) from the readme.

Hardware
Raspberry Pi 4
Raspberry Pi HQ Camera

GPU Support

Hi - Really great implementation, works a treat and stable. I was wondering if you had looked at using the encoder h/w on the pi ? Taking a look at the stats it appears is all CPU and so not really possible to get a smooth stream on a Model 3 above CIF (352 × 288) ?? The thought would be to use the mmal library and offload to the GPU/VPU?

Support for PiZeroW - build opt. for ARM6

Is your feature request related to a problem? Please describe.
'illegal instruction' when running raspindi on piZeroW

Describe the solution you'd like
build opt. for PiZeroW to support addition Pi models

Describe alternatives you've considered
Not using PiZero : -) - It's possible the single core won't be up to the task, but it stills has GPU and v2.0x is making full use to hopeful of 1280x720 @ 25fps is possible

Additional context

Migrate to libcamera

With buster onward, libcamera is the new method of accessing the camera. Need to investigate the move to libcamera from mmal functions directly.

This will bump raspindi to v3, as it is a major change

Missing lib

I get this error when running build.

pi@raspberrypi:~/raspindi $ sh build.sh
src/main.cpp:17:10: fatal error: libconfig.h++: No such file or directory
#include <libconfig.h++>
^~~~~~~~~~~~~~~
compilation terminated.

"Segmentation Fault" when trying to run

Hi, really cool project and exactly what I need for something I'm working on.

When trying to get this running on a fresh Bullseye install on a Pi 4 Model B, after following the step-by-step instructions, I get the following:

Parse error at /etc/raspindi.conf:17 - syntax error
Segmentation Error

The extent of my troubleshooting (hampered by a lack of skill) on this has been tracking down the reported line, which is:

# mirror: "none"; // Options: none, horizontal, vertical, both

I've tried the various listed options, as well as removing the line entirely and that hasn't done the trick.

I appreciate this is probably less a bug report and more a matter of my own inability, but any advice would be greatly appreciated nonetheless!

Edit:
With a little more fiddling, I removed the hash and space prior to each option line in raspindi.conf. This may or may not have been a good idea, but it has left me with solely Segmentation Fault as an error when trying to run raspindi.sh

Couldn't say if this was useful information at all.

Segmentation Fault

I have used the official imager to setup a new Pi 4 (4GB) running Buster lite three times: SD card 64bit, SSD 64bit, and SSD 32bit. After the machine comes up the first time, I apt update/upgrade, install git, and follow the install instructions given on this repo. For 64bit, I needed to do what was mentioned here:

#45

But, other than that, I think I'm working with clean installs that are free of any accidental misconfiguration.

The camera works. It has been working fine with a Pi 2, and I can use libcamera on the Pi 4 to pull images and video. Yet, I'm getting this every time I try to start raspindi:

Options: verbose: 0 info_text:#%frame (%fps fps) exp %exp ag %ag dg %dg timeout: 5000 width: 1280 height: 720 output: post_process_file: rawfull: 0 preview: none qt-preview: 0 transform: identity roi: all metering: average exposure: auto ev: 0 awb: auto flush: false wrap: 0 brightness: 0 contrast: 1 saturation: 1 sharpness: 1 framerate: 25 denoise: off viewfinder-width: 0 viewfinder-height: 0 tuning-file: (libcamera) lores-width: 0 lores-height: 0 mode: unspecified viewfinder-mode: unspecified bitrate: 0 profile: level: intra: 0 inline: 0 save-pts: codec: YUV420 quality (for MJPEG): 50 keypress: 0 signal: 0 initial: record split: 0 segment: 0 circular: 0 Segmentation fault

I've been around Linux and programming for many years, but I don't claim to be any great sage. To me, Segmentation Fault speaks of a memory management problem. So, I ran memory tests - which the device seemed to pass. I was initially trying to use a 64bit OS, and I know there are differences in how 32/64bit relate to memory, so I switched to 32bit. Didn't help, same "Segmentation fault". I wondered if maybe my somewhat cheap SSD was at fault, so I tried it on a standard SD card. Didn't help.

I'm going to try a Pi 3, to hopefully prove whether my procedure can work. But, I still want to get a Pi 4 working. The readme references latency on a Pi 4, so someone has got it to work. Was that pre-Buster? What am I missing?

I hope I'm not missing something stupid. I've tried to do my homework to not waste anyone's time. But "Segmentation fault" isn't highly descriptive for a Google search. Can someone tell me how to get a more verbose output, at least?

Thank you!

Missing libencoders.so.1 library when running binary

I followed the steps on the README to run raspindi from the binary. I have a raspberry pi 4 with a fresh install of raspbian bullseye 64bit.

  • ran uname -m and my arch is aarch64
  • download libndioutput-aarch64.so into /usr/lib
  • download libndi-aarch64.tar.gz and unzip into /usr/lib
  • download raspindi.conf.default and mv to /etc/raspindi.conf
  • download raspindi-aarch64 and mv to /usr/bin/raspindi. run chmod a+x
  • run raspindi

result:
root@camera2:/etc# raspindi
raspindi: error while loading shared libraries: libencoders.so.1: cannot open shared object file: No such file or directory

I've tried to search for a debian package that contains this file but I haven't had much luck

Build errors

I used the latest raspbian bullseye 64bit image. I used the easy-setup.sh script, which installed several libraries (I've doublecheked that all of the compile and runtime libraries listed on the README are installed). when it executes the build.sh I get this compiler error:

-- Configuring done
-- Generating done
-- Build files have been written to: /home/camera/raspindi/build
Scanning dependencies of target ndioutput
[ 25%] Building CXX object src/CMakeFiles/ndioutput.dir/ndi_output.cpp.o
In file included from /home/camera/raspindi/src/../include/core/logging.hpp:1,
from /home/camera/raspindi/src/../include/core/options.hpp:22,
from /home/camera/raspindi/src/../include/core/video_options.hpp:14,
from /home/camera/raspindi/src/../include/output/output.hpp:14,
from /home/camera/raspindi/src/ndi_output.hpp:10,
from /home/camera/raspindi/src/ndi_output.cpp:8:
/home/camera/raspindi/src/../include/core/libcamera_app.hpp:55:33: error: ‘StreamRoles’ in namespace ‘libcamera’ does not name a type; did you mean ‘StreamRole’?
55 | using StreamRoles = libcamera::StreamRoles;
| ^~~~~~~~~~~
| StreamRole
make[2]: *** [src/CMakeFiles/ndioutput.dir/build.make:82: src/CMakeFiles/ndioutput.dir/ndi_output.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:115: src/CMakeFiles/ndioutput.dir/all] Error 2
make: *** [Makefile:103: all] Error 2

Am I missing a library? Or do I not have a correct version?

No issue - Question

Hi,

Is it possible to capture 2 ndi camera's (thru a switch) and stream these to an ip with a raspberry?
With this code I mean or is this beyond the capacities of this hub?

Kind regards,

How feasible is it to add Logitech (C920) Webcam support

Hi - newcomer to Raspi but long history in SW eng.

Seems this implementation uses mmal which is specific to the onboard camera.
Since I have a load of C920s spare I was wondering how feasible it would be for me to convert this over to use Webcam input.

Suspecting the answer is just go buy the onboard camera.

We are getting a pair of PTZ cameras for our livestreaming operation and was looking for a way to utilise the Webcams as local closeups for our worship band.

Is it possible to run multiple pi's for multiple NDI streams?

Is your feature request related to a problem? Please describe.
I'd like to run multiple pi's to have multiple video streams in the same network. I can do this by changing the video stream name in main.cpp to, for examples Video Feed 2, build and install again; and then I can run two.

Describe the solution you'd like
Currently, without doing the above, when i try this, the first camera works but the second does not; the application runs but I don't see its NDI stream. I suspect this is because the streams have the same name?

Describe alternatives you've considered
Add stream name to the configuration file?

Additional context
Add any other context or screenshots about the feature request here.

Build fails

I'm just trying this for the first time. I'm installing on a Pi4 Model B, running lightweight Pi OS (64 bit)

Following the 'compile your own' step by step instructions I get as far as "./build.sh" which generates the following output.

pi@ndipi1:~/raspindi $ ./build.sh
-- Configuring done
-- Generating done
-- Build files have been written to: /home/pi/raspindi/build
[ 50%] Built target ndioutput
[ 75%] Linking CXX executable raspindi
/usr/bin/ld: warning: libavahi-client.so.3, needed by /home/pi/raspindi/src/../lib/ndi/libndi.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: /home/pi/raspindi/src/../lib/ndi/libndi.so: undefined reference to avahi_entry_group_new' /usr/bin/ld: /home/pi/raspindi/src/../lib/ndi/libndi.so: undefined reference to avahi_service_resolver_free'
/usr/bin/ld: /home/pi/raspindi/src/../lib/ndi/libndi.so: undefined reference to avahi_client_new' /usr/bin/ld: /home/pi/raspindi/src/../lib/ndi/libndi.so: undefined reference to avahi_entry_group_commit'
/usr/bin/ld: /home/pi/raspindi/src/../lib/ndi/libndi.so: undefined reference to avahi_client_free' /usr/bin/ld: /home/pi/raspindi/src/../lib/ndi/libndi.so: undefined reference to avahi_service_browser_new'
/usr/bin/ld: /home/pi/raspindi/src/../lib/ndi/libndi.so: undefined reference to avahi_entry_group_free' /usr/bin/ld: /home/pi/raspindi/src/../lib/ndi/libndi.so: undefined reference to avahi_entry_group_add_service_strlst'
/usr/bin/ld: /home/pi/raspindi/src/../lib/ndi/libndi.so: undefined reference to avahi_service_resolver_new' /usr/bin/ld: /home/pi/raspindi/src/../lib/ndi/libndi.so: undefined reference to avahi_client_errno'
/usr/bin/ld: /home/pi/raspindi/src/../lib/ndi/libndi.so: undefined reference to `avahi_service_browser_free'
collect2: error: ld returned 1 exit status
make[2]: *** [src/CMakeFiles/raspindi.dir/build.make:104: src/raspindi] Error 1
make[1]: *** [CMakeFiles/Makefile2:142: src/CMakeFiles/raspindi.dir/all] Error 2
make: *** [Makefile:103: all] Error 2

Add Custom AWB Gain

Is your feature request related to a problem? Please describe.
After successfully maintaining a stable stream on a pi4 w/HQ camera combo I started testing pi3B+ w/different camera modules I had on hand. Eventually I tested with a Lintest HD-1 hat and found that I could get a stable and performative stream but colors were unusable as in raspivid the HD-1 uses awb off, red Gain set to 1.0, and blue Gain set to 1.0, but gain control is not exposed in this project.

Describe the solution you'd like
MMAL_PARAMETER_CUSTOM_AWB_GAINS available (preferably modifiable with the config file)

Describe alternatives you've considered
I'm still trying to figure this out myself but I'm not having much luck, so the only other alternative I have is that I am going to explore some other HDMI -> CS-2 modules as well but that's more avoid the problem then an alternative solution.

USB Webcam Support

Since this project has moved to use libcamera, could you please enable support for external USB webcams?
Support for using webcams via UVC and/or V4L2 would be a big plus.

Thanks!

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.