Opened 13 months ago

Last modified 12 months ago

#13400 closed Bug Report - General

Video playback wrong aspect ratio — at Version 16

Reported by: Klaas de Waal Owned by: Peter Bennett
Priority: minor Milestone: 31.0
Component: MythTV - Video Playback Version: Master Head
Severity: medium Keywords: video playback gui qt
Cc: Stuart Auchterlonie, David Hampton Ticket locked: no

Description (last modified by Peter Bennett)

Aspect ratio is calculated incorrectly on systems with two monitors.

Prior description - Video playback with mythfrontend now has the wrong aspect ratio. Also the on-screen "Paused" display has disappeared.

A version of mythtv master compiled two days ago is correct; a version compiled today is wrong.

Attached are two screenshots of the same recording with the different frontends, both paused at approximately the same moment.

Version of the old/correct mythfrontend:

[klaas@modu mma-dvbt]$ mythfrontend --version
Please attach all output as a file in bug reports.
MythTV Version : v31-Pre-47-g4543b46083-dirty
MythTV Branch : master
Network Protocol : 91
Library API : 31.20190109-1
QT Version : 5.11.3
Options compiled in:
 linux profile use_hidesyms using_alsa using_oss using_pulse using_pulseoutput using_backend using_bindings_perl using_bindings_python using_bindings_php using_crystalhd using_dvb using_firewire using_frontend using_hdhomerun using_vbox using_ceton using_hdpvr using_ivtv using_joystick_menu using_libcec using_libcrypto using_libdns_sd using_libfftw3 using_libxml2 using_lirc using_mheg using_opengl using_opengl_video using_opengl_themepainter using_qtwebkit using_qtscript using_qtdbus using_taglib using_v4l2 using_x11 using_xnvctrl using_xnvctrl_external using_libbluray_external using_xrandr using_xv using_profiletype using_systemd_notify using_systemd_journal using_bindings_perl using_bindings_python using_bindings_php using_freetype2 using_mythtranscode using_opengl using_vaapi using_vaapi2 using_nvdec using_vdpau using_ffmpeg_threads using_mheg using_libass using_libxml2
[klaas@modu mma-dvbt]$ 

Version of new/wrong mythfrontend:

[klaas@modu mma]$ mythfrontend --version
Please attach all output as a file in bug reports.
MythTV Version : v31-Pre-56-gfa86a6a293
MythTV Branch : master
Network Protocol : 91
Library API : 31.20190109-1
QT Version : 5.11.3
Options compiled in:
 linux profile use_hidesyms using_alsa using_oss using_pulse using_pulseoutput using_backend using_bindings_perl using_bindings_python using_bindings_php using_crystalhd using_dvb using_firewire using_frontend using_hdhomerun using_vbox using_ceton using_hdpvr using_ivtv using_joystick_menu using_libcec using_libcrypto using_libdns_sd using_libfftw3 using_libxml2 using_lirc using_mheg using_opengl using_opengl_video using_opengl_themepainter using_qtwebkit using_qtscript using_qtdbus using_taglib using_v4l2 using_x11 using_xnvctrl using_xnvctrl_external using_libbluray_external using_xrandr using_xv using_profiletype using_systemd_notify using_systemd_journal using_bindings_perl using_bindings_python using_bindings_php using_freetype2 using_mythtranscode using_opengl using_vaapi using_vaapi2 using_nvdec using_vdpau using_ffmpeg_threads using_mheg using_libass using_libxml2
[klaas@modu mma]$ 

The mythfrontend log files are also attached.

Linux system is Fedora 29, no video hardware.

This problem could have been introduced with the GUI-related commits of Feb 4, 2019 by linuxdude42.

Change History (24)

Changed 13 months ago by Klaas de Waal

Attachment: Selection_003.png added

Screenshot with correct aspect ratio, with the "old" version of mythfrontend compiled two days ago.

Changed 13 months ago by Klaas de Waal

Attachment: Selection_004.png added

Screenshot with wrong aspect ratio and "Paused" OSD missing , with the version of mythfrontend compiled today.

Changed 13 months ago by Klaas de Waal

Attachment: mf-20190205-1435-bad.log added

Log file of mythfrontend with wrong aspect ratio and "Paused" OSD missing , the version of mythfrontend compiled today.

Changed 13 months ago by Klaas de Waal

Attachment: mf-20190205-1436-ok.log added

Logfile of mythfrontend with correct aspect ratio, from the "old" version of mythfrontend compiled two days ago.

comment:1 Changed 13 months ago by Peter Bennett

v31-Pre-47-g4543b46083a is working ok.

comment:2 Changed 13 months ago by Peter Bennett

Status: newinfoneeded_new

v31-Pre-57-g4f58fd152f seems to be working fine - I have tested with vaapi2 and opengl playback profiles.

Aspect ratio is fine. OSD shows fine.

Please let me know the playback profile you are using, and the display hardware.

I notice with Normal playback profile, the OSD is not working. I think that was reported a few days ago.

comment:3 Changed 13 months ago by Peter Bennett

I have fixed the issue with OSD on Slim, Normal, etc.

comment:4 Changed 13 months ago by Peter Bennett

Milestone: needs_triage31.0
Priority: blockerminor

comment:5 Changed 13 months ago by Klaas de Waal

Hardware is Intel i7-7700 with built-in graphics.
Video playback profile is Normal.
With the "VAAPI2 Normal" the OSD is OK but the aspect ratio is still wrong.

comment:6 Changed 13 months ago by Klaas de Waal

Hardware is Intel i7-7700 with built-in graphics.
Video playback profile is Normal.
Have now tested with "VAAPI2 Normal" and then the OSD is OK but the video aspect ratio is still wrong.

comment:7 Changed 13 months ago by Klaas de Waal

Recompiled the latest just now, MythTV Version : v31-Pre-58-g144ac28c00
With video playback profile "Normal" the OSD is fixed but aspect ratio of video and OSD is still wrong.
With video playback profile "VAAPI2 Normal" the aspect ratio of the video is still wrong but the aspect ratio of the OSD is correct.
Screenshots will be attached.

Changed 13 months ago by Klaas de Waal

Attachment: Selection_005_Normal.png added

Video playback paused with the "Normal" profile.

Changed 13 months ago by Klaas de Waal

Paused video playback with "VAAPI2 Normal" profile.

comment:8 Changed 13 months ago by Peter Bennett

Nobody here sees this problem.

Please check mythfrontend setup -> video -> playback -> general playback and make sure you have no setting in scaling or video aspect override.

comment:9 Changed 13 months ago by Klaas de Waal

Progress!!
My system has two monitors, the first is 1920x1200 and the second is 1920x1080.
When I disconnect the second monitor and reboot the system then the video playback aspect ratio is correct!!

Looking now again at the differences in the log files, the first significant differences are the display dimensions in line 171.
The log file of a few days ago, mf-20190205-1436-ok.log, shows this (lines 170-172):

2019-02-05 14:36:48.992544 I  VideoOutput: Pixel dimensions: Screen 1920x1200, window 1280x720
2019-02-05 14:36:48.992599 I  VideoOutput: Xinerama display dimensions: 564x317 mm  Aspect: 1.77918
2019-02-05 14:36:48.992610 I  VideoOutput: Estimated window dimensions: 376x190 mm  Aspect: 1.97895

The display rectangle is then computed as 1150x720 (lines 202-203):

2019-02-05 14:36:49.044388 I  Display Rect  left: 65, top: 0, width: 1150, height: 720, aspect: 1.97895
2019-02-05 14:36:49.044390 I  Video Rect    left: 0, top: 0, width: 1920, height: 1080, aspect: 1.77778

The log file mf-20190205-1435-bad.log shows a much larger width and it is called "Actual display dimensions" instead of "Xinerama display dimensions" (lines 170-172):

2019-02-05 14:35:29.816328 I  VideoOutput: Pixel dimensions: Screen 1920x1200, window 1280x720
2019-02-05 14:35:29.816332 I  VideoOutput: Actual display dimensions: 1016x317 mm  Aspect: 3.20505
2019-02-05 14:35:29.816334 I  VideoOutput: Estimated window dimensions: 677x190 mm  Aspect: 3.56316

This looks like the width is the total width of both screens.
The display rectangle is then computed as 639x720 (lines 202-203):

2019-02-05 14:35:29.851136 I  Display Rect  left: 320, top: 0, width: 639, height: 720, aspect: 3.56316
2019-02-05 14:35:29.851139 I  Video Rect    left: 0, top: 0, width: 1920, height: 1080, aspect: 1.77778

A new log file, mf-20190206-1041.log (to be attached), from the latest master but with only the first screen connected, shows this (lines 171-173):

2019-02-06 10:41:26.046554 I  VideoOutput: Pixel dimensions: Screen 1920x1200, window 1280x720
2019-02-06 10:41:26.046558 I  VideoOutput: Actual display dimensions: 508x317 mm  Aspect: 1.60252
2019-02-06 10:41:26.046560 I  VideoOutput: Estimated window dimensions: 338x190 mm  Aspect: 1.77895

The display rectangle is then computed as 1280x720 (lines 203-204):

2019-02-06 10:41:26.081123 I  Display Rect  left: 0, top: 0, width: 1280, height: 720, aspect: 1.77778
2019-02-06 10:41:26.081126 I  Video Rect    left: 0, top: 0, width: 1920, height: 1080, aspect: 1.77778

The 1280x720 is exactly the size of the window so that is very much OK. The video now fills the window exactly which is better than with the version of a few days ago which computes the window as 1150x720.

So the problem is that the video rectangle computation needs to be fixed for the case in which people have more than one screen and run MythTV frontend in a window.

Changed 13 months ago by Klaas de Waal

Attachment: mf-20190206-1041.log added

Logfile of mythfrontend with perfect aspect ratio, from the latest version of mythfrontend but with only one screen connected to the system.

comment:10 Changed 13 months ago by jpilk

I see this too, Master 144ac28c008 Fedora 28 VDPAU. Screens are

monitor, default, windowed 1024x576+64+64 in 1680x1050

and TV, unwindowed, run with 'mythfrontend -nw --geometry 1920x1080+1680+0'

OSD is normal size but playback about half-width, centred. Menu > Video > Aspect ratio has no effect.

FWIW Firestick 4K frontend on TV is fine.

An edit for accuracy here: the above adjustment to nominal aspect ratio does have an effect, but not enough to get a correct display. And the Firestick is using the frontend build of 30/fixes from 20190124.

Last edited 13 months ago by jpilk (previous) (diff)

comment:11 Changed 13 months ago by Peter Bennett

Resolution: Invalid
Status: infoneeded_newclosed

Closing this as it is not a bug but a restriction when using multiple monitors in xinerama mode. What I do for this situation, is as follows

Set up a unique user id for Mythfrontend. Log on with that user and use display setup to disable one monitor. Every time you logon with that user you get one screen, when logging on with a different user id you can use both screens.

comment:12 Changed 13 months ago by jpilk

Perhaps I misunderstand; but I can (and do) stop and restart either frontend display 'instantaneously' from the command line. Logging in as a different user takes minutes. 'Restriction' seems an understatement.

comment:13 Changed 13 months ago by David Hampton

I only saw this once in my testing for change b2c82a3665, and then the problem went away. I could never recreate it after that. I will try and recreate it again.

comment:14 Changed 13 months ago by jpilk

Thanks. I should probably have said that my setup is using XScreen0 only, and nVidia screen settings reports its dimensions as 3600x1080, ie (1680+1920)x1080, clearly based on the combined pixel-widths of the two screens.

comment:15 Changed 13 months ago by Klaas de Waal

Problem is that the video scaling uses the pixels of only the first screen, 1920x1200, and the dimensions in mm of both screens together. Fixed this by using the pixel area of both screens together, 3840x1200. Patch is attached.

Caveat: I have not gone into the very depths of the video stuff so this might not be the best solution possible but at least for me this is better than using only a single screen.

Changed 13 months ago by Klaas de Waal

Attachment: 20190206-video-aspect.patch added

FIx for video aspect ratio on multi-screen system that are seen as a single big screen.

comment:16 Changed 13 months ago by Peter Bennett

Description: modified (diff)
Resolution: Invalid
Status: closednew

Re-opened for consideration of the patch

Note: See TracTickets for help on using tickets.