script.xbmc.boblight
script.xbmc.boblight copied to clipboard
Black Bar Detection
Hello,
I added a Black Bar Detection. With this feature usual workarounds, like large boblight scan areas, e.g. 20%, are not necessary anymore. Now also small scan areas, e.g. 6%, work fine and give a much more natural detailed view.
The code is optimized for speed (e.g. taking all reoccurring calculations outside the scan loops, using the address format 4 bytes / pixels in the counters) in order to make this feasible also on low cpu powered machines. By removing the black bars the following copy to boblight is faster. So overall there should be no real difference in cpu usage for real world examples (e.g. 2.35 movie on 16:9 screen), even with switched on black bar detection. I didn't include a on/off switch, if the black bar scan area is set to 0 then the loops will immediately terminate and the capture will be copied to boblight without any cuts.
I put some descriptions into the README to explain the parameters:
Black Bar Detection searches for black areas in letterboxed/pillarboxed material and removes them. The vertical scan is performed in the top lines of the screen until a non black pixel is found or the maximum vertical scan area is reached. For each line only a centered range is scanned. With this option scans can be accelerated and also unwanted parts of the screens, e.g. with TV-logos, can be hidden. The analogue scan is performed from the left side. A threshold for black pixels could be defined. For optimizing performance and result the captured frame size and interval for scanning could be set. Capture dimensions relating to your led dimensions may be a good choice.
I hope you like this additional code and it will find its way into the official boblight plug-in.
Best regards, Steve
@bobo1on1 could you have a look at this? i fear that those new settings are way to advanced for common users of this addon tbh...
Yeah they seem too advanced for the average Joe.
@Memphiz thank you for the immediate response. The default settings for the detection are sufficient for 99% of the users and need not to be touched. The new code will work out-of-the-box. So the question is about having some optional changeable parameters visible or to hide them and make them hard coded.
Here's my view: For the frame capture you can optimize quality/speed with making these settings not hard coded. I think the boblight plug-in is not for common Kodi users. You always need to generate and modify your boblight.conf, so these users may be enthusiasts which like some "extra control", when they need it.
If you like, I could also hide all the settings and only provide an on/off switch.
Are there any other opinions on this?
I just wonder if we should move this whole stuff into boblightd instead (and have those options in boblightd.conf) - thats why i wanna wait on @bobo1on1 's opinion...