Log in

View Full Version : SUPer - HDMV PGS (BD SUP) subtitle encoder that supports animations


cubicibo
21st April 2022, 13:40
SUPer is a Python tool to convert BDNXML to Blu-ray SUP ("HDMV PGS") subtitles. SUPer is designed to make full use of the PGS capabilities and to produce compliant bytestreams that drive correctly the Blu-ray PGS decoder. SUPer notably has the capability to encode animations within a bitmap to use efficiently palette updates to make animations like colour effects, karaoke, fades and wipes. Finally, unlike Scenarist or avs2bdnxml, SUPer is not subject to buffer overflows as it drives the hardware PG decoder as intended by the designers.

Features
Users that only want to convert BDNXML can simply use the stand-alone app. The app lets you convert PNG+BDNXML assets to a SUP file or PES+MUI assets for Scenarist BD. An origin SUP file may also be provided optionally to perform merging to a new file.

For developers, SUPer also acts as a Python library to parse SUP files or generate them from code. It offers many module to perform image analysis, processing and PG bytestream handling.

Example
This example (https://0x0.st/HPtp.sup) showcase the capabilities of SUPer. This file function on Blu-Ray players without any flickering or adverse effect. You can enjoy the full experience by playing it back with Nichijō second opening.

Pyton package with GUI app
https://github.com/cubicibo/SUPer

Download stand-alone executable (macOS aarch64, win x64)
https://github.com/cubicibo/SUPer/releases

For users that uses the Python3 package (Python3.9+), you need to install it to your virtual environment before running supergui.py or import the package.

Create a Python3 virtual environment, cd in the SUPer base folder then do:
python3 -m pip install .
Then, to execute the GUI to convert BDNXML to SUP:
python3 supergui.py
and everything will work nicely :cool:
https://i.imgur.com/ubNt0lB.png

cubicibo
22nd April 2022, 23:58
SUPer version 0.0.1a
Changelog

I fixed some bugs in the code, you can now export very large objects. I had made an example that defines a total of 10 ODS segments in the first two displayset of the epoch (for two full screen 1920x1080 overlays).

cubicibo
8th October 2022, 16:14
SUPer 0.1.0 is out!
There is now a user-friendly interface (a Python GUI) akin to PunkGraphicStream.

Changelog

SUPer version 0.1.0.
Front-end
• Graphical interface to generate a .SUP file from a BDNXML with the possibility to inject data in an existing SUP.
• Changed some of the API for rendering and optimising
• Simplified the example file.

SUPer back-end
• SUPer now supports multi-object rendering!
• Added a graphics grouping engine, that associate objects and minimizes windows area footprint before rendering.
• Added a pre-rendering module to avoid image shape mismatch issues (a pain in 0.0.1)
• Bugfixed rendering engine (bad color merging, now disabled).
• Filestreams had a vast overhaul to properly parse BDNXML.
• Revisited the segments module.
• Use precise FPS values
• Added a PGS stream compliancy validator using all possible bitrate and buffer limits described in the original patent.

cubicibo
15th October 2022, 10:00
SUPer 0.1.1 is out and it is all about bugfixes.

Changelog

SUPer version 0.1.1 (back-end changes only)
• Attempt to split single composition object in two to improve animation quality when two animations partially overlap in time.
• Fixed palette bounding when composition object #0 was appearing on screen (displayed bad colors for a single displayset)
• Fixed value overflows for ODS.
• Fixed bad palette ID/version number values.
• Fixed memory leak.
• Fixed an offset of one pixel (?)
• Added one more sanity check in SUP compliancy function.


Next step is to replace the default image quantizer which is rather limited Pillow by something else and multiprocessing for those who can't wait.

cubicibo
5th November 2022, 23:16
SUPer 0.1.2

GUI front-end
• Anchor the buttons in the GUI.
• Add a check box for content that requires fine grouping (must be used for SD content).
• Add a check box to change the grouping decision when just two objects are overlapping (can fix or break some animations).
• Add a check box to correct drop-frame time drift (divide timestamps by 1.001).
• Add a check box for subsampled BDNXML (e.g 30 fps BDNXML for 60 fps SUP).
• Add a check box to adaptively switch between PIL and K-Means image quantize methods.

Back-end
• Add graphic plane bandwith/refresh compliancy test to detect flickering subtitles.
• Extend DisplaySet and Epoch classes, fix a bug in TimeConv.
• Fix a crash with single composition objects.
• Fix a temporal object-window matching issue (Hopefully? Can be fixed by ticking grouping decision checkbox)
• Fix composition object instantiation with cropping flag.


Notes:
• K-Means quantization is useful to work around a bug in PIL library. PIL is unable to quantize images with high transparency and can change the background to be full black. This breaks some fades.
• K-Means quantization is noisy, unlike PIL. If you have karaoke aside of it, it can (but not necessarily) damage the non-fade animations.

_________________
Some documentations for the few curious readers:

What's the max refresh rate?
- When the screen is re-drawn within an epoch (acquisition or a normal case), objects are copied to the hidden graphic plane.
- On the presentation timestamp, the playback device swaps the two graphic planes (visible<->hidden).
- If the update rate is too high, the graphic planes are not hidden sufficiently long to copy the data.
- This leads to flickering.

The allocated area for a frequently refreshed graphic must follow this rule:
window_area < (k/fps)*16*(1024^2)
With:
- k: the update rate (1 if updated every frame, 2 if every other, and so on)
- fps: the video framerate
- window_area: area of the window on the graphic plane (object area is always equal or smaller to the window area).

For Full HD content (1920x1080), the area in which we can update the rendering once per frame must not be more than 25% of the screen at 29.97 fps, or 31% at 23.976. For high framerate content (50i, 59.94i), the usable area decreases considerably. If the objects are additionnaly refreshed, the decoding time adds up to the rest.
To work around this, SUPer lets you flag subsampled BDNXML (BDNXML generated at @25-29.97 fps, 1/2 of the true framerate). SUPer will flag the output .SUP as twice the framerate.

________
Example file (https://0x0.st/oEZy.sup), generated with the latest version of SUPer and tested on a commercial Blu-Ray playback device. Karaoke courtesy of kara.moe.

tormento
6th November 2022, 18:31
When installing, I get the following error:
copying skimage\io\_plugins\_histograms.pyx -> build\lib.win-amd64-3.11\skimage\io\_plugins
running build_ext
INFO: No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
INFO: customize MSVCCompiler
INFO: customize MSVCCompiler using ConditionalOpenMP
INFO: CCompilerOpt.cc_test_flags[1073] : testing flags (/O2)
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
INFO: CCompilerOpt.cache_flush[857] : write cache to path -> C:\Users\AlbertoGennari\AppData\Local\Temp\pip-install-1vmru19u\scikit-image_965be48bfc2f42c0badcd913f2431977\build\temp.win-amd64-3.11\Release\ccompiler_opt_cache_ext.py
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for scikit-image
Failed to build scikit-image
ERROR: Could not build wheels for scikit-image, which is required to install pyproject.toml-based projects
I won't install VisualC++ for sure. Any workaround?

cubicibo
6th November 2022, 19:05
If you're on Windows, just get WSL. It will endlessly simplify your life.

For what you're trying to do, you can remove the scikit/sklearn entries in requirements.txt. As long as you then don't use the render module, you will be fine.

tormento
8th November 2022, 10:42
Unfortunately I need the render module.

cubicibo
8th November 2022, 13:48
The script I wrote for you (https://textup.fr/657189b5) (updated) to split the PGS in two does not use the "render.py" module at all. I know the name may sound confusing but render.py is used to render a chain of BDN.XML events to a single SUP epoch and that is not what the script does. It only decodes/re-encodes RLE bitmaps and generates new PGS segments. None of this is "rendering".

If you need to use SUPer for other purpose, like exporting a BDNXML to SUP, you will need to install VC++ or WSL. I am not dropping skimage module as it provided an essential backbone to the grouping algorithm.

tormento
8th November 2022, 18:36
For what you're trying to do, you can remove the scikit/sklearn entries in requirements.txt.
I usually grab packages by PIP. How to tell the installation process to use a requirements.txt of mine?

cubicibo
8th November 2022, 20:06
Download the package from the release page (https://github.com/cubicibo/SUPer/releases/tag/0.1.2) (or clone the repository itself). Unzip it, edit requirements.txt to your need and execute:
python3 -m pip install C:/path/to/SUPer
Where SUPer is the folder that contains setup.py.

If the command does not work for some reason, change directory to the SUPer folder then run:
python3 -m pip install -e .
And that will install the package in dev mode, it always works.

cubicibo
15th November 2022, 23:09
SUPer 0.1.3

User interface
• Add colorspace dropdown menu (select BT.601 or BT.709).
• Updated the log message format.

Back-end
• Fix some grouping issues related to temporal overlapping with single objects within an epoch.
• Add rendering "interface" class for scripting.
• Add ODS visualisation utility to analyze an encoded animation within the bitmap.
• Compute adaptively the maximum delay required for a new epoch with respect to BDN dimensions (for coarse epoch definition)

cubicibo
1st May 2023, 15:08
SUPer v0.1.5 (https://github.com/cubicibo/SUPer/releases/tag/v0.1.5)

User interface
• None, it is all under the hood.

Back-end
• Implement a brand new grouping engine to define windows.
• Implement a brand new conversion pipeline using some image processing to define objects and find refreshs.
• Optimise the code and algorithms, add numba support. Up to 10x faster on some costly functions.
• Add code to perform palette updates with two objects.
• Update TimeConv internals to have accurate SMPTE timings.
• Drop some dead code.
• Fix many small issues

Here's an example SUP file (https://0x0.st/HPtp.sup) made with the new engine and tested on a BD play-back device.

cubicibo
5th May 2023, 22:59
SUPer v0.1.6 (https://github.com/cubicibo/SUPer/releases/tag/v0.1.6)

SUPer is now distributed as stand-alone binaries too! Only an Apple M1 (aarch64) build is available presently, Windows may follow later.

Front-end
• Add option to use K-Means quantization on all frames (guarantees quality but slow)
• Add option to fix a possible time drift with NTSC framerates (23.976, 29.97)
• Add compatibility mode option for software players that do not decode palette update display sets correctly.
• Add a progress bar while generating an epoch bytestream.

Back-end
• Revisit again the grouping engine to make it faster and more robust.
• Fix a memory leak in the conversion pipeline.
• Some clean-ups.

cubicibo
20th May 2023, 10:34
SUPer v0.1.7 (https://github.com/cubicibo/SUPer/releases/tag/v0.1.7)

Windows-x64 and macos-aarch64 stand-alone apps are provided.

Front-end
• Add Scenarist BD output format PES+MUI (Output dialog box -> select .PES format at the bottom)
• Add option to enforce DTS timestamps in stream. This should NOT be used unless your muxing software is terrible.
• Add more tooltips on the checkboxes

Back-end
• Fix timecode conversions and rounding errors, SUPer should now be frame accurate.
• Use adaptive structual similarity threshold to account for possible large transparent areas.
• Fix a crash due to blinking bitmaps.
• Filter out empty bitmaps generated for blinking subtitles - saves bandwidth.
• Avoid acquisitions to undisplay one object when two are on screen - saves bandwidth.

Known issue
• A runtime warning is sometime displayed by numpy about empty slice. This is not a bug and has no effect whatsoever on the output.
• Windows binary may show a pyopencl warning when the app or optimiser process start. This can be ignored.

Here's an example with .ASS animations (https://0x0.st/HqsZ.sup) generated with v0.1.7 and tested on a BD player.

cubicibo
2nd August 2023, 16:45
SUPer v0.1.8 (https://github.com/cubicibo/SUPer/releases/tag/v0.1.8)

Gigantic update. SUPer now generates compliant PG stream by default, including exact DTS values to ensure compatibility with old PG decoders (e.g. PS3).
The update notably adds double buffering, ahead of time displayset decoding and normal case redefinition for smooth animations, even with complex and large objects.

Credits to Masstock for the many tips, testing and feedback that made this update as complete as it is!

Front-end
• Add a command line client (guizero can be removed from requirements.txt if you prefer to use the cli over the gui)
• Add an option to further tune acquisition rate (for compression when animations are used).
• Update existing tooltips and add more.
• Compatibility mode tickbox now disables cropping.
• DTS checkbox is automatically ticked and cannot be unticked for PES+MUI output.
• Auto-add SUP extension on GUI if none provided.
• Fix a rare bug where the GUI kept using the first selected BDNXML file.

Back-end:
Rendering:
• Optimise composition objects together to better distribute the palette entries.
• Use palette update to undisplay graphics in the middle of a palette animation.
• Implement double buffering to decouple decoding and rendering to let hardware decoders perform multitasking! (*)
• Implement NORMAL CASE object redefinition, used if worthwile.
• Implement palette updates buffering to perform screen updates while long object decoding is in progress.
• Implement events dropping to ensure necessary object definitions are feasible and stream is strictly compliant. (**)
• Reduce memory usage and fix numerous small issues.
PG bytestream:
• Re-implement PTS and DTS computation to be identical to Scenarist BD.
• Fix a bug that caused the penultimate display set of an epoch to refresh the object.
• Prevent the usage of the palette entry ID 255, apparently it should not be used.
• Cycle through palettes ID when palette version overflows to increase compatibility.
• Remove the work-around for palette updates with two objects.
• Add auto-cropping of objects to minimize transfer time on hardware decoders.
Parsing:
• Escape BDNXML files to avoid a crash on badly encoded data.
• Filter out zero duration events in BDNXML (events where InTC == OutTC).

Notes:
(*) Hardware decoders are designed to perform decoding and rendering at the same time. It is possible to continuously decode incoming display sets as long as the decoder does not write to the memory region that the renderer is reading! This is alleviated by performing double buffering and using the numerous palettes.
(**) the dropped event is generally one or two frames long at 23.976-29.97 fps and should go unnoticed.


Windows x86_64 and macOS aarch64 binaries are available on the release page. Reminder that SUPer works best with ass2bdnxml (http://forum.doom9.org/showthread.php?p=1987394).

cubicibo
5th August 2023, 18:00
SUPer v0.1.9 (https://github.com/cubicibo/SUPer/releases/tag/v0.1.9)

This version addresses the issues faced by files generated by SUPer imported in Scenarist BD. Many thanks to Masstock further testing.

Front-end
• Add a checkbox to force SUPer to always write the entire palette rather than just the difference. Enforced for PES output.
• Add a stricter mode to further constrain the PG stream and ensure it passes all Scenarist BD checks without warnings or undesirable modifications. Enforced for PES output.
• Add a checkbox to output PES and SUP together. Handy for validation of the output on a video player of the authored file.

Back-end
• Fix a grouping engine regression. It could get stuck in a loop.
• Fix timestamps, PTS and DTS should be always identical to Scenarist BD now.
• Filter out empty palette updates.
• Fix a missing palette assignment on screen wipes preceeding an acquisition point.

Dependencies
• Updated to ScenariStream v0.0.4 to have accurate negative PTS and DTS in PES+MUI.

Here are few samples PES+MUI and SUP (https://0x0.st/H_ih.7z) generated with SUPer so you can play around with software players and Scenarist BD. And here's one of such SUP imported in Scenarist BD. Pay attention to buffer usage and number of display sets (one epoch in this file has more than 1400) :cool:
https://i.imgur.com/3LNN4n3.jpg

cubicibo
18th September 2023, 17:00
SUPer v0.2.1 (https://github.com/cubicibo/SUPer/releases/tag/v0.2.1)

I exhausted all compliancy rules and checks known by us mere mortals. I now expect the output of SUPer to pass the BDA verification tests.

Front-end
• Add conservative PTS/DTS strategy checkbox/cli flag.
• Parse config.ini in command line client.
• Remove the event overlap checkbox ("additional Scenarist BD checks") as it is always enabled internally.

Back-end
• Rewrite and optimise RLE encoders and decoders.
• Rewrite events filter. Watch for the minimum delta between two PTS when filtering.
• Revisit PTS and DTS calculations, fix wrong WDS PTS, fix wrong DS decode duration with no ODS.
• Fix normal case object redefinition, it was prone to crashing.
• Estimate the number of colours necessary with PIL when encoding an animation via PILIQ.
• Prevent usage of colour 0x00 to avoid illegal RLE line lengths above bitmap width + 16.
• Add PTS/DTS test at the end to catch errors.
• Terminate all epochs with a palette update to clear the screen rather than a drawing operation.
• Additonally wipe the screen if there's enough time between two epochs.

Emulgator
18th September 2023, 18:27
Wow, big thanks cubicibo !

cubicibo
25th November 2023, 11:32
SUPer v0.2.2 (https://github.com/cubicibo/SUPer/releases/tag/v0.2.2)

Numerous small changes that improves greatly the conversion process and the quality of the output. There should be fewer dropped events starting v0.2.2.

Front-end
• Add option to perform acquisitions after N palette updates. This ensures the quality of stills that directly follow palette animations.
• Add a target bitrate test at stream output to help authorers anticipate excessive bitrate before a mux. (v0.2.1b)
• Add optional logging to file. (v0.2.1b)

Back-end
• Optimise buffer slots dimensions to the maximum area shown within each window. Fairly isolated moves will now be much more consistent.
• Replace windows definition algorithm with a new one that finds more optimised layouts.
• Perform BDN XML preprocessing to remove consecutive events with identical PNGs, rewrite event timeline on the fly accordingly.
• Allocate all transparent pixels to palette ID 0xFF, one palette ID saved in the general case, two in normal case object redefinitions.
• Append an acquisition after N palette updates to wipe any potential artifact due to animation encoding (option enabled by user)
• Avoid encoding dropped events to improve quality of preceding events in palette effect chains.
• Fix screen wipes in the middle of epochs that could have incorrect PTS/DTS.
• Add spatial consistency checks for windows and compositions.

cubicibo
1st January 2024, 15:27
SUPer v0.2.3 (https://github.com/cubicibo/SUPer/releases/tag/v0.2.3)

New year release stress-tested with a heavily typeset ASSA of Kareshi Kanojō no Jijō. There should be fewer dropped events!
The "Normal Case Object Redefinition" feature should be production ready, it helps reduce the number of dropped events. Scenarist BD users are advised to check the README if enabled.

Front-end
• Changed the default value of `--extra-acq` (`-e`) from 0 to 2.
• Add `--ssim-tol` to slightly tune the event filter decision making. This should not be used in most if any realistic scenario.
• Add progress bar to display the event analysis and filtering progress.
• Add "Abort" button (currently only on the compiled Windows exe).

Back-end
• Use edge structural similarity measure (eSSIM) to improve the event filter decision.
• Use active window area to adaptively position in time the additional acquisition after a chain of palette update.
• Add mechanism to shift object definitions and drawing in time to reduce the number of dropped acquisitions.
• Fix a crash whenever a normal case object redefinition event was promoted to an acquisition due to epoch start collision.
• Improve binary mask definition in event filter.
• Fix two crashs linked to the rendering of bitmaps (hotfixes made for v0.2.2a)

cubicibo
10th February 2024, 10:21
SUPer v0.2.4 (https://github.com/cubicibo/SUPer/releases)

Multithreaded PGS encoding! Companies are no longer allowed to use the "Blu-ray subtitles are too limited" excuse card :sly:

Front-end
• Add support for HFR 60 fps BDN XML (UHD BD only).
• Add "abort" button to GUI for all OS.
• Remove `--tslong` (Conservative PTS/DTS strategy) - it had become unecessary.
• Remove `--nodts` option as it was not longer working, and pointless (it was out of spec).

Back-end
• Add multithreading. Available on both GUI (drop-down menu) and CLI (`--threads N` or `-t N`), 1 <= N <= 8.
• Fix orphaned composition objects with normal case object redefinition enabled.
• Fix crash in the logic that performs time shift of object decoding.
• Add more stream compliancy tests.
• Perform adaptive padding to renderer space and windows.
• Fix handling of BDN XML with split events.
• Fix a silent crash on some (ARM?) Windows related to numba.
• Fix crash due to object blinking.
• Add `use_gpu` option to config.ini to optionally disable GPU usage.
• Clean and optimise quite a few functions.

Thanks to Alllen for bug hunting and testing.

cubicibo
21st June 2024, 21:48
SUPer v0.2.5 (https://github.com/cubicibo/SUPer/releases)

Essentially code optimization, reduced memory footprint, smarter screen layouts, and fewer bugs.

Front-end
• Threading is now enabled by default.
• Warn user if the BDN has unusual FPS-Video Format combinations: the Blu-ray format does not support all possible pairs.
• Fix paths with dots (e.g. remote servers).
• Remove subsampled flag: a better feature was moved to ass2bdnxml (-z).
• Add layout_mode in config.ini. Value ranges from 0 (safe) to 2 (aggressive). If you have odd issues in Scenarist when (re-)building, decrease the value.
• Add support for both pngquant and libimagequant, when the first is in %PATH%.

Back-end
• Add a C-optimised bitmap run-length encoder.
• Add a C-optimised layout engine.
• Order windows to reduce DTS-PTS gaps and to define epochs more aggressively.
• No longer cache graphics to save RAM.
• Rewrite the threading orchestrator to manage threads more efficiently.
• Fix crash caused by the object shift logic hitting epoch start.
• Fix rare out-of-spec output (PTS-DTS issue flagged without any associated timestamp printed) due to an oversight in the epochs definition logic.
• Distribute palette entries dynamically in normal case object redefinition according to the object area ratio.

cubicibo
1st July 2024, 13:40
SUPer v0.2.5A (https://github.com/cubicibo/SUPer/releases)

v0.2.5 shipped with two hard to trigger bugs coming from the new layout engine. Under very specific conditions, bitmaps could be cropped by 7 pixels in two directions. Authorers are strongly advised to update to v0.2.5A. Furthermore, the duplicate event filter is finally fixed.

Back-end
• Fix layout engine override method when it generates a single window. an overlay could be cropped by 7 pixels in two directions due to shifted coordinates.
• Fix logic to remove consecutive, yet duplicate, events.
• Always destroy instances of images whenever they are not immediately needed to reduce memory usage.

Dependencies
Update Brule to v0.0.3.

cubicibo
1st September 2024, 21:36
SUPer v0.2.6 (https://github.com/cubicibo/SUPer/releases)

This is pushing the limits, and likely the last release. Now, post-production facilities need to stop complaining about Blu-ray subtitles and use it.

Front-end
• Add `-d` (`--ahead`) flag to enable palette update buffering. Some Display Sets can be decoded early for later usage, while the PG Decoder is busy decoding upcoming objects. This flag enables a lot of stream optimization to avoid dropped events.
• Add `--layout` to override the config.ini `layout_mode=` value. This option is not available on the GUI.
• Add succint log output. `--log-to-file -10` will generate a single file listing all filtering decisions. Handy for inspection after batch conversion with the CLI.

Back-end
• Support BDN XML with unordered events [MonoS].
• Fix wrong palette shift with quantized bitmaps that had a transparent palette ID different than zero.
• Correct event shift on epoch start collision and reduce the shift to the minimum acceptable.
• Ensure orphaned display sets are discarded on epoch start collision.
• Improve the rendering code to avoid odd displays in some tricky contexts.
• Clean-up filtering code and fix some hard to trigger bugs.
• Improve debug logging.

9700PRO
17th October 2024, 17:16
Hello cubicibo. Thanks for the program. But there is a problem. The program does not understand forced subtitles. And changes the True (in bdn xml) parameter to False. As a result of packaging, forced subtitles stop working.
Please fix it.

cubicibo
17th October 2024, 22:26
Not possible. Forced flag requires a specific BDN layout and forbids the usage of advanced PGS functionalities or encoding algorithms, which SUPer relies on extensively. Furthermore, SUPer expects avs/ass2bdnxml-like BDN, where only one <Event> is active at a frame. This makes the flag very much useless for any avs/ass2bdnxml conversions (all or nothing).

You are better off enabling the flag after conversion via SubtitleEdit. It will be as fast as the time it took to edit the XML, and you will get much more freedom. Keep in mind there is no guarantee your forced line will be isolated in a composition object (making it impossible to force alone). Or simply generate two subtitles track, no headache.

cubicibo
20th November 2024, 17:24
SUPer v0.2.7 (https://github.com/cubicibo/SUPer/releases)

I swore I would not do another release, but I found a few things that could be better.

Front-end

• Add a new image quantizer: HexTree.
• Update the GUI layout and tooltips.
• Warn user if the BDN contains PNG that are already palettized or events split across two graphics.
• Add --capabilities to the CLI to display the available implementations (optimizations) of the Brule libraries.
• Reorganized the Image quantizer option for the CLI (and GUI):
--qmode (-q) Quantizer Speed Quality Compressibility
0 K-Means Slow High Low
1 Pillow Turbo Low Very high
2 HexTree [fallback] Very fast Good Medium
3 LIQ/pngquant [default] Fast Best Medium-Low

- By default, SUPer attempts to use -q 3: libimagequant/pngquant (LIQ). If it fails to find either, it will fallback to HexTree.
- LIQ reigns supreme for complex gradients and glows. HexTree may struggle occasionally on those but remains a good alternative.
- Pillow is excellent for low bitrate, and can do wonders with colour effects like fades and karaoke at very low bandwidths.
- K-Means is solely for users who fail to bind SUPer to libimagequant/pngquant but still wishes to produce high quality encodes.

Back-end
• Improve significantly the speed of K-Means image quantizer.
• Fix infrequent palette corruption after a Normal Case object redefinition.
• Fix window coordinates of large overlays that were split in two pieces to fit in the coded data buffer.
• Sanitize timecode handling and BDN parser. DF 29.97 & DF 59.94 should now be supported.
• Shift palette updates more aggressively, 1080p HFR content could rarely have DTS issues.
• Clean-up the code and optimize a few elements.
• Fix config.ini look-up in frozen executables.

Virtual environment users shall do a clean install. HexTree will be subpar if your system fails to compile the C extension.

cubicibo
10th July 2025, 21:08
SUPer v0.2.8 (https://github.com/cubicibo/SUPer/releases)

Front-end
• Add --prefer-normal (-k) to use Normal Case object updates whenever possible, and not only when they are a necessity with --allow-normal (-n).
-> This can reduce noticeably the output file size on some BDN files.
-> Do remember that, on Normal Cases, screen regions cannot share palette entries.
• Add a new HQ quantizer: Qtzr. (libimagequant > Qtzr > HexTree > Pillow in quality)
• Add --redraw-period to generate forceful screen redraws periodically for long lasting overlays.
• config.ini: add exit_on_error option for the CLI. If enabled, any error will terminate the process. E.g SUPer will refuse to encode BDNs with incorrect VideoFormat-FPS pairs.
• Do not output PES+MUI if the stream does not pass the internal verifier.

Back-end
• Improve event analyzer by performing recursive segmentation.
• Optimise handling of "single" graphics.
• Fix infrequent wrong coordinates on Normal Case refreshes.
• Analyze only alpha channel to not crash on images with garbage in the RGB channels.
• Optimize quantization operations by cropping transparent margins.
• Fix rare cases of stream non-compliance on Epoch Start collisions and alternating 2-window overlaying.
• Reject BDNs with spatially overlapping events.
• Handle unrecoverable errors in encoder threads.
• Fix missing logs for filtering decision made with --ahead.

Dependencies
• Brule: improve HexTree, remove low quality Python fallback.
• Brule: add Qtzr.

Many thanks to Alllen for the support!

leoenc
20th October 2025, 13:39
@cubicibo,

I have a 720p, 25 fps BDN XML input which fails with:
SUPer ERRO : Non standard VideoFormat-FPS combination for Blu-ray (720@25)!
SUPer ERRO : Error occured in strict mode. Terminating.

Is this a bug? The table here (https://en.wikipedia.org/wiki/Blu-ray) lists 1280x720p 25 fps as one of Blu-ray's supported resolutions/frame rates.
I also couldn't see a way to disable "strict mode".
Changing the BDN XML resolution to 1080p works.

leoenc
20th October 2025, 14:53
Ok, found it under config.ini, abort_on_error=0.
Thanks for this great program!

cubicibo
20th October 2025, 20:44
SUPer is correct: 720p supports 23.976p, 24p, 50p and 59.94p. For 720p25, you must use --pulldown 22 in x264 to make it 50p without wasting b-frames. Then, your BDN should be created at 50 fps, not 25.