hyperion-project / hyperion.ng

The successor to Hyperion aka Hyperion Next Generation
https://hyperion-project.org/
MIT License
3.02k stars 375 forks source link

Add black borders when reading from a 4:3 input source but feeding to a 16:9 screen #1301

Open V10lator opened 3 years ago

V10lator commented 3 years ago

Feature request

What problem does this feature solve?

1030

IMG_20210807_213739

What does the proposed API look like?

How should this be implemented in your opinion?

Add black borders instead of stretching the image when reading 4:3 input but working in 16:9 mode.

Are you willing to work on this yourself?

No time for that, sorry.

FluffyDiscord commented 3 years ago

Option to force different aspect ratio recording would is really needed. My main monitor is 21:9 and as you can guess, 100% of stuff I watch is either in 16:9 or 4:3 and as now there is only the "black bar detection" which is frankly useless, as it detects anything dark

Lord-Grey commented 3 years ago

@V10lator , @FluffyDiscord Maybe you provide a visual what you are looking for in terms of Image to LED mapping and where the current problem lies. Note: The preview is to show what is captured and how the image maps to LEDs. It is not to show what you see on your screen.

FluffyDiscord commented 3 years ago

Something like the old Ambibox software has. The numbered purple stuff are LED mappings - I have my LEDs around my monitor edges, but while viewing 16:9 content I want the capture logic to sample 16:9 region as shown on the image, not 21:9

image

V10lator commented 3 years ago

I just want black border detection to be disableable as described in #1030 :

It seems the image is grabbed before black borders (or Kodi UI elements but that's probably a different issue) are added, then resized to whatever size is setted in the config. So one can't disable black border detection and if they are there the LEDs are off cause stretched on one axis.

Steps to reproduce

1) Disable black border detection 2) play a 4:3 video on a 16:9 screen or vice-versa

What is expected?

LEDs at the black borders stay off.

What is actually happening?

Hyperion is ignoring the black border.

Quote from @Portisch at #1030:

I think it's a issue of the grabber as it get stretched in the Webinterface:

And from @Paulchen-Panther (also at #1030):

Actually, this issue belongs in the feature request corner. Since the AMLogic grabber captures the video source material and not the screen, no black borders can be detected because there are none.

In other words: I just want black borders to be added when needed (4:3 source on 16:9 screen).

Portisch commented 3 years ago

@Paulchen-Panther is right and the Grabber can not detect the "black borders" on 4:3 as they aren't included in the video frames. I think this is done afterwards in Kodi itself, but after the hardware decoder.

Maybe the Grabber can read the correct aspect ratio by: https://github.com/CoreELEC/media_modules-aml/blob/amlogic-4.9/drivers/stream_input/amports/amstream.c#L2917

It should deliver the aspect ratio by: https://github.com/CoreELEC/linux-amlogic/blob/amlogic-4.9-19/include/linux/amlogic/media/utils/amstream.h#L356

But I think this needs to be done for every frame to ensure the correct aspect ratio.

I do not see much sense to include such 4:3 detection at all as this format is obsolete and I haven't seen it for a while. But feel free @V10lator to implement this feature and make a pull request.

Portisch commented 3 years ago

@Paulchen-Panther is right and the Grabber can not detect the "black borders" on 4:3 as they aren't included in the video frames. I think this is done afterwards in Kodi itself, but after the hardware decoder.

Maybe the Grabber can read the correct aspect ratio by: https://github.com/CoreELEC/media_modules-aml/blob/amlogic-4.9/drivers/stream_input/amports/amstream.c#L2917

It should deliver the aspect ratio by: https://github.com/CoreELEC/linux-amlogic/blob/amlogic-4.9-19/include/linux/amlogic/media/utils/amstream.h#L356

But I think this needs to be done for every frame to ensure the correct aspect ratio.

I do not see much sense to include such 4:3 detection at all as this format is obsolete and I haven't seen it for a while. But feel free @V10lator to implement this feature and make a pull request.