skip to Main Content

Dicaffeine: Using a Raspberry Pi 4 to Display an NDI Stream

The past couple of years I made a lot of use of an NDI-based video-over-IP strategy in producing the live stream and archival sessions for Cluecon in 2018 & 2019. One of the things involved in that production was displaying an NDI stream, produced in vMix, to a pair of local projectors.

Given budget constraints, I opted to use a pair of SFF Windows PCs running Newtek’s NDI Studio Monitor. I selected some used Lenovo M73 Tiny, which cost me about $200 each on Ebay. With an i5-4570 CPU and Intel HD Graphics 4600, they did the job well enough, each delivering 1080p30 to its associated projector without issue.

Lenovo M73 Tiny

Given additional budget, I’d have opted for BirdDog Mini NDI adapters over the little PC’s. These little FPGA-based devices can be set to decode or encode. Also, they can be powered over Ethernet, giving added flexibility, but at a cost of $500 each.

At the time, there was no way to decode NDI on an device with an ARM CPU, like the Raspberry Pi. That has recently changed. Dicaffeine is a new NDI player for Raspberry Pi. The basic version is free and I’ve been tinkering with it for a couple of weeks.

Dicaffeine is a side project of Jiří Melnikov, who previously created the LINDI NDI player for the Intel NUC. NUCs run Intel CPUs, so that was possible using the NDI SDK from Newtek.

Sienna has also been promising an NDI player for ARM devices. Their NDI Monitor for Ubuntu (Intel only) established that an N3450 CPU was required to reliably deliver 1080p30. An N4100 to reliably deliver 1080p60.

A Raspberry Pi has hardware for decoding H.264 on-board. This is how they get used in home theater applications, as playback stations for Kodi and the like. That hardware does nothing to help with decoding an NDI stream. That task must be done on the CPU.

I’ve been experimenting with Dicaffeine on a Raspberry Pi4 with 4GB of memory. I thought it might be useful in a lesser role, possibly digital signage, at Cluecon 2020. Alas, that event was recently cancelled.

Installation

My Pi4 is in an Argon NEO case which acts as a heatsink. This is important. The quad-core CPU in the Pi4 runs warm all on its own. Very warm under load. In fact, during a 24 hour endurance test playing a 720p30 NDI stream, my Pi4 reports a CPU temperature of 70C.

PI4 Argon NEO case

Setup

Installation is just as described on the Dicaffeine web site. Being a Linux newby, I had a little trouble initially, but it was my own. Once installed, there’s a Dicaffeine icon on the desktop that launches the application. It’s also remotely available as web service.

Just log into the web page. There you find controls to select an NDI source from the network and Play. It’s all pretty intuitive.

Pi4-Dicaffeine-SelectSource

Performance

Jiří Melnikov tells me that the current release of Dicaffeine plays 720p25 reliably. It should also play 720p30, but to expect dropped frames when playing any kind of 1080p stream.

In my initial experiments I used one of my Grandstream surveillance cameras as a source, passing it through VLC with the NDI plugin to turn the RTMP stream into NDI.

The scene the camera presents is somewhat static, but does see a lot of leaves. When the leaves move in a breeze it makes for enough motion that it’s an interesting test of an I-frame codec like NDI.

I initially failed to notice that our cameras were set for 1080p15! So, the little Pi4 + Dicaffeine initially did better than I had expected. With Raspian desktop set for 720p30 Dicaffeine used a tiny amount of memory and about 50% of CPU.

The 1080p15 stream is actually a lighter load than 720p30. Adjusting the camera to provide 720p30 increased the load on the Pi, which then reported 55-60% of CPU to handle the 79 Mb/s stream.

Pi4-Dicaffeine-720p30

Thanks to Andy Smith and Corrado Mella for helping my overcome my fumbles with the bash command line and suggesting Bashtop (pictured above) as a way to monitor the state of the Pi.

The stream from the surveillance camera was convenient, but not a good way to look for dropped frames. So I setup a second, more elaborate test to share with you  dear reader.

I thought it’d be nice to compare the output of Dicaffeine against the original source NDI stream, all the while monitoring the state of the Pi4. This a little tricky. Here’s the test arrangement.

I used two separate instances of vMix; one to play the reference clip and a second to gather all the results. This gave me the freedom to play the reference clip at 720p30 or 1080p30, while collecting the results into a 4K30 aggregate recording. So the quality of the individual sources is not degraded (down-rez’d) even in the quad-split presentation.

The layout

  • Upper left = original SMTP test clip, sourced from Youtube, played in vMix.
  • Upper right = Output of the RPi4, captured into a BirdDog Mini.
  • Lower left = SSH session into RPi4 running Bashtop to monitor the status of the Pi.
  • Lower right = Chrome on Mac Mini showing Dicaffeine web GUI.

Experiment #1: 720p30

At first you see the Pi desktop. Then see as I used the Dicaffeine web UI to select the NDI source and invoke play.

During this test the Pi4 CPU utilization hovered around 50%. The player was more or less well-behaved presented a 720p30 stream at around 60 Mbps. It may have dropped the occasional frame. Latency seemed consistent. It did not seem to fall further behind the source.

I left this test running for 24 hours to see how stable it would be. In part, I wanted to see how hot the Pi4 got and whether it would be a problem. The Pi4 reached 71C worst case. A bit of hunting online revealed that the Pi4 is expected to be stable up to 80C, thereafter CPU throttling would set in.

Experiment #2: 1080p30

I repeated the same test, this time setting the upstream vMix instance to send a 1080p30 stream. During this test the Pi4 CPU utilization leapt to around 80%. Playback lagged the source substantially, indicating that the player was struggling to keep up. The 1080p30 stream was around 95 Mbps.

Dicaffeine is an interesting and potentially useful NDI player. Running on Raspberry Pi4 it does decent job playing 720p30. It doesn’t really handle anything beyond that.

While some might find this limiting, it could still be handy. In some digital signage applications the frame rate can be dropped to accommodate higher spatial resolution. Using NDI delivers high-quality and low-latency. Leveraging Raspberry Pi4 helps keep cost per point-of-display down.

Back To Top
%d bloggers like this: