/firefly_luciferin

Very fast Java screen capture PC software designed for the Glow Worm Luciferin firmware, the combination of these software create the perfect Bias Lighting and Ambient Light system for PC.

Primary LanguageJavaGNU General Public License v3.0GPL-3.0

Firefly Luciferin

Luciferin is a generic term for the light-emitting compound found in organisms that generate bioluminescence like Fireflies and Glow Worms. Firefly Luciferin is a Java Fast Screen Capture PC software designed for the
Glow Worm Luciferin firmware,
the combination of these software create the perfect Bias Lighting and Ambient Light system for PC.
Written in Java with a native flavour for Windows and Linux.

Java CI with Maven GitHub version License: GPL v3 Maintenance DPsoftware Discord

If you like Firefly Luciferin, give it a star, or fork it and contribute!

GitHub stars GitHub forks PayPal

Quick start

You can build the software from the source or if you prefer you can download the installer from here.
Firefly Luciferin uses Java 14 to create the native installer, this means that you don't have to install Java or other libraries separately.

This software can run on any Desktop PC using Windows or Linux. MacOS support will be added later. To get the full Bias Lighting experience you need a microcontroller (ex. ESP8266, ESP32) running Glow Worm Luciferin firmware. You can connect the microcontroller to the PC via USB or via wirelss using an MQTT server.

Why don't you build your own Luciferin?
Here's a Quick Start guide

Glow Worm Luciferin + Firefly Luciferin (click to watch it on YouTube)

Luciferin YouTube Video #1

Configuration

As soon as you start the software it creates a FireflyLuciferin.yaml file in your documents folder, you can configure it manually or via the user interface. If you don't know how to configure it, just use the default settings.

IMAGE ALT TEXT HERE

---
numberOfCPUThreads: 3     // more threads more performance but more CPU usage
captureMethod: "DDUPL"    // WinAPI and DDUPL enables GPU Hardware Acceleration, CPU uses CPU brute force only
serialPort: "AUTO"        // use "AUTO" to autodetect Serial Port, "COM7" for COM7 
dataRate: 500000          // faster data rate helps when using more LEDs or higher framerate
timeout: 2000             // timeout in serial port detection
screenResX: 3840          // screen resolution width
screenResY: 2160          // screen resolution height
osScaling: 150            // OS scaling feature
gamma: 2.2                // gamma correction for the LED strip
mqttServer: "OPTIONAL"    // MQTT Server protocol://host:port (E.g. "tcp://192.168.1.3:1883")
mqttTopic: "OPTIONAL"     // MQTT Server Topic used to start/stop screen capture on the microcontroller
mqttUsername: "OPTIONAL"  // MQTT Server username
mqttPwd: "OPTIONAL"       // MQTT Server pwd
ledMatrix:                // Auto generated LED Matrix
  Letterbox:
    1:
      x: 2596
      y: 1590
    2:
      x: 2694
      y: 1590
  ...

What is the Performance Impact on your System?

Firefly Luciferin is a very optimized software and it has nearly no impact on your system performance.
By default Firefly Luciferin captures at 30FPS, if you want you can unlock the framerate.

If you are using a slow microcontroller, capturing at a very high framerate will not help. If you right click the tray icon and then click FPS, you can see the output as shown in the image below. In that output you can see how fast the software is capturing the screen (producing) and how fast your microcontroller is able to process (consume) this data.

Producer framerate should not exceed the consuming one, all data that is not consumed in time, is lost.

GPU Hardware Acceleration using Java Native Access

Screen capturing is pretty slow and very CPU intensive in Windows systems (Linux is much more efficient in this regard), for this reason I wrapped the Windows GDI32 C class using Java Native Access to access Windows hardware acceleration.

This API captures and delivers captured frames in GPU memory.

If you are running Windows 8 or Windows 10 you can use Desktop Duplication API (DDUPL), it's the fastest implementation yet, no lag, no stutter, very small usage of resources. DDUPL is accessed via JNA using the GStreamer bindings for Java.

Contribute

You can contribute to Luciferin by:

  • Providing Pull Requests (Features, Proof of Concepts, Language files or Fixes)
  • Testing new released features and report issues
  • Contributing missing documentation for features and devices
  • With a donation PayPal

Credits

  • Davide Perini

Thanks To

Thanks For
For the IntelliJ IDEA licenses.