Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Building from source

Rekkefly is one Rust crate, rekkefly, with a library and a binary.

Requirements

Install Rust (stable; the crate uses the 2024 edition), then:

SystemAlso install
Ubuntu / DebianThe packages below
macOSXcode command-line tools (xcode-select --install); on Intel Macs also NASM (brew install nasm)
WindowsVisual Studio Build Tools (MSVC) and NASM on PATH
sudo apt-get install build-essential pkg-config nasm libclang-dev libv4l-dev libx11-dev libxi-dev \
  libxrandr-dev libxcursor-dev libxkbcommon-dev libxkbcommon-x11-0 libwayland-dev libegl1-mesa-dev

Build and run

git clone https://github.com/pvnkmrksk/rekkefly.git && cd rekkefly
cargo run --release -- samples/bogong-moth.avi --loop   # try it
cargo build --release --locked                          # target/release/rekkefly

Release builds are optimized; debug builds are fine for development (image codecs are optimized even in debug builds, so the tests on real video stay fast).

Features

FeatureDefaultAdds
guiOnThe desktop window (eframe/egui)
cameraOnNative camera capture (nokhwa; v4l on Linux)

Without both, Rekkefly is a processing-only program for servers and offline analysis: track, clip, mcp with videos and the simulated fly, headless runs and benchmarks.

cargo build --release --locked --no-default-features

Packages

scripts/package.py builds the installers from a release binary, as CI does:

python3 scripts/package.py --platform linux-x64 --binary target/release/rekkefly --out dist
PlatformProducesNeeds
linux-x64.deb, tarballdpkg-deb
macos-arm64, macos-x64.dmg and portable ZIPmacOS, pip install dmgbuild
windows-x64Installer .exe and portable ZIPNSIS (makensis)

The website

The website is built from site/ (the landing page: plain HTML, CSS and JavaScript) and book/ (this documentation, built with mdBook):

cargo install mdbook --locked --version 0.5.4
python3 scripts/build_site.py _site       # landing page + book + images, checked for broken links
python3 -m http.server -d _site 8000      # open http://localhost:8000/
mdbook serve book --open                  # only the book, rebuilt on every save

.github/workflows/pages.yml builds the same site on every pull request and deploys it from main.

Assets

Figures are generated, not drawn by hand. Regenerate them rather than editing images:

AssetCommand
Icon, banners, social card, DMG backgroundpython3 scripts/brand.py, then python3 scripts/icons.py (needs librsvg, ImageMagick, and the Inter and Noto Sans Kannada fonts)
Real-moth antenna chartREKKEFLY_MOTH_TRACE=moth.csv cargo test --release --test moth antenna_trace -- --ignored, then python3 scripts/moth_chart.py moth.csv docs/images/moth-antennae
Throughput chartcargo test --release --test moth throughput -- --ignored --nocapture, then python3 scripts/perf_chart.py docs/images/throughput <1> <2> <4> <8>
Synthetic L − R chartREKKEFLY_TRACE=trace.csv cargo test --release --test intrusions trace -- --ignored, then python3 scripts/trace_chart.py trace.csv docs/images/lr-trace
Detector figureREKKEFLY_FIGURE=docs/images/legs-classic-vs-robust.png cargo test --release --test intrusions figure -- --ignored
Website videos of the real moth, and their anglespython3 scripts/web_media.py (an ignored test draws the tracking on the raw frames; FFmpeg encodes them)
Screenshots, GIF and video of the windowUnder Xvfb, with --show plots --screenshot PNG --screenshot-after SECONDS and ffmpeg -f x11grab