Trim black borders

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

Re: Trim black borders

Postby Python42 » 24 Apr 2022 14:47

One more time...

Below (I hope) is a link to an image which will illustrate what I am trying to get across. Note that the only difference between the two video snapshots is that in the first there are black borders on the sides and in the second there are no black borders. The video is not cropped or distorted in any way. None of the source video is missing. All that is being displayed is what the user wants to see - the title bar and the video, uncropped and scaled to fit the window (in the correct aspect ratio).

https://imgur.com/a/ZLV3Orj

I am reminded of a TV show from the 70s where a mother was upset when she discovers that the boy her daughter is serious about has parents who are midgets (the boy is normal sized). She tries to explain to a coworker why she is upset by saying "Bess wants to marry a boy whose parents are midgets". His response is "Has she found one yet?"

It continues...

"Bess HAS a boyfriend and her parents ARE midgets"

"Then What's the problem?"

"The problem is she's too young."

"How old do you have to be to marry a midget?"

"She's not marrying a midget."

"Poor kid. She wanted to so badly."

"The boy is not midget. His parents are."

"If she wants to marry a midget she should hold out for the real thing."

It goes on this way for several minutes. In this case, the mother has not considered what language she needs to use in order to explain it to a familiar coworker. In my case, not knowing anything about you, I don't know how to tailor my explanation to my target audience. Obviously I am failing to get my point across.

If the link to the image I posted does not work please tell me how I can post the image here as it seems to be the only way to illustrate what I mean.

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

Re: Trim black borders

Postby Python42 » 24 Apr 2022 22:11

Take an example. I have a video that is 640x360. If I play it in a window with no controls (the CTRL-H option), the window is 656x399. Vlc adds 16 pixels to the width and 16 pixels to the actual video dimensions at zoom=1.0. If I use the ALT-4 zoom preset (zoom=2.0), the video displays as 1280x720, and the window (with the same pixels added for titlebar and window edges) is sized to 1296x759.

Since vlc knows the aspect ratio, the zoom factor and the number of pixels that are added for containers/controls, it can easily size the container so that no distortion takes place, none of the video is cropped, and no extraneous borders are displayed.

Clearly, since VLC doesn't display these blank borders when using the hotkey zoon presets (as long as CTRL-H - no controls is selected), it is already capable of displaying zoomed video with no borders. Obviously if the controls are visible the minimum width must be sufficient to contain the controls.

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

Re: Trim black borders

Postby Rémi Denis-Courmont » 25 Apr 2022 17:53

Sigh. If you think it is that fast and easy, why don't you submit the patch already? Talk is cheap. Existing VLC volunteers have thousands of bugs in the backlog.
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 » 25 Apr 2022 19:38

Fast and easy depends on your expertise. If you need some code to import 8000 analog and status points into an MSSQL database every five minutes I can code that up for you lickety split. If you need to monitor a generating station in real time and communicate with a SCADA mainframe, I'm your man. C++ programming for video, however, is not my forte. As I said, the code is already in VLC to trim black borders based on the functionality of the ALT-# zoom hotkeys. All I am asking is that the same trimming be done on a manual resize. It makes little sense to provide a thread where users can submit feature requests, then berate them when such requests are made.

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

Re: Trim black borders

Postby Rémi Denis-Courmont » 25 Apr 2022 20:01

Adding a feature request category was not my idea, and there is a line between suggesting a feature, and insisting that it's easy and "asking" why it's not already been implemented after all these years.
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 » 25 Apr 2022 21:47

OK. I'll stop insisting out of ignorance. Where can I get the latest source code? It's time to see for myself.

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

Re: Trim black borders

Postby Python42 » 25 Apr 2022 21:48

In case this got lost in all my bitching, VLC really is an awesome app.

sweff
New Cone
New Cone
Posts: 1
Joined: 19 Feb 2023 08:28

Re: Trim black borders

Postby sweff » 19 Feb 2023 08:32

Did you ever figure out a way to resize and avoid the bars? BTW it was super fun watching people not understand what you're trying to convey....By that I mean it was painful.
Even the video player in Cubase does this properly. It baffles me why it doesn't happen in VLC.

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

Re: Trim black borders

Postby Python42 » 19 Feb 2023 09:26

Nope. Still behaving poorly. To see an example of how it should behave go to youtube and play any video with picture-in-picture. The pop up video window behaves like I want. I do not understand the huge negative reaction that my suggestion provoked.

VLCfan22
New Cone
New Cone
Posts: 2
Joined: 15 Sep 2023 06:15

Re: Trim black borders

Postby VLCfan22 » 15 Sep 2023 06:26

Created an account just for this.

Laptop on win11 running VLC 3.0.8, I can resize to my hearts desire.

Just updated my PC from 10 to 11, and downgraded my VLC to 3.0.8 to see if it "fixed" my PC. No luck.

Transferred my settings from laptop to PC. No luck.

No idea what I did to make it work on my laptop. But it works perfectly. The heck?

It's a mystery that will probably go on forever, unless I can dig deep into what I did back in October of '22 somehow. Anyone know where a setting might live that isn't present in vlcrc and vlc-qt-interface.ini?

tl;dr, looks like https://forum.videolan.org/viewtopic.ph ... ze#p538615 has it in the pipeline. I just wish I knew how I originally "fixed" it.

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

Re: Trim black borders

Postby Python42 » 15 Sep 2023 14:40

I can resize to my heart's content as well but vlc still insists on leaving the black padding unless I resize with alt-1, alt-2, alt-3, etc. The padding serves no useful purpose that I can see. If the window can be resized with alt-# with the padding removed I don[t understand why it is such a big deal to remove it on a manual resize. I will likely get the same response I got before, "If you think it is that fast and easy, why don't you submit the patch already?"

VLCfan22
New Cone
New Cone
Posts: 2
Joined: 15 Sep 2023 06:15

Re: Trim black borders

Postby VLCfan22 » 16 Sep 2023 03:12

Makes ya wonder why one machine works, and the other doesn't, doesn't it??

To clarify, my laptop has 0 side padding at all, unless I make the window larger than the H size.

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

Re: Trim black borders

Postby Python42 » 16 Sep 2023 04:08

So if you, for example, grab the right border and drag right it resizes horizontally as well as vertically?

oggmeista
Blank Cone
Blank Cone
Posts: 19
Joined: 23 Sep 2011 14:59

Re: Trim black borders

Postby oggmeista » 18 Nov 2023 10:45

Have people resolved this issue?, Seems to work alot of the time with untouched content but my issue is if i convert it because some content is like 10gb and i just know the quality can be maintained without such a ridiculous size, so i try to convert the file but it seems that if i lower the resolution lower than 1980*1080 or 1600*900 the converted file wont play in the full screen of the window size; i DON'T mean using a full screen window i mean using non full scren windows but fill the whole of the player screen

Ok i need to explain this Using my standard resolution Monitor 16:9 i want to play media in a screen size 1/3 of the screen width and 1/2 it's height, but i want the media to play in the whole size of the player size ie with no black borders anywhere, ( i use minimal interface mode) if i double click into full screen mode it fills the whole screen but in the window (non full screen) size mode i described above i get huge blackborders above and below i want these to not show...after converting a file to a lower resolution but maintaining the same bit rate I already know that despite some saying to the contrary it's bitrate not resolution that's relevant to visual fidelity ie picture quality

anyway i've messed with some of the video height and cropping settings but they just don't do what i want in a media instance of the size ratio mentioned above
Is there a way? it's driving me nuts ...do i need specific file conversion resolution and or is there a setting in the preferences, because there are a lot of settings and i'm not sure what some of these do?

thx

oggmeista
Blank Cone
Blank Cone
Posts: 19
Joined: 23 Sep 2011 14:59

Re: Trim black borders

Postby oggmeista » 18 Nov 2023 11:00

So if you, for example, grab the right border and drag right it resizes horizontally as well as vertically?
In the image you provided, i do appear to see one other difference , your video sizes are different the second insatnce looks wider than the first, but you can enforce the player to keep a certain size dimension, and then i don't see black borders on the sides, but i am seeing then still on the top and bottom as i have explained in my post...

Can't remember exactly how to enforce player size but it's not that difficult could easily find out and post here if you want?, wish my proble was as simple to solve though..p

scratch
New Cone
New Cone
Posts: 1
Joined: 10 Jul 2023 12:51

Re: Trim black borders

Postby scratch » 30 Apr 2024 16:08

You are both talking about different things.

Think of it this way. In many paint programs you have a tool that allows you to make squares, rectangles, circles, ovals, arrows and many other shapes automatically.

The way the tool works is it normally draws a rectangle but if you hold shift it will lock the aspect ratio as you resize the square.

OP needs to understand that the black bars serve the purpose of filling in the blanks for people who want to be able to watch a movie (for example in a quarter of the screen) in a window that doesn't match the aspect ratio or on a mobile device that does not match the aspect ratio of the video.

However it could be useful to be able to resize the window holding shift which would preserve the aspect ratio as it resizes. This would have to be implemented across operating systems separately.

In short the OP is looking for a button to press that will resize the vlc window using a preserved aspect ratio.

You would do this by auto changing the height to match any horizontal movement and the length to match any vertical movement.

EG 1920x1080 pixel window.
Width of window changed to 1440 pixel
height auto changed to 810 px.

16/9 * 1080 = 810 px

obs you would calc on the fly not at the end of the movement.

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

Re: Trim black borders

Postby Rémi Denis-Courmont » 01 May 2024 07:18

Conceptually it's easy, but calculating the correct affine size of the window when the video is embedded in the GUI is not so easy.

But anyhow, patches are welcome.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

Philip S
New Cone
New Cone
Posts: 2
Joined: 18 Jun 2024 10:26

Re: Trim black borders

Postby Philip S » 18 Jun 2024 14:43

It works as he wants it to in the macOS interface until you try to resize below the minimum window width (except when playing tall portrait mode videos, which reminds me I ought to check the bug tracker). It used to add vertical black bars if you shrank the window further, now it sets a minimum window size vertically as well.

I don't know if any of that code can be copied (or at least the maths) or if it's relying on Apple's UI primitives.


Return to “VLC media player Feature Requests”

Who is online

Users browsing this forum: No registered users and 9 guests