2013-05-08

I will shortly file a formal bug report on this, but I also wanted to present this issue here, in case someone has additional relevant input they want to add which should go into my bug report.

I have spent some considerable time now attempting to research and understand this issue. I think that I understand what the issue is, but my understanding is limited and I'll be the first to say that may have misunderstood the whole bloody thing. So please do jump in if you have better information.

First allow me to say that is is arguably not an actual bug, however I personally feel that it unambiguously is. It all depends on one's point of view. If one accepts the premise that the behavior of the Microsoft-supplied Windows Media Player is THE definitive guide to how Windows Media Video (WMV) files should be played/presented, even in cases where the behavior of WMP seems either inexplicable or nonsensical, then yes, this is definitely a bug. Otherwise, if you do not accept that premise, then it could perhaps be argued that what I am about to report is not a bug, EVEN THOUGH it is quite obvious, visually, that a failure to be quirk-for-quirk compatible with WMP may cause certain WMV files to be displayed incorrectly by XBMC.

In a nutshell, as I understand it, WMV files (aka "ASF containers") may optionally contain in their "metadata" a pair of optional data fields that, taken together, specify the relative height and width that each (nominally square) pixel stored in the video stream should actually be displayed with. These two parameters, taken together, are referred to as the "pixel aspect ratio", and when these optional parameters are present, each of the actually stored pixels is supposed to be squeezed or stretched, horizontally or vertically, before it is actually displayed, so that when it is actually displayed, it will appear to have a width/height ratio equal to the specified pixel aspect ratio.

Now, consider the question of what SHOULD happen in cases where a given (ASF) .WMV file DOES NOT contain any explicit pixel aspect ratio parameters in its metadata. In such a case, it would be eminently reasonable for any media player to assume that the reason these parameters are missing is because they weren't needed, and that they weren't needed because the pixel aspect ratio was simply 1:1, i.e. each stored pixel should be displayed as if it were perfectly square, with no extra adjustment needed.

Those would seem to be perfectly reasonable assumptions in the absence of any explicit pixel aspect ratio parameters in the file. Unfortunately, it appears that they might also be wrong.

As I've said above, and as I will repeat again now, I could be perfectly wrong about all of this, but it does appear to me, based on a few simple tests I've run, that in the absence of any explicit pixel aspect ratio parameters in the .WMV file metadata, Windows Media Player, in particular (well... Version 12 at least, which is all I tested), seems to be making a default assumption that actual final display aspect ratio of the file you're looking at ought to be widescreen (16:9), and that thus, WMP just makes up, on the fly, whatever pixel aspect ratio is necessary in order to take the video stream that is actually stored in the file in question and squeeze or stretch all of the pixels thereof, as necessary, until it gets to a 16:9 aspect ratio.

(Aside: The specific files where I have seen this happen seem to be badly done conversions from original DVD files. I've seen many widescreen .WMV files where the _stored_ video stream has dimensions of 850:480 or close to that, which is already 16:9 and thus suitable for widescreen viewing without any squeezing or stretching of the stored pixels. However the files that I am seeing that are problematic appear to to have 720:480 stored aspect ratios... or 3;2, the same as stored DVD video streams. But as I say, the problem files also fail to contain any explicit pixel aspect ratio parameters.)

The bottom line is that for .WMV files that do not contain any explicit pixel aspect ratio parameters, it appears to me that the following players just go ahead and assume that these videos, when displayed, should come out in widescreen 16:9 aspect ratio, so they all implicitly and automagically apply pixel aspect ratio adjustments, as needed, to make the videos display that way:

Windows Media Player (Microsoft)

MPC-HC

MPC-BE

Cyberlink PowerDVD 10

In contrast to the above players, the following list of players all appear to me to be displaying .WMV files that contain no explicit pixel aspect ratio parameters "as is", in other words as if each stored pixel were perfectly square (1:1):

XBMC

VLC

mplayer

smplayer

Sony BDP-BX18 Blu-Ray player **

LG BD670 Blu-Ray player **

(Certainly, as the results above indicate, nobody on the XBMC team should feel in the least bit embarrassed about this "bug", given the fact that even major international home electronics companies that are spending untold gobs of money on product development didn't catch this subtle and unexpected Microsoft-manufactured oddity relating to .WMV file PARs either.)

** These are only the specific Blu-Ray player models that I tested and that I happen to have access to. However I suspect that it would be reasonable to assume that this bug is most probably present in the entire Blu-Ray and media player product lines of these two companies. That would be expected, e.g. if these companies are in the habit of always leveraging their existing firmware for each succeeding generation of player models.

Anyway, the bottom line here is that certain (arguably badly authored) .WMV files whose content is meant to be displayed widescreen play perfectly well in Windows Media Player, but if you take those same files and try to play them with XBMC (or VLC, or mplayer, or SMplayer, or probably the majority of the Blu-Ray or media players you can buy at either Best Buy or Amazon) then the pixels will instead come out "as is" and if the stored video stream DOES NOT already have a 16:9 aspect ratio, then it it going to be played (by XBMC and the others) in a way that makes it look either unnaturally stretched or unnaturally squeezed AND it will be either letterboxed or pillarboxed, even though it really shouldn't be. We could smugly say that any and all such playback anomalies are the fault of the files in question, and not really XBMCs fault, and we would be right to do so, but typical end lusers will not understand any of this stuff, and when they see Windows Media Player playing the files perfectly and then XBMC apparently botching the playback, they ARE going to blame XBMC... unfairly, I agree, but they will do it anyway. For this reason I think that this should be considered a "bug" and that in this case XBMC should be made quirk-for-quirk compatible with the behavior of Windows Media Player.

Additional information is available here:

http://blog.komeil.com/2007/01/modify-as...ratio.html

Careful readers will note that a free software tool is available which can add in a missing set of pixel aspect ratio parameters to an existing .WMV file, however for the above reasons, I personally do not think that this fact should be used as a crutch, and that Team XBMC would do welll to fix this "bug" anyway.

Meanwhile, I'm sure that once I let both LG and Sony know about this bug, which probably spans their entire respective product lines, I'm sure that their crack teams of end-luser support specialists will understand the problem immediately, and that they will then set their respective crack teams of firmware developers to work immediately to develop and release new firmware revisions for my my already bought and paid for Blu-Ray players so as to correct these problems....

... or, ah, maybe not.

(Actually, when I was reporting some different bugs, I was told explicitly by one Sony end-luser support minion that if I wanted a firmware fix for a Sony Blu-Ray player that they had already banked my payment for, my ONLY hope was to purchase a brand new player. No, I'm not kidding. Once they have your money, why should they bother fixing the firmware? Separately, when, by hook and by crook, I managed to get an actual mostly secret phone number for LG product support, and when the first level support guy refused to accept more than one bug report on the one LG Blu-Ray player I had, I asked to speak to a manager, who got on the line, said "hello" and then promptly hung up. Such is the state of customer support, here in the second decade of the 21st century.)

Show more