"Use HDMI AVI signalling" video option should only be used at SD resolution

#1

We have a new option in the July update for playback of 4:3 video, in the Player settings: “Use HDMI AVI signalling”. This is a great addition for playing DVD remuxes - for the first time, we can now get the correct aspect ratio for both 4:3 and 16:9 material, with no loss of resolution, and the correct AR being selected automatically instead of having to do it manually.

But…

This is an option which only makes sense for standard-definition videos. If I’m playing (say) a 1440x1080 video, this option should be ignored, and the default should be to display the video pillar-boxed. This feature is needed for SD because SD video is generally 720x480/480 or 720x576/50, and it’s only the metadata which tells the playback device whether it is to be played at 16:9 or 4:3. But in the case of a 1440x1080 video, the aspect ratio is provided by the actual video data, and you don’t need to signal a 4:3 AR.

What my Vero 4K+ seems to be doing at the moment is to stretch the video to 1920x1080, then tell the playback device to display it with a 4:3 aspect ratio. The most visible consequence of this is that subtitles appear horizontally compressed. If it’s doing what I think it’s doing, there will also be some unnecessary horizontal upscaling going on (before the subtitles are added) - if so, that will compromise image quality a little.

I’ve always been dubious about Kodi applying the central 4:3 Playback settings to HD-resolution 4:3 videos; but it makes even less sense with the new option.

Where can I find out more information on system updates?
#10

Actually, if we’re being pedantic, it’s not the resolution of the video source that should control whether this setting is applied, it’s the output resolution. If, for whatever reason, 4:3 SD video is upscaled by the Vero to 1080p or 2160p, then pillarboxing it is the right way to go. It’s only when the actual output is 480i/p or 576i/p that we need to use HDMI signalling.

#11

There is content at 1080p in 4:3.

#12

Yes, it is precisely that content that is not being displayed correctly with the new setting.

#13

Correct. That’s not pedantic at all. By rights, TVs should ignore the a/r in the AVI infoframe for HD resolutions but it seems that’s not so. Also we didn’t have any subtitled content in that format to test so missed the double-scaling. Thanks for pointing it up.

1 Like
OSMC's July update is here
#14

Hello @grahamh (and others).

Having accidentally upgraded to a staging repository build a while back, I notice there’s been some more work done on this.

(I’m not sure if it’s appropriate to raise issues about staging repository builds - I appreciate that they are, by definition, works-in-progress, and so this may well be in hand already, but just in case it isn’t…).

Both SD and 1080p videos played at native resolution now work correctly, which is great. :heart_eyes: But the other day I was watching a 480i/60 DVD remux of something that had originally been shot on 24fps film. I’m very sensitive to 60Hz judder so, once it was playing, I switched output resolution to 1080p/24. The video played nicely, with no judder, but the Vero kept on telling the TV to run in 4:3 mode despite the output now being 1080p.

Ideally, whether you use aspect ratio signalling or pillar-boxing should depend on the resolution of the output signal, not on the resolution of the source file; and if you change output resolution during playback, it may need to switch strategies on the fly.

#15

Absolutely appropriate. That’s what staging is for :smiley:

I’m going to assume the source is flagged as 4:3.

Do you mean the output kept switching between 4:3 and 16:9 or it played the whole thing at 4:3?

I’ll check the code, but meanwhile the workaround is to just touch any of the video adjustments in the player context menu so that the video mode becomes ‘custom’ and that will disable AVI signalling.

#16

Correct.

You remember what was happening in the previous (mainline) release when playing a 1080p 4:3 video? That case is fixed, but an SD video upscaled to 1080p still has exactly the same problem.

(Specifically, it scales the video to 1920x1080 and then tells the TV to switch to 4:3; what it should do is scale to 1440x1080, fill in the rest of the image black, and set the TV to 16:9).

So yes, it plays at 4:3 the whole time, but the eventual aspect ratio is achieved the wrong way, and gives you double scaling.

#17

Hello again, @grahamh. Found another video today where the behaviour wasn’t as expected.

It’s displayed as 4:3 in the summary info:

When I play it, the Vero switches correctly to 576p output, but it doesn’t switch to 4:3.

Logs:

https://paste.osmc.tv/eruguyipur

Will post MediaInfo in a moment.

#18

MediaInfo for that file:

General
Unique ID                                : 242275555348179638326358259981396480041 (0xB644931E7A6C3180A379181FBF781029)
Complete name                            : E:\Video\TV\Mission Impossible (1966)\Mission Impossible Season 5\S5E03.The.Innocent.mkv
Format                                   : Matroska
Format version                           : Version 2
File size                                : 727 MiB
Duration                                 : 48 min 13 s
Overall bit rate                         : 2 107 kb/s
Encoded date                             : UTC 2010-01-28 14:58:24
Writing application                      : mkvmerge v3.0.0 ('Hang up your Hang-Ups') built on Dec 12 2009 15:20:35
Writing library                          : libebml v0.7.9 + libmatroska v0.8.1

Video
ID                                       : 10
Format                                   : MPEG-4 Visual
Format profile                           : Simple@L3
Format settings, BVOP                    : No
Format settings, QPel                    : No
Format settings, GMC                     : No warppoints
Format settings, Matrix                  : Default (H.263)
Codec ID                                 : V_MS/VFW/FOURCC / XVID
Codec ID/Hint                            : XviD
Duration                                 : 48 min 13 s
Bit rate                                 : 1 937 kb/s
Width                                    : 720 pixels
Height                                   : 538 pixels
Display aspect ratio                     : 4:3
Frame rate mode                          : Constant
Frame rate                               : 25.000 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Compression mode                         : Lossy
Bits/(Pixel*Frame)                       : 0.200
Stream size                              : 668 MiB (92%)
Writing library                          : XviD 1.2.1 (UTC 2008-12-04)
Default                                  : Yes
Forced                                   : No

Audio
ID                                       : 11
Format                                   : MPEG Audio
Format version                           : Version 1
Format profile                           : Layer 3
Format settings                          : Joint stereo / MS Stereo
Codec ID                                 : A_MPEG/L3
Codec ID/Hint                            : MP3
Duration                                 : 48 min 13 s
Bit rate mode                            : Constant
Bit rate                                 : 128 kb/s
Channel(s)                               : 2 channels
Sampling rate                            : 48.0 kHz
Compression mode                         : Lossy
Stream size                              : 44.2 MiB (6%)
Writing library                          : LAME3.98.2
Default                                  : Yes
Forced                                   : No

Text #1
ID                                       : 1
Format                                   : VobSub
Muxing mode                              : zlib
Codec ID                                 : S_VOBSUB
Codec ID/Info                            : Picture based subtitle format used on DVDs
Language                                 : Danish
Default                                  : Yes
Forced                                   : No

Text #2
ID                                       : 2
Format                                   : VobSub
Muxing mode                              : zlib
Codec ID                                 : S_VOBSUB
Codec ID/Info                            : Picture based subtitle format used on DVDs
Language                                 : English
Default                                  : No
Forced                                   : No

Text #3
ID                                       : 3
Format                                   : VobSub
Muxing mode                              : zlib
Codec ID                                 : S_VOBSUB
Codec ID/Info                            : Picture based subtitle format used on DVDs
Language                                 : Spanish
Default                                  : No
Forced                                   : No

Text #4
ID                                       : 4
Format                                   : VobSub
Muxing mode                              : zlib
Codec ID                                 : S_VOBSUB
Codec ID/Info                            : Picture based subtitle format used on DVDs
Language                                 : French
Default                                  : No
Forced                                   : No

Text #5
ID                                       : 5
Format                                   : VobSub
Muxing mode                              : zlib
Codec ID                                 : S_VOBSUB
Codec ID/Info                            : Picture based subtitle format used on DVDs
Language                                 : Dutch
Default                                  : No
Forced                                   : No

Text #6
ID                                       : 6
Format                                   : VobSub
Muxing mode                              : zlib
Codec ID                                 : S_VOBSUB
Codec ID/Info                            : Picture based subtitle format used on DVDs
Language                                 : Norwegian
Default                                  : No
Forced                                   : No

Text #7
ID                                       : 7
Format                                   : VobSub
Muxing mode                              : zlib
Codec ID                                 : S_VOBSUB
Codec ID/Info                            : Picture based subtitle format used on DVDs
Language                                 : Finnish
Default                                  : No
Forced                                   : No

Text #8
ID                                       : 8
Format                                   : VobSub
Muxing mode                              : zlib
Codec ID                                 : S_VOBSUB
Codec ID/Info                            : Picture based subtitle format used on DVDs
Language                                 : Swedish
Default                                  : No
Forced                                   : No

Text #9
ID                                       : 9
Format                                   : VobSub
Muxing mode                              : zlib
Codec ID                                 : S_VOBSUB
Codec ID/Info                            : Picture based subtitle format used on DVDs
Language                                 : English
Default                                  : No
Forced                                   : No
#19

So how am I supposed to render that? With a pixel aspect of 16/15 in a letterbox or one of 1.004 (=720/538*3/4)?

You do have a collection of weird non-standard resolutions.

#20

Almost anything would be an improvement on what it’s doing at the moment (which is downscaling horizontally and then keeping the TV in 16:9 mode to stretch it again). :slight_smile:

I would guess the best option (assuming 576p output) would be to display it as 720x538 and fill in 19 rows of black pixels top and bottom. (If you want to try doing that, I’ll tell you if it looks right or not!)

It’s possible that there are going to be too many combinations to handle them all automatically. Maybe we need a way to switch between signalling 16:9 and 4:3 manually? (As well as deciding what to do with the stretch manually).

#21

No, wait, I’m wrong. :man_facepalming: Sorry, @grahamh.

After thinking about it some more I realised the weird dimensions - 720x538 - most be an attempt to keep the 4:3 aspect ratio, but with square pixels. The best you can do here is avoid horizontal scaling with 576p output- there’s going to have to be some vertical scaling.

So, I was right when I said you should keep the horizontal resolution as 720 and signal 4:3 (instead of signalling 16:9 and downscaling, which is what it’s doing at the moment). But vertically, you’ll need to stretch from 538 to 576, not letterbox.

#22

Your two posts prove my point. When do we decide that a resolution has been chosen in a (misguided) attempt at coding square pixels? As long as we are sending 720x576 through hdmi it’s got to be 16/15 or 8/9 pixel aspect.

Your best bet could to set your screen to 1080 or 2160 and play the thing as ‘original size’. Something you wanted to be able to do IIRC. Does it distort with that setup?

#23

Playing it as “original size” at 1080p would work for me, yes. But I’m probably the only person in the world who likes to watch things not zoomed up to full screen :slight_smile: so you may need to figure out how to deal with videos like this for everybody else…

For full-screen viewing, regardless of whether the encode is attempting square pixels or not, what it’s doing at the moment (with 576p output) is wrong: it’s downscaling horizontally and setting the TV to 16:9 when it should be setting the TV to 4:3 and not scaling horizontally at all.

As regards vertical scaling in that mode, I think the user needs to be able to manually switch between letterboxing and vertical stretching. (I agree that it’s going to be impossible to always choose the correct approach automatically).

In the case where the video actually is letterboxed (e.g. it’s a non-anamorphic DVD of a cinema movie) then letterboxing will give you an output image with the Vero doing no scaling. In a case like my video, the Vero will have to do some vertical scaling, but not horizontal; so that’s still preferable to having the Vero upscale to full-screen 1080p or 2160p.

#24

P.S. I just noticed: playing this video with 576p output also results in part of the OSD ending up off the right-hand-edge of the screen (which, among other things, makes it hard to switch resolutions, because the “resolution” icon isn’t visible!).

EDIT: Just tried it again after rebooting and now the OSD is fine! WTF?! Well, ignore that for now. If it does that again, I’ll let you know.

#25

Come to think of it, there is one problem with doing that: subtitles. If the video has DVD-type subtitles (image-based, not text-based) then shrinking the video to “original size” doesn’t shrink the subtitles, so you end up with a small picture and gigantic subtitles displayed well below the picture.

#26

You sound like someone in need of a keymap with…

	<fullscreenvideo>
		<keyboard>
			<key id="251">aspectratio</key>
			<key id="252">playerresolutionselect</key>
			<key id="253">increasepar</key>
			<key id="254">decreasepar</key>
		</keyboard>
	</fullscreenvideo>