Skip to content

Open source ambilight implementation for Windows 10 (Media Foundation) and for Linux: x86 and Rpi (v4l2 grabber). Includes support for HDR correction for captured image and multi-threading for better performance.

License

Notifications You must be signed in to change notification settings

appleimperio/HyperHDR

 
 

Repository files navigation

About

Ambilight software system with some performance tweaks especially for MJPEG/YUV grabbers with support for HDR/BT2020 using LUT tables.
Single and multi-threaded optimization (Windows PC and RPi 2/3/4) for SDR/HDR streams captured by USB grabbers. Now even Rpi 3 can handle 1080p60 MJPEG stream.
Direct support for the devices under Windows 10 using Media Foundation.

Download packages & sources

https://github.com/awawa-dev/HyperHDR/releases

Default LUT table is already included (in the installers) but you can generate your own or import 3dl Autodesk lut table.
You can use prepared SD card images: manual
Default hostname for SD images is HyperHDR so connect to http://hyperhdr:8090/
SSH and SPI are enabled on default.

Support and contact

https://hyperhdr.blogspot.com/


Guide for building your own ambilight system:

Step 1: Addressable led strip
Step 2: Power supply
Step 3: USB grabber
Step 4: Additional stuff
Step 5: Device for hosting HyperHDR...Windows PC or Raspberry Pi?
Step 6: Installing HyperHDR ambilight software

Build-log from my SK6812 RGBW system and one thing about calibration

Main features of this fork:

  • Really low CPU usage on SoCs like Raspberry Pi using v4l2 grabbers
  • support for multithreading
  • HDR/BT2020 color & gamma correction
  • support for USB grabbers under Windows 10
  • support for WS8212b/WS8213 RGB & SK6812RGBW ultrafast USB serial port AWA protocol for ESP8266 at 2000000 baud with data integrity check and white channel calibration: HyperSerialEsp8266. WLED fork is also available: HyperSerialWLED

Changelog:

  • Overall performance without tone mapping for USB grabbers improved x10 (MJPEG) and x3 (YUV) over Hyperion NG 2.0.0.8A thanks to optimization & using of multi-threading
  • Direct support for USB grabbers under Windows 10 using Microsoft Media Foundation (really fast & of course multi-threaded)
  • Support for WS8212b/WS8213 RGB & SK6812 RGBW ultrafast USB serial port AWA protocol for ESP8266 at 2 000 000 baud with data integrity check: HyperSerialEsp8266
  • Fork of WLED with the support for USB serial port AWA protocol at 2 000 000 baud: HyperSerialWLED
  • Support for I420, NV12 and XRGB encoding
  • Hardware brightness, contrast, saturation, hue control for USB grabbers (both Windows and Linux)
  • Philips Hue driver (inc. Entertainment API) partially rewritten and working. Customized new options for powering on/off the lamps.
  • New option to choose video encoding format (for multi format grabbers for ex. Ezcap 269, MS2109 clones)
  • Add configurable Signal Threshold Counter option for signal detection
  • MJPEG & YUV HDR LUT tone mapping
  • New advanced LED mean color algorithm in image->LED mapping
  • New weighted advanced LED mean color algorithm in image->LED mapping
  • Improved backlight algorithm to minimize leds flickering on the dark scenes (smoothing is still recommended)
  • Add old style color calibration (from Hyperion classic) using luminance, saturation et.
  • Build for newer Raspbian Buster. It's a complete migration from older Raspbian Stretch.
  • Option for hyperion-remote, JSON API and web GUI remote to turn on/off HDR tone mapping
  • Option for luminescence & saturation for hyperion-remote
  • Ready to write SD images of HyperHDR
  • Fix for SK9822 leds on SPI (aka fake APA102)
  • Required libglvnd library dependency included for tar container
  • Improved YUV decoding using LUT tables for speed up
  • Windows installer contains default LUT table
  • Installers for DEB & RPM now include LUT table

FAQ:

You don't need to use HDR source for usage of HyperHDR. You can just benefit from significant higher performance for captured video stream from USB grabber over Hyperion NG, capability of using multithreading to avoid bottleneck resources, support for modern USB grabbers under Windows 10, improved image to led colors averaging new algorihtms, few tweaks that minimize blinking at the dark scenes and hardware support to tune up brightness, contrast, saturation and hue for a grabber.

The default settings in the LED color calibration are made for my setup, currently WS2801 ;) It's recommended for you to create your own.

Try to play with grabber's hardware brightness and contrast as experimentents proved they can change even with some selected resolutions and FPS. And there are some different default values for brightness and contrast for Linux and Windows. Nothing is constant if you don't force specific value. For Ezcap 269 grabber I set brightness to 139 and preferable resolution is 1280x720 YUV.

With HyperHDR you can see a jump of CPU usage in case of MJPEG encoding grabber to over 200-300% for 1080p format for Rpi 2/3/4. It's OK as MJPEG decoding is quite challenging. What is more important each core will be loaded at 50-60% only as you will go for full frame rate (1080p 30 or 60fps). With a single thread in Hyperion NG CPU usage will be around 100%, but it means that the framerate will be greatly reduced and components will be fight for resources.

Use linux 'top' command with per core view (press 1) or preferable 'htop'. On Rpi 2/3/4 max limit is 400% (4 cores per 100%).

Check the performance statistics that are updated every minute in System->Log page.

Use YUV encoding format if it's possible. It provides better quality and lower CPU usage.


Before and after on some HDR/BT2020 content that was broken by the video grabber:



Direct support for USB grabbers under Windows 10:



USB grabber configuration:



Ultrafast USB serial port AWA protocol for ESP8266 at 2 000 000 baud:

License

The source is released under MIT-License (see http://opensource.org/licenses/MIT).
GitHub license

About

Open source ambilight implementation for Windows 10 (Media Foundation) and for Linux: x86 and Rpi (v4l2 grabber). Includes support for HDR correction for captured image and multi-threading for better performance.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 51.6%
  • JavaScript 18.7%
  • HTML 8.2%
  • C 7.5%
  • CSS 6.9%
  • CMake 4.1%
  • Other 3.0%