#pixelflut #image #pixel #animation #client #command #real-time

bin+lib pixelbomber

Insanely fast pixelflut client for images and animations

22 releases (8 breaking)

0.9.0 Jun 13, 2024
0.7.0 Jun 4, 2024
0.6.0 Jan 21, 2024
0.5.6 Dec 30, 2023
0.4.1 Jun 21, 2023

#1494 in Command line utilities

Download history 31/week @ 2024-08-03 10/week @ 2024-08-10 4/week @ 2024-08-31 21/week @ 2024-09-21 2/week @ 2024-09-28

1,324 downloads per month
Used in breakwater-parser

GPL-3.0 license

41KB
954 lines

Pixelbomber

A program to nuke pixelflut servers

This client is largely inspired by pixelpwnr, although I made heavy modifications to decrease the bottlenecks.

Installation

Either using cargo:

cargo install pixelbomber

or by cloning and then building:

git clone https://github.com/fabi321/pixelbomber.git
cd pixelbomber
cargo build --release

Features

  • Concurrent writing pipes
  • Animated images with consecutive images
  • Control over render sizes and offsett
  • Faster than pixelpwnr (in my case by more than a Factor of 8)
  • Linux, Windows and MacOS
  • Same cli as pixelpwnr
  • Support for both gray pixel command as well as offset command, enable with --offset and --gray
  • Support for automated feature and size detection, on by default
  • Support for binary pixel commands in the PBxyrgba format (x and y are u16 le encoded)
  • Support for input streams
  • Fast image to pixel commands encoder

Get images from stream

By using - as sole image file path, you can pipe in images from stdin. Pixelbomber expects bitmap files as input. You can specify, how many images can be processed in parallel with the --workers flag.

Example using ffmpeg

ffmpeg -re -i <video_file> -f image2pipe -c:v bmp - | cargo run --release -- <host> -

Some ffmpeg tips:

  • use -re if the input is a video file. This forces ffmpeg to play it at most at realtime
  • use -stream_loop -1 before -i to repeat a video indefinitely

Tradeoff

If you want to only loop a static video, specifying the video frames as images is faster, as it only encodes them once.

Get images from video

By only supplying one file, and using the --video flag, pixelbomber can read all frames from that video as images. This will result in pixelbomber precompiling all images into commands, and fluting them afterward. WARNING: This may consume large amounts of RAM (~50GB for 1min FullHD 30fps video). Pixelbombewr will stop encoding new frames if the free system memory drops below 1GB. The number of frames processed in parallel is configured via the --workers flag.

Comparison with stream method

Compared to reading from stdin, this method uses less cpu while fluting and doesn't drop any frames. It does use large amounts of RAM though.

Dependencies

~5–28MB
~427K SLoC