Skip to content

patagonaa/pixelflut-server-dotnet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

87 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pixelflut-server-dotnet

This is a Pixelflut server (see here or here for details) written in C# taking advantage of the relatively new performance-focused C# 7.2 feature Span<T> to reduce memory allocations during handling of Pixelflut traffic. On my system (i7-7820HQ, 32GB DDR4-2400) it is able to handle about 1 GBit/s per connection/thread (4-5 GBit/s total).

Features

  • Supported commands:
    • SIZE to get the current canvas size
    • PX X Y RRGGBB / PX X Y RRGGBBAA to set the color for the pixel at the given position
    • PX X Y to retrieve the pixel color at the given position
    • OFFSET X Y to set an offset to apply to pixels sent in the future
    • HELP to get a short help text about pixelflut
  • simple output viewing via MJPEG (supported on all major browsers)
  • optional NDI output
  • Prometheus metrics (pixels sent/received, bytes received, current number of Pixelflut and HTTP connections, etc.)

Usage

If you're using Docker, docker-compose up --build -d should get you up and running in a few seconds.

If you don't want to use Docker, you can either run this on Windows using Visual Studio or on Windows/Linux/macOS using .NET SDK. Settings can also be set via environment variables.

Installation on Ubuntu (e.g. 22.04):

sudo apt update && sudo apt install dotnet-sdk-6.0

Don't forget to turn off the standby timeout in the energy saving options!

NDI (hacky):

wget https://downloads.ndi.tv/SDK/NDI_SDK_Linux/Install_NDI_SDK_v6_Linux.tar.gz
tar -xzf Install_NDI_SDK_v6_Linux.tar.gz
./Install_NDI_SDK_v6_Linux.sh
cp 'NDI SDK for Linux/lib/x86_64-linux-gnu/libndi.so.6.0.0' '/lib/Processing.NDI.Lib.x64.dll'

Startup

Options

  • Width=1280
  • Height=720
  • EnableNdi=true
  • AdditionalText='Hello World!'

see PixelFlutServerConfig.cs for more

Example

Example startup with HTTP port 8080, Pixelflut port 1234:

cd PixelFlutServer/PixelFlutServer.Mjpeg
MjpegPort=8080 PixelFlutPort=1234 dotnet run -c Release