Metadata aspect ratio incorrect on TV Show

Server Version#: 1.16.1.1291
Player Version#: N/A
I just added a new television show to my server. However, after inspection I noticed the display aspect ratio is listed in the metadata as 1.85 when it is actually 2.00. I think this is affecting the display of the video on Roku clients.

Here’s the XML output from the metadata:
<Media id=“32250” duration=“2952448” bitrate=“1045” width=“1024” height=“512” aspectRatio=“1.85” audioChannels=“2” audioCodec=“aac” videoCodec=“h264” videoResolution=“576” container=“mp4” videoFrameRate="24p"optimizedForStreaming=“0” audioProfile=“lc” has64bitOffsets=“0” videoProfile=“high”>

<Part accessible=“1” exists=“1” id=“32265” key="/library/parts/32265/1562438809/file.mp4" duration=“2952448” file="/shares/Television/Strange Angel/Season 2/Strange Angel - S02E01 - The Fool.mp4" size="385846712"audioProfile=“lc” container=“mp4” has64bitOffsets=“0” optimizedForStreaming=“0” videoProfile=“high”>

<Stream id=“65432” streamType=“1” default=“1” codec=“h264” index=“0” bitrate=“944” bitDepth=“8” chromaLocation=“left” chromaSubsampling=“4:2:0” frameRate=“24.000” hasScalingMatrix=“0” height=“512” level="31"profile=“high” refFrames=“8” streamIdentifier=“1” width=“1024” displayTitle=“480p (H.264)”/>

Here’s the mediainfo output for the same video:
General
Complete name : Strange Angel - S02E01 - The Fool.mp4
Format : MPEG-4
Format profile : Base Media
Codec ID : isom
File size : 368 MiB
Duration : 49mn 12s
Overall bit rate : 1 045 Kbps
Writing application : Lavf58.27.100

Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L3.1
Format settings, CABAC : Yes
Format settings, ReFrames : 8 frames
Format settings, GOP : N=1
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 49mn 12s
Bit rate : 944 Kbps
Width : 1 024 pixels
Height : 512 pixels
Display aspect ratio : 2.000
Frame rate mode : Constant
Frame rate : 24.000 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.075
Stream size : 332 MiB (90%)

Audio
ID : 2
Format : AAC
Format/Info : Advanced Audio Codec
Format profile : LC
Codec ID : 40
Duration : 49mn 12s
Bit rate mode : Constant
Bit rate : 96.0 Kbps
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 48.0 KHz
Compression mode : Lossy
Stream size : 33.8 MiB (9%)

1024x512 is 2:1 or 2.000, as MediaInfo correctly identifies it and 3rd grade math proves.

Clearly Plex is throwing in so many identifiers, I’m surprised it doesn’t display up-side-down. If it isn’t displaying up-side-down you should correctly see a bit of a letterbox top and bottom on a standard wide screen display (16:9).

To correctly package that particular video it should be stored at 720x576, be identified as 576p (it is, I think), but display at 1024x512 by the time you get it cropped properly (that too should be happening, but not the right way).

The video has no anamophic settings, even though it requires same as it’s Standard Definition DVD material, but packed up like HD material. That’s bound to cause some confusion. The confusion gets interesting when in one section it’s 576 and in another it’s 480… so which is it? Only The Shadow Knows that if it’s more than 480 and less than 720 it pretty much has to be 576.

On the one hand Plex doesn’t know quite what to do with it and on the other hand it’s encoded poorly - to say the very least - so it’s a bit of one and a bit of another.

If it’s displaying properly - a bit of letterboxing top and bottom - try to get over the fact that Plex is dumbstruck by it. That’ll happen often. Try to overlook it but in this case Plex may be doing the best it can with what it has to work with.

Thanks for your input!

Well, the guy that encoded it was me and I assure you I certainly do know what I’m doing. It was reduced in size from 1280x640 to 1024x512. using ffmpeg. That’s not that unusual and I’ve done it plenty of times before and Plex has always set the aspect ratio properly in the metadata. An aspect ratio of 2:1 is not that uncommon and it shouldn’t be difficult for Plex to set it correctly in the Metadata.

Clearly there is something else going on here. I just upgraded the server to the latest version of Plex and now all of a sudden I’m having these problems.

Btw, it displays fine if I play it from the Plex webpage interface. However, on Roku it is messed up. It displays like it is a 16:9 aspect; however, the sides of the picture are cropped off.

Yep. In order to get the full height and keep the original aspect ratio the sides have to be cropped. I can’t tell you why Roku is having trouble with the display.

I have 10s of thousands of DVD Standard Definition 4:3, 16:9, 2:1 or Lawrence of Arabia (Way Wide and Vertically Challenged) Letterboxed items that display perfectly on everything I own, including my Rokus that go all the way back to a Roku2HD.

DVD material is stored at 720x480 (or in your case 720x576) and then displayed according to the anamorphic display settings encoded into the file. There is no other way to do it - unless you do it wrong - and if that’s the case, the Roku app will, apparently, fumble it - perhaps because it’s being transcoded and when Plex transcodes Standard Definition they encode 720x400 (16:9) - or whatever that equates to for PAL. Cheap, Dirty, but effective, albeit sucking the life out of the original material by removing 80 lines of vertical resolution right from jump street.

I’m going to try to avoid that - at all costs. There’s nothing wrong with Standard Definition - as long as you can get everything in the file to the TV. When you throw a lot of it away before you even get started, that’s probably a bad thing.

All I know is properly encoded materials display fine in anything I play them on. The Roku team may find a problem, and be able to fix it, but for my part I’ll just go on doing it right because that seems to work for me at this time.

Well, I’m mainly concerned why Plex is not setting the aspect ratio
properly in the metadata. Why is it set to 1.85:1 when clearly it
is 2.00:1. I don’t know for sure that it is affecting the Roku
player; however, it is certainly not correct and needs to be looked
at by the Plex developers. Thanks!

I won’t disagree with that.

Is the file in direct play when the oddness happens?

Yes, the file is in direct play.

Here’s an ffprobe dump of the stream in question. I don’t see any reason Plex should set metadata to 1.85:1 for this file…

[STREAM]
index=0
codec_name=h264
codec_long_name=H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
profile=High
codec_type=video
codec_time_base=1/48
codec_tag_string=avc1
codec_tag=0x31637661
width=1024
height=512
coded_width=1024
coded_height=512
has_b_frames=2
sample_aspect_ratio=1:1
display_aspect_ratio=2:1
pix_fmt=yuv420p
level=31
color_range=unknown
color_space=unknown
color_transfer=unknown
color_primaries=unknown
chroma_location=left
field_order=unknown
timecode=N/A
refs=1
is_avc=true
nal_length_size=4
id=N/A
r_frame_rate=24/1
avg_frame_rate=24/1
time_base=1/12288
start_pts=0
start_time=0.000000
duration_ts=36275712
duration=2952.125000
bit_rate=944001
max_bit_rate=N/A
bits_per_raw_sample=8
nb_frames=70855
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=1
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
DISPOSITION:timed_thumbnails=0
TAG:language=und
TAG:handler_name=VideoHandler
[/STREAM]

A’ight…

I don’t have any SD PAL material (if you can believe it), but I did take my letterboxed Dune, run it into Handbrake for a smack-down to 480p. I often do this very thing, put the results on a flash drive and send them to a friend that can only use DVD stuff in this little player he has… anyway…

Plex XML:

<Media id="49806" duration="240548" bitrate="1832" width="720" height="480" aspectRatio="2.35" audioChannels="6" audioCodec="ac3" videoCodec="h264" videoResolution="480" container="mkv" videoFrameRate="24p" videoProfile="high">
<Part accessible="1" exists="1" id="54638" key="/library/parts/54638/1562509761/file.mkv" duration="240548" file="G:\Other Videos\Dune (1984) [1080p Extended]_preview.mkv" size="55099962" container="mkv" indexes="sd" videoProfile="high">
<Stream id="101858" streamType="1" default="1" codec="h264" index="0" bitrate="1448" anamorphic="1" bitDepth="8" chromaLocation="left" chromaSubsampling="4:2:0" colorPrimaries="bt709" colorRange="tv" colorSpace="bt709" colorTrc="bt709" frameRate="23.976" hasScalingMatrix="0" height="480" level="41" pixelAspectRatio="8:5" profile="high" refFrames="4" scanType="progressive" width="720" displayTitle="480p (H.264)"/>
<Stream id="101859" streamType="2" selected="1" default="1" codec="ac3" index="1" channels="6" bitrate="384" language="English" languageCode="eng" audioChannelLayout="5.1(side)" samplingRate="48000" title="Surround" displayTitle="English (AC3 5.1)"/>
<Stream id="101860" streamType="3" codec="ass" index="2" language="English" languageCode="eng" displayTitle="English (ASS)"/>

MediaInfo:

General
Unique ID                                : 48989254456920171986151312518780439039 (0x24DAFCB9DF2F5E75C713CE92E80249FF)
Complete name                            : D:\Handbrake Dumps\Dune (1984) [1080p Extended]_preview.mkv
Format                                   : Matroska
Format version                           : Version 4 / Version 2
File size                                : 52.5 MiB
Duration                                 : 4 min 0 s
Overall bit rate                         : 1 832 kb/s
Encoded date                             : UTC 2019-07-07T14:28:30Z
Writing application                      : HandBrake 1.1.0 2018040700
Writing library                          : Lavf57.7.2

Video
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, RefFrames               : 4 frames
Codec ID                                 : V_MPEG4/ISO/AVC
Duration                                 : 4 min 0 s
Bit rate                                 : 1 450 kb/s
Width                                    : 720 pixels
Height                                   : 480 pixels
Display aspect ratio                     : 2.40:1
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.175
Stream size                              : 40.5 MiB (77%)
Writing library                          : x264 core 155 r2893 b00bcaf
Encoding settings                        : cabac=1 / ref=4 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=12 / lookahead_threads=2 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=240 / keyint_min=24 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=2pass / mbtree=1 / bitrate=1450 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / vbv_maxrate=62500 / vbv_bufsize=78125 / nal_hrd=none / filler=0 / ip_ratio=1.40 / aq=1:1.00
Default                                  : Yes
Forced                                   : No
Color range                              : Limited
Color primaries                          : BT.709
Transfer characteristics                 : BT.709
Matrix coefficients                      : BT.709

The Handbrake anamophic settings I used to achieve this smack-down SD version (the same way I’ve been doing it for… a LONG time):

… and because we love these things (I will take a Vertical cell phone pic on request) - a cell phone image of a correctly displayed SD Dune Clip in my Other Videos Library displayed on the old (new) Roku Ultra (and all the other Rokus and Plex apps including RARflix - with a full 480p for me and my unfortunate friend with a little junky player):

Now, that’s not to say the Roku team doesn’t need to take a look, but a correctly encoded file will display correctly with the current Roku Uno App - as well as everything else I own or provide content for.

Yep, I’ve got other files that have the aspect ratio set perfectly
as well. Here’s one for instance:

Plex XML:

<Media id=“29739” duration=“3699381” bitrate=“887” width=“1024” height=“460” aspectRatio**=“2.20”** audioChannels=“2” audioCodec=“aac” videoCodec=“h264” videoResolution=“576” container=“mp4” videoFrameRate="24p"optimizedForStreaming=“0” audioProfile=“lc” has64bitOffsets=“0” videoProfile=“high”>

<Part accessible=“1” exists=“1” id=“29740” key="/library/parts/29740/1554427685/file.mp4" duration=“3699381” file=" /shares/Television/Chilling
Adventures of Sabrina/Season 1/Chilling Adventures of
Sabrina - S01E01 - Chapter One- October Country.mp4" size=“412656749” audioProfile=“lc” container=“mp4” deepAnalysisVersion=“3” has64bitOffsets=“0” optimizedForStreaming=“0” requiredBandwidths="2716,2716,2716,2716,2716,2716,2716,2716"videoProfile=“high”>

<Stream id=“59915” streamType=“1” default=“1” codec=“h264” index=“0” bitrate=“790” anamorphic=“0” bitDepth=“8” chromaLocation=“left” chromaSubsampling=“4:2:0” frameRate=“23.976” hasScalingMatrix=“0” height="460"level=“31” pixelAspectRatio=“2553:2560” profile=“high” refFrames=“8” requiredBandwidths=“2629,2629,2629,2629,2629,2629,2629,2629” streamIdentifier=“1” width=“1024” displayTitle=“480p (H.264)”/>

<Stream id=“59916” streamType=“2” selected=“1” default=“1” codec=“aac” index=“1” channels=“2” bitrate=“97” audioChannelLayout=“stereo” profile=“lc” requiredBandwidths=“98,98,98,98,98,98,98,98” samplingRate="48000"streamIdentifier=“2” displayTitle=“Unknown (AAC Stereo)”/>

    In this case the video aspect is set correctly to 2.20:1 in the

metadata and the video plays perfectly in Roku.

    **Plex devs:** Please step up and help on this!!!

    Thanks for your help JuiceWSA!

Shucks, Man… I love this stuff.

Hope Ya’ll get it worked out.

**BUMP**
This is not resolved yet. Can anyone help with issue please? Thanks!

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