-
-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New LUT calibration based on mp4 test videos (part I) #896
Conversation
337ecec
to
fa7eff8
Compare
b97f332
to
1ab1a2c
Compare
There is a verification procedure for SDR: #1000 (comment) |
This indicates that you have disabled tone mapping in flatbutffers configuration if Index does not switch to 1 when you enable tone mapping. |
Hello, Here I have made the change: |
@satgit62 Thank you but I'm not really sure if I should do that. I need a way to have different LED gamma values at different picture modes and if HyperHDR is in HDR-always-on mode that wouldn't work anymore |
@satgit62 |
Hello, disconnect the TV from the mains for a minute and check after the restart whether everything works as usual. Everything works as it should for us. |
No changes after restart. HDR toggle stays off in SDR mode. "I don't use the HDR-Always-On option" I thought this is always enabled now? where is the toggle for this in PicCap? Are you talking about the "Disable SDR/HDR switch" in advanced settings? Because I'm talking about this: "Keep HDR always active webosbrew/hyperion-webos#124 by sundermann" The "Disable SDR/HDR switch" in advanced PicCap settings was there loooooong time before all this NV12 thing so it can't be the toggle for the new change. I'm more confused right now. But nonetheless it doesn't work for me. In HyperHDR under Advanced -> Flatbuffer Server -> HDR to SDR tone-mapping is always enabled, but the actual HDR switch in Remote tab is only activated if I'm playing a HDR/DV movie file. Everything is like on version 0.4.3 for me. |
You need to enable NV12 in PicCap UI. Even if you are not using multiple LUTs. |
NV12 was of course enabled the second I opened PicCap 0.5.0 for the first time. Then I checked if HDR stays on even in SDR mode but nope, same behaviour like 0.4.3 |
Post a fresh HyperHDR protocol. Switch once to HDR and then to SDR content. |
Switch from SDR to DV: 2025-01-29T12:45:37.624Z [FLATBUFSERVER] Setting user LUT filename to: 'lut_lin_tables_dv.3d' Then I switched from DV to SDR: 2025-01-29T12:45:42.706Z [FLATBUFSERVER] Setting |
Yes, that is not correct. The YUV index must not be 0 or 2. To activate tone mapping, the YUV index must be 1, just as with your DV LUT (Tone mapping: 1) You need to delete the 50MB flat_lut_lin_tables.3d file from Only LUTs with a size of 150 MB, e.g. 'lut_lin_tables.3d', may be present either in |
1 similar comment
Yes, that is not correct. The YUV index must not be 0 or 2. To activate tone mapping, the YUV index must be 1, just as with your DV LUT (Tone mapping: 1) You need to delete the 50MB flat_lut_lin_tables.3d file from Only LUTs with a size of 150 MB, e.g. 'lut_lin_tables.3d', may be present either in |
I'm using HyperHDR 21b2 on a RPI5, not on my LG TV. LUT space is not a problem in my case and there are no LUT's on my TV |
I don't think it makes a difference if you run HyperHDR on the Raspberry Pi. The NV12 should also be included in the branch for Raspberry. I see in your log that the new compression method is also included. See: https://github.com/satgit62/How-to-compress-the-LUT-table-and-use-it-in-HyperHDR. |
Just for the sake of trying, I did try your SDR LUT and the log doesn't look different than what I have posted above, HDR stays off on SDR content. I mean, why should it work now out of a sudden by using your LUT instead of mine..? |
Seems the same issue like here: #1062 (comment) I propose you to verify your md5 of the backend libraries. Or maybe the old version refused to uninstall while running and needs hard reset of the service? |
Yes, exactly, PicCap finishes with:
Uninstall and reinstall, reboot and configure. |
No luck yet, I have installed the latest HyperHDR version from the GitHub Actions tab and reinstalled PicCap. Still doesn't work. |
It's only about the backend/piccap, HyperHDR in this case is only a client. And it's instructed to disable tone mapping for SDR which is an incorrect command. |
Very strange this behaviour, try this PicCap build: https://github.com/satgit62/PicCap-hyperion-webos-NV12-Test/raw/refs/heads/main/org.webosbrew.piccap_0.5.0_all.ipk |
I have tried that in the meantime but it still didn't work. Then I manually copied the backends and hyperion-webos file to the PicCap folder and now it's working: 2025-01-29T14:51:51.173Z [AUTOTONEMAPPING] Tone mapping is currently: enabled 😃 |
So definitely something wrong is with the installer. Can you compare MD5 files you used with MD5 in the official package? 7-zip can compute it if you right click on the file or open the archive/ipk. |
I compared the working and non-working hyperion-webos and backends with "md5sum" on my RPI and they don't match. |
Can you please test this again? I have replaced it, and it works straight away:https://github.com/satgit62/PicCap-hyperion-webos-NV12-Test/raw/refs/heads/main/org.webosbrew.piccap_0.5.0_all.ipk This version is compiled on my PC Ubuntu Node 22. |
Yep, this version works out of the box. |
Thanks for testing, I still have to clarify why the PicCap built on the PC with Node 22 works, with the same cloned branch and in Git with Node 18 that doesn't work. |
@NatyaSadella |
I don't know what the final effect will be, but since AI is currently very popular ;) Let's use Deep Learning Function Approximation to calibrate SDR/HDR/whatever video source. We will use Python and its related libraries here but it is an optional functionality and you do not have to use it nor will we install it: it must be present in the system.
But first, let's sort out the calibrator code because it needs cleaning before further work. We will use a new library for linear algebra that will help us.
Main changes (non-AI):
Old method using Windows 10 and a web browser is no longer mandatory, you can use the old method using browser or simply play the video test file in your favorite video player.
New algos that support even video source trans-coded to full BT2020 range and provide better quality
Captured colors are saved in the HyperHDR directory after calibration as calibration_captured_yuv.txt and can be provided to me for analysis if I have some spare time.
Support only for YUV/NV12/MJPEG modes. RGB mode is not supported anymore.
Confirmed support for webos calibration with backend that supports NV12 flatbuffers communication. Each webos mode (SDR/HDR/DV) may require its own calibration.
Grabber benchmark supports flatbuffers source
Video source noise detection
multi-threading support for calibration and LUT creation. But what we gained by using all cores went to...
LCH color corrector. Jokes aside, this algorithm eats up huge amounts of CPU resources, but I think the effect is worth it because we get clean main colors and I didn't notice any side effects. If anything, you can disable it. More at the end.
Increased the number of test vertices focusing on the most problematic issues: yellow (green shift) and magenta (red shift).
USB grabber and flatbuffer server are disabled during calibration to save resources. We enable them at the end. Known issue: there is some issue on the webos client side that does not detect that the connection has been lost and does not reconnect it later. You have to manually restart the piccap service.
Added PQ in sRGB linear signal detection for AV access grabber. You can see in the first post what this grabber is capable of due to its wide range, it avoids quantization characteristic of all other grabbers.
Added 2-step calibration which allowed to speed up the whole process. The first step is general and is only intended to detect the appropriate tactic. The second step is detailed.
Moved calibration to a separate thread. Thanks to this we do not block the interface which now displays information about the progress on an ongoing basis.
Change some backlight behavior: only turn on the background light if the LED would otherwise be off.![](https://private-user-images.githubusercontent.com/69086569/378486412-b1f712b5-2664-4a53-a0e2-6823b8688175.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNTk4NTYsIm5iZiI6MTczOTI1OTU1NiwicGF0aCI6Ii82OTA4NjU2OS8zNzg0ODY0MTItYjFmNzEyYjUtMjY2NC00YTUzLWEwZTItNjgyM2I4Njg4MTc1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDA3MzkxNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTdlY2U2Yzk2ODk3YzdjZTJjZmUzN2NiYTY2MWRmY2IzMGIyNjcyNGE5Y2MyYzk2MGNlYWVlNzAxNDlkNjUzYjAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.lskFz1qXhDgp2YDyue39tfDDpdr_69yT1yzsc89ynsg)
If calibrating using Windows (using the web browser or the video player as a video source) please disable features like 'Night mode' or 'Auto-HDR'. Do not change the color balance in your graphic driver.
Video test files:
https://github.com/awawa-dev/awawa-dev.github.io/tree/master/calibration
Use SDR video only if your OS or video player will automatically apply SDR to HDR tone mapping. Or if you are calibrating eg. webos.
The web browser method and playing yuv444 file usually provides the best calibration quality but yuv444 is supported probably only by the PC players. yuv420 has better compatibility but worse quality (the risk the player is starting using its own filters like dithering).
Presenting capabilities of new tone mapping algos:
Source desktop (Windows 11 HDR enabled):
![source](https://private-user-images.githubusercontent.com/69086569/373031815-c2e74a90-6e68-42ea-87c9-ab894ce23443.jpg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNTk4NTYsIm5iZiI6MTczOTI1OTU1NiwicGF0aCI6Ii82OTA4NjU2OS8zNzMwMzE4MTUtYzJlNzRhOTAtNmU2OC00MmVhLTg3YzktYWI4OTRjZTIzNDQzLmpwZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDA3MzkxNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTBiZDc0NTFiNDUxNjk2M2M4ODU2MjE0YTBhNWFhNTUzYzI4YTRkYjI0NTBlZWYyZGI4MzQzMDIwNDMwNjg5YmYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.z3CqckC1iuy4Jss9TrFOGZTToKBzj79RPgTjG5zGEP4)
AV Access 4KVC00 (this wide-range grabber was ahead of its time + HDR/SDR detection on the COM port 👍 )
Captured by MS2130 (F3 firmware !!!) with and without tone mapping: