Trim black borders

Feature requests for VLC.
Python42
Blank Cone
Blank Cone
Posts: 39
Joined: 07 Oct 2011 20:22

Trim black borders

Postby Python42 » 07 Feb 2022 18:10

When manually resizing the vlc player window, aspect ratio of the window is not preserved (black areas are added at the edges). It would be nice if either the resizing automatically removed the black areas, or a hotkey function could be added to trim the black borders.

There was a player I used years ago that would resize the player window using CTRL+SCROLLWHEEL. Basically a zoom in/out for video like what is done in most text windows for text. In that player black areas were automatically trimmed.

Lotesdelere
Cone Master
Cone Master
Posts: 9942
Joined: 08 Sep 2006 04:39
Location: Europe

Re: Trim black borders

Postby Lotesdelere » 08 Feb 2022 13:38

You can use Z and Shift+Z hotkeys for zooming in and out.

Python42
Blank Cone
Blank Cone
Posts: 39
Joined: 07 Oct 2011 20:22

Re: Trim black borders

Postby Python42 » 08 Feb 2022 15:30

z, SHIFT-Z don't trim borders - just cycle through preset zooms

CTRL-SCROLLWHEEL would be more flexible and intuitive

elitedata
Blank Cone
Blank Cone
Posts: 58
Joined: 20 Jan 2022 20:17

Re: Trim black borders

Postby elitedata » 10 Feb 2022 19:25

the aspect ratio of the content is preserved if you resize the window to an aspect that is not the same as the content aspect, hence why you are getting the black areas.
it is preferred to keep the aspect ratio of the content displayed in its native format versus manipulating the displayed content to fit a given area that is not the same aspect as the content as this will distort the video content (stretch it vertically/horizontally).
the other method to fill in these black areas of the display is to simply zoom the content to fill in the black areas but there will be a small loss of content displayed depending on the aspect of the content, if it is 4x3, you will lose an equal amount vertically, if it is 16x9, you will loose an equal amount horizontally.
if there is one thing i cant stand, it is when people are streaming content using VLC and the native aspect of the content is not preserved distorting the content vertically or horizontally, what is the point in stretching (and distorting) 4x3 content to fit a 16x9 display (or vice versa) ?
is there a reason why people should look fat or skinny ?
think of the movie "the wizard of oz", nearly every BD copy has been zoomed in to fit a 16x9 display, the movie is originally 1.37:1 (4x3 aspect), its really dumb.

Python42
Blank Cone
Blank Cone
Posts: 39
Joined: 07 Oct 2011 20:22

Re: Trim black borders

Postby Python42 » 10 Feb 2022 21:24

I'm still not getting my point across. Let's assume, for the sake of simplicity, that the display consists only of the video window. No menu bar, no title bar, no status bar. Just the video window.

Now let's pick some numbers. Let's say I'm watching a video that is 1280x720. I want to see it larger, but not full screen. The aspect ratio of the video is 16:9. If I press Z to zoom in, I end up with an almost full screen, and black borders on the left and right. The video, naturally, has the same 16:9 aspect ratio.

If CTRL-SCROLLWHEEL worked the same in VLC as it does in many other apps (FastStone Viewer, gimp, etc.) then scrolling in one tick might result in a video window of size approximately 1400x788 which would be the same aspect ratio of 16:9.

The video player I referred to earlier was BSPlayer. I downloaded and installed the free version in a virtual machine to double check my memory. In fact, it would zoom in/out on SCROLLWHEEL without the CTRL. As well, when resizing using the borders (click-drag) it automatically removes black bars. This allows resizing to any desired size while both maintaining the original aspect ratio and not wasting screen space with black, non-video areas. I don't see a downside to this. It could easily be added as a preference "Automatically remove black borders".

elitedata
Blank Cone
Blank Cone
Posts: 58
Joined: 20 Jan 2022 20:17

Re: Trim black borders

Postby elitedata » 10 Feb 2022 21:47

i understand now what you are trying to convey.
its the window borders that is creating the added space in the aspect ratio causing the bars on the right and left sides for 16x9.
the video will always be complete vertically but any borders on the display window (the few extra pixels vertical and horizontal of the window border) is accounted and added horizontally creating the black bars.
i was able to reproduce this but i generally dont do what youre doing, i just use full-screen.
if a feature existed to "trim" these small black borders, it would slightly change the aspect ratio as well but i believe you can turn off "maintain aspect ratio" and that will do what you seek.

Python42
Blank Cone
Blank Cone
Posts: 39
Joined: 07 Oct 2011 20:22

Re: Trim black borders

Postby Python42 » 10 Feb 2022 23:28

I don't see why trimming the black borders would change the aspect ratio. I can trim the black borders manually by just grabbing the bottom right corner, or the bottom side and moving it, and the aspect ratio is preserved automatically. But why should I have to do this manually when vlc is capable of doing it for me?

To be very clear, I am not talking about black bars at the top or sides that are actually part of the video stream. I'm referring only to the black bars added by vlc when the display is manually resized.

elitedata
Blank Cone
Blank Cone
Posts: 58
Joined: 20 Jan 2022 20:17

Re: Trim black borders

Postby elitedata » 11 Feb 2022 00:01

...I can trim the black borders manually by just grabbing the bottom right corner, or the bottom side and moving it....
...I'm referring only to the black bars added by vlc when the display is manually resized.
which is the result of the content aspect ratio being preserved from resizing the display window to a size that is larger than the content aspect ratio.
if you have 16:10 monitor, then that would cause this issue.

Python42
Blank Cone
Blank Cone
Posts: 39
Joined: 07 Oct 2011 20:22

Re: Trim black borders

Postby Python42 » 11 Feb 2022 00:10

I don't understand what point you are trying to make. If I resize the window, vlc adds black areas to the sides or top/bottom to maintain the aspect ratio. VLC knows the dimensions of the displayed video. It also knows the size of the display window (including the black bars). So why can't vlc resize the display window to remove the black bars? It's not an issue. It's something vlc could easily do. It just doesn't do it.

Tastyratz
New Cone
New Cone
Posts: 1
Joined: 18 Apr 2022 14:56

Re: Trim black borders

Postby Tastyratz » 18 Apr 2022 15:02

I registered just to contribute to this because it also drives me nuts.

automatically resize window to video does NOT resize the whole window to the video size. It resizes the vertical direction and creates an aspect ratio with black bars on the horizontal left/right sides. The best way to demonstrate this is when playing a portrait mode video. It might resize to the height of the screen but then create big black bars that double the window required size. If you resize the window on the left and right it does not change aspect ratio. There is added fluff/border created. When you want to play a few small videos on the screen and VLC automatically resizes with the sidebar bulk it can drive you nuts.

It also resizes videos in a playlist of 1 every time they loop back to the start. VLC should respect a manually resized window on the current video until close.

This is not a zoom problem. The window frame should snap to ALL FOUR borders of a video when resizing but it does not. It snaps 2 and adds black bars in the interface that do not exist in the content.

Rémi Denis-Courmont
Developer
Developer
Posts: 15257
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Trim black borders

Postby Rémi Denis-Courmont » 22 Apr 2022 12:14

It is common sense to adjust the zoom to the narrowest window dimension, not the widest, to avoid cutting out video. Maybe you don't like it that way, but that's the defacto standard for video players that most people expect.

As for automatically resizing, there is no magic algorithm that will satisfy all use cases. Based on feedback, most users prefer to resize automatically. Maybe you don't like it either but that's how it is, and it is not a bug.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

Python42
Blank Cone
Blank Cone
Posts: 39
Joined: 07 Oct 2011 20:22

Re: Trim black borders

Postby Python42 » 22 Apr 2022 13:38

I'm not trying to argue, and I'm not trying to suggest that this is a bug. That's why I posted in this thread. VLC is by far the best video player available, but I don't see how you can claim that it is common sense, when resizing the player window, to add black bars that are not part of the video. It seems to me that common sense dictates that you display a window that exactly fits the video. I am certainly not suggesting, as you implied, that VLC should cut out video. If you didn't think VLC could be improved then you wouldn't have a section of the forum titled VLC Media Player Feature Requests.

Rémi Denis-Courmont
Developer
Developer
Posts: 15257
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Trim black borders

Postby Rémi Denis-Courmont » 22 Apr 2022 15:20

I say it's common sense because it pretty much is. Almost every media player has been doing this for the past 25 years that media players have existed.

It's pretty much expected that black bars are added whilst playing a 4:3 video on a 16:9 display or vice versa, afterall - rather than distort or crop.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

Python42
Blank Cone
Blank Cone
Posts: 39
Joined: 07 Oct 2011 20:22

Re: Trim black borders

Postby Python42 » 22 Apr 2022 15:34

I thought I made it clear that I am not talking about when playing video in full-screen. Obviously when you are playing full screen the video should be displayed (without distorting the aspect ratio) to either full width, or full height, with black borders added at either the top and bottom, or sides.

But when displaying video in a non full-screen window it makes no sense to add black padding. That's just a waste of screen space and potentially hides anything else that may be on the screen.

I would add two screencaps to illustrate but I don't know how to upload the images.

Python42
Blank Cone
Blank Cone
Posts: 39
Joined: 07 Oct 2011 20:22

Re: Trim black borders

Postby Python42 » 22 Apr 2022 16:17

Alan Cooper (The Essentials of User Interface Design) says that a good interface is one that does what the user expects. On that basis, let's assume I have a window that is displaying a video that is NOT full screen, and the video completely fills the window. If I grab the right or left border and drag to either make the window wider or narrower, the player should automatically increase or decrease the window height to ensure:

1. the entire video is displayed
2. the original aspect ratio is preserved
3. no extraneous (black borders) are displayed

This should also apply if the user resizes by dragging the top or bottom edges, or a corner.

Because black borders (again, NOT in full screen) serve no purpose, there is no reason to display them. They are a waste of valuable screen space.

Rémi Denis-Courmont
Developer
Developer
Posts: 15257
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Trim black borders

Postby Rémi Denis-Courmont » 22 Apr 2022 17:44

The principles of least surprise is to do the same regardless of full-screen or windowed mode. And what I wrote is in no way limited to full-screen mode.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

elitedata
Blank Cone
Blank Cone
Posts: 58
Joined: 20 Jan 2022 20:17

Re: Trim black borders

Postby elitedata » 22 Apr 2022 20:56

sounds to me like the issue is 16x9 content displayed inside 4x3 window or vice-versa.

Rémi Denis-Courmont
Developer
Developer
Posts: 15257
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Trim black borders

Postby Rémi Denis-Courmont » 22 Apr 2022 22:23

By the way, as I understand it, the OP was about preserving the aspect ratio of the window so that black bars would never be necessary. That makes sense, but it is dependent on the windowing system.

That would not be the same as computing the scaling factor according to the widest dimension instead of the narrowest, thus cropping edges of the picture instead of adding black bars.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

Python42
Blank Cone
Blank Cone
Posts: 39
Joined: 07 Oct 2011 20:22

Re: Trim black borders

Postby Python42 » 22 Apr 2022 22:35

The issue is absolutely in no way about 16x9 content inside a 4x3 window or vice-versa. It's about making the display window just big enough to contain the video while preserving the aspect ratio. This is independent of whatever system is hosting the application.

As for the principle of least surprise, in full screen that would be "maximize the size the of the video to use as much of the display as possible while maintaining the aspect ratio". In full screen this may or may not require padding. In windowed mode this would be "don't make the window any larger than necessary to contain the video while maintaing the aspect ratio."

elitedata
Blank Cone
Blank Cone
Posts: 58
Joined: 20 Jan 2022 20:17

Re: Trim black borders

Postby elitedata » 23 Apr 2022 01:06

i believe what you are seeking, is the window edges to snap to the frame edges of the video instead of adding black padding when free-form resizing it ?

Python42
Blank Cone
Blank Cone
Posts: 39
Joined: 07 Oct 2011 20:22

Re: Trim black borders

Postby Python42 » 23 Apr 2022 01:25

Exactly. If you want to see it done properly try BSPlayer (free version).

Rémi Denis-Courmont
Developer
Developer
Posts: 15257
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Trim black borders

Postby Rémi Denis-Courmont » 23 Apr 2022 10:09

If it's so easy and platform-independent, why don't you write the patch for it?
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

Python42
Blank Cone
Blank Cone
Posts: 39
Joined: 07 Oct 2011 20:22

Re: Trim black borders

Postby Python42 » 23 Apr 2022 13:55

Because my expertise was in real-time AGC/SCADA systems, not Windows/Mac/Linux. As a user, though, I think I am entitled to comment on the interface. In the same sense that I am not an automotive engineer, as a car driver I think It is reasonable to suggest that all cars, at the macro level, interact with the driver in a logical manner and in the same way. VLC should behave in a similar fashion on all windowing systems.

Python42
Blank Cone
Blank Cone
Posts: 39
Joined: 07 Oct 2011 20:22

Re: Trim black borders

Postby Python42 » 23 Apr 2022 17:15

Let's try a different approach. In my opinion (and I hope I am not alone in this), if an element in a user interface serves no functional purpose then it doesn't belong in the interface and should be removed. Black bars along the top, bottom, or sides of the window serve no purpose. They only take away from valuable desktop space. If the user is running an app in a window it usually means that they want to see what is on the rest of the desktop. If the user is running an app in full-screen then there is no interest in what else is running, thus, showing the video as large as possible on a black background is desirable.

As I said, resizing a border manually to remove the black borders is easy to do but it's not something the user should have to do. I do not understand why you are so adamantly opposed to this.

Rémi Denis-Courmont
Developer
Developer
Posts: 15257
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Trim black borders

Postby Rémi Denis-Courmont » 24 Apr 2022 13:41

Most people including myself don't want their video cropped or distorted when the aspect ratio of the window does not match that of the source video. Would you rather fluorescent pink bars? AFAIK, there are only two commonly implemented solutions to this: black bars, or (mostly when showing portrait recordings on landscape monitors) blurred content.

You can't just remove pixels from the window.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded


Return to “VLC media player Feature Requests”

Who is online

Users browsing this forum: No registered users and 14 guests