Chromecast and browser not scaling anamorphic widescreen correctly

Server Version#: Version 1.19.5.3112
Player Version#: dunno how to check for chromecast or plex web

I recently ripped a bunch of my DVDs to h264 mkv files and I noticed that the files are not properly scaling to 16:9 on chromecast and plex web. The desktop application ( Version 1.15.1.1358-43550df5) displays the videos correctly in 16:9.

I checked in MKVToolNix GUI and made sure that the display resolution is properly set to 853x480 for the affected videos.

The only difference I can see is that the videos are playing back as “direct stream” for chromecast and browser instead of “direct play” for the desktop app. I think it’s likely the anamorphic widescreen info is being dropped when the video/audio streams are being extracted from the mkv and muxed into the direct stream container.

Plex doesn’t use the display resolution tag. It uses the actual resolution of the encode and the encoded aspect ratio. Please provide the XML from PMS so I can check.

I’m not aware of there being an explicit aspect ratio tag in MKV containers. To my understanding it’s derived from display width and display height?

Here’s the xml, it correctly displays the pixel width and height but not the coded width and height as configured in the container.

<MediaContainer size="1" allowSync="1" identifier="com.plexapp.plugins.library" librarySectionID="2" librarySectionTitle="TV Shows" librarySectionUUID="4c94f9e0-6846-489b-845d-9119de682e6f" mediaTagPrefix="/system/bundle/media/flags/" mediaTagVersion="1595225926">
<Video ratingKey="39681" key="/library/metadata/39681" parentRatingKey="39680" grandparentRatingKey="39676" guid="com.plexapp.agents.thetvdb://79099/1/1?lang=en" parentGuid="com.plexapp.agents.thetvdb://79099/1?lang=en" grandparentGuid="com.plexapp.agents.thetvdb://79099?lang=en" type="episode" title="Role Play" grandparentKey="/library/metadata/39676" parentKey="/library/metadata/39680" librarySectionTitle="TV Shows" librarySectionID="2" librarySectionKey="/library/sections/2" grandparentTitle=".hack//" parentTitle=".hack//SIGN" contentRating="TV-PG" summary="The show starts with a wavemaster (named Tsukasa) lying on the ground, when he gets up, he is unsure of his surroundings. Soon a female heavy blade introduces herself as Mimiru and comments on the fact that very rarely do you see a wavemaster working alone. She assumes that he is very strong. As she looks at his staff, he teleports out of the area. Back in the field, Tsukasa is sitting alone against a well. He talks to himself saying that he did not know what he was doing, or where he was in fact. From the horizon three knights approach and they are investigating the fact that he was seen with a character that looked like a cat. Instead of supplying the warriors with information the wavemaster teleports out of the area. Now in Mac Anu (the city of water) a young female heavy axeman (named Subaru) is talking to one of the Crimson Knights. They are discussing recent issues in ""The World"" and problems that keep arising. As she moves down toward the center of the boat, they pass Tsu" index="1" parentIndex="1" rating="7.4" year="2002" thumb="/library/metadata/39681/thumb/1595972254" art="/library/metadata/39676/art/1595909868" parentThumb="/library/metadata/39680/thumb/1595909866" grandparentThumb="/library/metadata/39676/thumb/1595909868" grandparentArt="/library/metadata/39676/art/1595909868" grandparentTheme="/library/metadata/39676/theme/1595909868" duration="1423506" originallyAvailableAt="2002-04-04" addedAt="1595581154" updatedAt="1595972254" chapterSource="media">
<Media id="34918" duration="1423506" bitrate="2905" width="710" height="480" aspectRatio="1.78" audioChannels="2" audioCodec="ac3" videoCodec="h264" videoResolution="480" container="mkv" videoFrameRate="24p" videoProfile="high">
<Part accessible="1" exists="1" id="36152" key="/library/parts/36152/1595923040/file.mkv" duration="1423506" file="F:\Media Share\TV Shows\dotHack\Season 01\01 - Roleplay.mkv" size="516824786" container="mkv" deepAnalysisVersion="4" requiredBandwidths="11320,8940,8127,8127,8127,8127,8127,8127" videoProfile="high">
<Stream id="51675" streamType="1" default="1" codec="h264" index="0" bitrate="2329" language="English" languageCode="eng" anamorphic="1" bitDepth="8" chromaLocation="left" chromaSubsampling="4:2:0" codedHeight="480" codedWidth="720" frameRate="23.976" hasScalingMatrix="0" height="480" level="41" pixelAspectRatio="173:144" profile="high" refFrames="4" requiredBandwidths="10731,8352,7617,7617,7617,7617,7617,7617" scanType="progressive" title="x264, CRF14 (R1 DVD)" width="710" displayTitle="480p (H.264)" extendedDisplayTitle="x264, CRF14 (R1 DVD) (480p H.264)"/>
<Stream id="51676" streamType="2" codec="ac3" index="1" channels="2" bitrate="192" language="日本語" languageCode="jpn" audioChannelLayout="stereo" requiredBandwidths="192,192,192,192,192,192,192,192" samplingRate="48000" title="AC3, 2.0" displayTitle="日本語 (AC3 Stereo)" extendedDisplayTitle="AC3, 2.0 (日本語)"/>
<Stream id="51677" streamType="2" selected="1" default="1" codec="ac3" index="2" channels="2" bitrate="192" language="English" languageCode="eng" audioChannelLayout="stereo" requiredBandwidths="192,192,192,192,192,192,192,192" samplingRate="48000" title="AC3, 2.0" displayTitle="English (AC3 Stereo)" extendedDisplayTitle="AC3, 2.0 (English)"/>
<Stream id="51678" streamType="2" codec="ac3" index="3" channels="2" bitrate="192" language="English" languageCode="eng" audioChannelLayout="stereo" requiredBandwidths="192,192,192,192,192,192,192,192" samplingRate="48000" title="Isolated Score" displayTitle="English (AC3 Stereo)" extendedDisplayTitle="Isolated Score (English AC3 Stereo)"/>
<Stream id="51679" streamType="3" codec="vobsub" index="4" language="English" languageCode="eng" headerCompression="1" requiredBandwidths="6,6,6,6,6,6,6,6" title="VobSub" displayTitle="English (VOBSUB)" extendedDisplayTitle="VobSub (English)"/>
<Stream id="51680" streamType="3" codec="vobsub" index="5" language="English" languageCode="eng" headerCompression="1" requiredBandwidths="6,6,6,6,6,6,6,6" title="VobSub, Slates" displayTitle="English (VOBSUB)" extendedDisplayTitle="VobSub, Slates (English)"/>
<Stream id="51681" streamType="3" codec="ass" index="6" language="English" languageCode="eng" requiredBandwidths="1,1,1,1,1,1,1,1" title="ASS - [AHQ]" displayTitle="English (ASS)" extendedDisplayTitle="ASS - [AHQ] (English)"/>
<Stream id="51682" streamType="3" default="1" codec="ass" index="7" language="English" languageCode="eng" requiredBandwidths="1,1,1,1,1,1,1,1" title="ASS, Slates - [AHQ]" displayTitle="English (ASS)" extendedDisplayTitle="ASS, Slates - [AHQ] (English)"/>
<Stream id="51683" streamType="3" codec="srt" index="8" language="English" languageCode="eng" requiredBandwidths="1,1,1,1,1,1,1,1" title="SRT - [a-s]" displayTitle="English (SRT)" extendedDisplayTitle="SRT - [a-s] (English)"/>
</Part>
</Media>
<Writer id="20872" filter="writer=20872" tag="Akemi Omode"/>
<Writer id="20873" filter="writer=20873" tag="Kazunori ItĂ´"/>
<Producer id="20874" filter="producer=20874" tag="Kuninori Egawa"/>
<Chapter id="1635" filter="thumb=1635" index="1" startTimeOffset="0" endTimeOffset="95400" thumb="/library/media/34918/chapterImages/1"/>
<Chapter id="1635" filter="thumb=1635" index="2" startTimeOffset="95400" endTimeOffset="659167" thumb="/library/media/34918/chapterImages/2"/>
<Chapter id="1635" filter="thumb=1635" index="3" startTimeOffset="659167" endTimeOffset="1330434" thumb="/library/media/34918/chapterImages/3"/>
<Chapter id="1635" filter="thumb=1635" index="4" startTimeOffset="1330434" endTimeOffset="1420868" thumb="/library/media/34918/chapterImages/4"/>
<Chapter id="1635" filter="thumb=1635" index="5" startTimeOffset="1420868" endTimeOffset="1421268" thumb="/library/media/34918/chapterImages/5"/>
<Chapter id="1635" filter="thumb=1635" index="6" startTimeOffset="1421268" endTimeOffset="1421668" thumb="/library/media/34918/chapterImages/6"/>
<Chapter id="1635" filter="thumb=1635" index="7" startTimeOffset="1421668" endTimeOffset="1423506"/>
<Extras size="0"> </Extras>
<Related> </Related>
</Video>
</MediaContainer>

E: This is what MKVToolNix GUI shows me for the video stream when I open the same file

Ok, I just opened the file in mediainfo and I noticed that the video stream has a correct display aspect ratio field displaying 16:9 but also has an “original display aspect ratio” field set to 3:2, which matches the incorrect aspect ratio in chromecast and plex web.

ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L4.1
Format settings                          : CABAC / 4 Ref Frames
Format settings, CABAC                   : Yes
Format settings, Reference frames        : 4 frames
Codec ID                                 : V_MPEG4/ISO/AVC
Duration                                 : 23 min 43 s
Bit rate                                 : 2 271 kb/s
Width                                    : 710 pixels
Height                                   : 480 pixels
Display aspect ratio                     : 16:9
Original display aspect ratio            : 3:2
Frame rate mode                          : Constant
Frame rate                               : 23.976 (24000/1001) FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.278
Stream size                              : 385 MiB (78%)
Title                                    : x264, CRF14 (R1 DVD)
Writing library                          : x264 core 80 r1376M 3feaec2
Encoding settings                        : cabac=1 / ref=4 / deblock=1:-3:-3 / analyse=0x3:0x113 / me=umh / subme=9 / psy=1 / psy_rd=1.0:0.0 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=6 / sliced_threads=0 / nr=0 / decimate=0 / mbaff=0 / constrained_intra=0 / bframes=3 / b_pyramid=0 / b_adapt=2 / b_bias=0 / direct=3 / wpredb=1 / wpredp=2 / keyint=250 / keyint_min=25 / scenecut=40 / rc_lookahead=40 / rc=crf / mbtree=1 / crf=14.0 / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / vbv_maxrate=38000 / vbv_bufsize=30000 / ip_ratio=1.40 / aq=1:1.00
Language                                 : English
Default                                  : Yes
Forced                                   : No
Duration_Source                          : General_Duration

Edit: I have produced ~3MB a sample video that displays this issue, it displays properly in the desktop plex app and at 3:2 aspect ratio in plex web. https://drive.google.com/file/d/1T5gPTfuid2L6Iq_b0XwcDiDOCbGLQLZo/view?usp=sharing

Your first file looks correct. It has an encoded resolution of 720x480 with pixel ratio of 173:144 which effectively makes it 853x480 which should play at that resolution.

Let me try your sample and see what I get.

Huh. Your sample wouldn’t play for me. I remuxed it and it now plays and I can reproduce the issue with Web. I’m checking if this is a bug or a limitation of the app.

This is a very interesting discussion about Display Aspect Ratio and Original Display Aspect Ratio including comments from the author of mediainfo.

https://sourceforge.net/p/mediainfo/discussion/297610/thread/5c5de6d2/

He states that he displays both values when they differ because it indicates a potential issue with the file.

1 Like

Exactly. These values are suppose to be set when encoded, but tools allow users to edit them to try and force a change since they don’t want to re-encode the file. Some players will allow this, others don’t. Plex does not and assumes the encoded version is correct. However, the values in the sample I got were correct so the Plex app should have used the correct aspect ratio. Still waiting to hear back from the team.

Thank you for being so helpful! I’m going to be re-ripping this DVD anyway as I don’t think the source was 24fps (which I only noticed once I got digging in mediainfo) so I probably messed up a setting along the way, my bigger concern is obviously the discrepancy - it seems that if the file is indeed set up wrong it should display the same squished image in both desktop and on streaming players, rather than properly scaling it on desktop.

Keep in mind that some players, looking at your browser based ones, are still quite limited on their video playback capabilities. It may not physically be able to playback at anything other than the actual resolution. For browsers, this could also depend on the browser.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.