You are not logged in.

#1 2014-12-13 16:12:36

Nietzsche
Member
Registered: 2014-10-26
Posts: 15

Openbox mpv issue

Hello hello,

I'm having a problem with mpv on openbox (well, after trying the mpv bugtracker and inspecting some things, Openbox seems to be the culprit rather than mpv) and wanted to know if I am the only one.

https://github.com/mpv-player/mpv/issues/1343

Basically, this video isn't played at the exact dimensions unless I pass the "--no-keepaspect-window" option to mpv (visible because of the crisp bitmap fonts). If I'm not the only one, I'll at least have given a solution.

Offline

#2 2014-12-13 17:14:24

Gusar
Member
Registered: 2009-08-25
Posts: 3,607

Re: Openbox mpv issue

Nope, you're not the only one, I've always had issues with mpv/openbox interaction. Visible as a black column on one or both sides of the video. It depends on window size, resizing the window during playback the black columns appear/disappear.

BTW, I wouldn't call --no-keepaspect-window a solution - it makes resizing the window to watch video at a different size than its resolution quite annoying.

Offline

#3 2014-12-13 17:19:32

Nietzsche
Member
Registered: 2014-10-26
Posts: 15

Re: Openbox mpv issue

I'll probably have to change one day. But keeping a "sane" setup is so comfy. Maybe when Wayland is usable enough for desktop.

Offline

#4 2014-12-13 21:34:31

Gusar
Member
Registered: 2009-08-25
Posts: 3,607

Re: Openbox mpv issue

I think openbox has a bug tracker, you could report there. Changing window managers would be quite tough for me, I'm much too used to openbox's features and functionality smile.

Offline

#5 2014-12-16 01:52:07

Nietzsche
Member
Registered: 2014-10-26
Posts: 15

Re: Openbox mpv issue

Well, I'm ready to evolve toward tiling (i3 seems pretty good) so it won't be a problem anymore. Good luck with Openbox, since it seems a bit abandoned.

Offline

#6 2014-12-16 02:23:33

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: Openbox mpv issue

Waaait a minute... I use mpv and Openbox, and that video looks fine to me. Could it be a video card / video settings issue?

What video output setting are you using? I have "vo=xv" in my "~/.mpv/config" file. Does that make a difference?

(Also, I'm using the open source radeon drivers.)

Offline

#7 2014-12-16 10:11:06

Gusar
Member
Registered: 2009-08-25
Posts: 3,607

Re: Openbox mpv issue

Well, i'm all Intel on my machines smile. Video output makes no difference, be it xv, opengl or vaapi. But I don't think it's that, I'm quite sure it's openbox. A thought just occurred to me, maybe it's specific themes that trigger this. I think that because of how complex openbox themes are, with their inner borders and outer borders and border borders smile.

Offline

#8 2014-12-16 14:04:38

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: Openbox mpv issue

Gusar wrote:

A thought just occurred to me, maybe it's specific themes that trigger this. I think that because of how complex openbox themes are, with their inner borders and outer borders and border borders.

Let's find out! What theme are you using?

Also, I don't quite understand the original issue. Can you please post a screenshot describing the problem? It's something about incorrect aspect ratio and black borders, right?

I think I'm taking this issue a little "personally". I think of Openbox and mpv and two of the highest quality software applications, so the thought of one of them possibly having such a glaring bug makes me want to find out what's going on. tongue

Offline

#9 2014-12-16 14:31:42

Gusar
Member
Registered: 2009-08-25
Posts: 3,607

Re: Openbox mpv issue

drcouzelis wrote:

Let's find out! What theme are you using?

A self-made one smile. Here you go: http://pastie.org/9784154

drcouzelis wrote:

It's something about incorrect aspect ratio and black borders, right?

Yes. Instead of the video filling the whole window, it's one or two pixels shorter. The distortion this causes isn't visible on natural video, but it is on Nietzsche's video due to the sharp lines of fonts. An example of how this looks like (note the black columns on the left and right): http://i.imgur.com/eAwONNF.png

drcouzelis wrote:

I think I'm taking this issue a little "personally". I think of Openbox and mpv and two of the highest quality software applications, so the thought of one of them possibly having such a glaring bug makes me want to find out what's going on. tongue

I hear ya smile. Openbox is quite awesome and so is mpv.

BTW, the issue happens with mplayer2 too, but less frequently due to it having some code that got removed in mpv (commit). No idea about mplayer.

Offline

#10 2014-12-17 04:26:08

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: Openbox mpv issue

CRAAAP, now I see it too. sad

Correct quality, in Window Maker:
sF986xGs.png

Incorrect quality, in Openbox (See the lines near the center of the window):
plR6S4Gs.png

Also, yay for Sailor Moon. smile

Offline

#11 2014-12-17 11:46:11

Gusar
Member
Registered: 2009-08-25
Posts: 3,607

Re: Openbox mpv issue

It's weird that it happens just with mpv though. Use xwininfo on any other window, it'll show correct dimensions. Use it on mpv, it'll show height being one pixel short (if the video is 640x360, xwininfo will show "Height: 359"). mpv will thus compensate the video width according to this incorrect height, causing the mess.

Looking at it in a different way: My theme has a titlebar of 22px, and then 1px borders on left/right/bottom. If I open some application with a size of 640x420, the entire window (including decoration) will be 642x443. As it should be: 22px titlebar + 1px bottom border, so add 23 to the application height.

But with mpv, using a 640x360 video, the entire window will be 642x382. It should be 642x383 !! No matter how you slice it, openbox creates the mpv window with its height off by one. I'll try a hack, add +1 somewhere in mpv's code smile

Edit: Had a look at mpv's verbose output:

[vo/vaapi] Window size: 640x359
[vo/vaapi] Video source: 640x360 (640x360)
[vo/vaapi] Video display: (0, 0) 640x360 -> (1, 0) 638x359
[vo/vaapi] Video scale: 0.996875/0.997222
[vo/vaapi] OSD borders: l=1 t=0 r=1 b=0
[vo/vaapi] Video borders: l=1 t=0 r=1 b=0

Yup, like I said, mpv compensates for the off-by-one window height.

Another edit: Hack complete smile

diff --git a/video/out/x11_common.c b/video/out/x11_common.c
index ce2111a..1a05443 100644
--- a/video/out/x11_common.c
+++ b/video/out/x11_common.c
@@ -1005,7 +1005,7 @@ static void vo_x11_sizehint(struct vo *vo, struct mp_rect rc, bool override_pos)
     hint->x = rc.x0;
     hint->y = rc.y0;
     hint->width = RC_W(rc);
-    hint->height = RC_H(rc);
+    hint->height = RC_H(rc) + 1;
     hint->max_width = 0;
     hint->max_height = 0;

Last edited by Gusar (2014-12-17 12:15:32)

Offline

Board footer

Powered by FluxBB