Roku ignores aspect ratio flag when direct playing

Server Version#: 1.20.4.3517
Player Version#:Roku Ultra

My problem is that Roku will ignore the correct aspect ratio if it differs from the “original aspect ratio” with “direct play” enabled.

Long story short, I have some videos where I had to edit the MKV headers to set the correct aspect ratio as it was wrong after encoding.

If I force a transcode of the video it will pick up the new AR flag and play correctly. I really don’t want to have to do this though as Roku is very sluggish when receiving transcoded video.

Can Plex or Roku devs make a change where the “display aspect ratio” is picked over “original display aspect ratio” when direct playing?

I have copied two examples below to show what I mean:

Example 1 displays 1.385 not 4:3:
Video
ID : 1
Format : HEVC
Format/Info : High Efficiency Video Coding
Format profile : Main 10@L4@Main
Codec ID : V_MPEGH/ISO/HEVC
Duration : 24 min 56 s
Bit rate : 3 382 kb/s
Width : 1 496 pixels
Height : 1 080 pixels
Display aspect ratio : 4:3
Original display aspect ratio : 1.385
Frame rate mode : Constant
Frame rate : 23.976 (24000/1001) FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 10 bits
Bits/(Pixel*Frame) : 0.087

Example 2 displays 1.025 not 1.37:
Video
ID : 1
Format : HEVC
Format/Info : High Efficiency Video Coding
Format profile : Main 10@L4@Main
Codec ID : V_MPEGH/ISO/HEVC
Duration : 9 min 3 s
Bit rate : 2 500 kb/s
Width : 1 476 pixels
Height : 1 080 pixels
Display aspect ratio : 1.370
Original display aspect ratio : 1.025
Frame rate mode : Constant
Frame rate : 23.976 (24000/1001) FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 10 bits
Bits/(Pixel*Frame) : 0.065

Can you provide the XML from PMS for those 2 videos? Investigate Media Information and Formats | Plex Support

Those are interesting pixel sizes and aspect ratios. Is this 4:3 content ripped from Blu-ray? That’s a common scenario for aspect ratio problems. If it is an option, I would revisit the ripping process.

IIRC, mediainfo displays the “Original display aspect ratio” only to indicate that there’s a discrepancy between the aspect ratio of the video stream and the notes stored in the container. I think that’s not supposed to happen - they should match.

It sounds like when you do Direct playback, the ratio from the stream is used (which makes sense). But when you force a transcode, the ratio from the container is used (which also makes some sense).

Edit - notes from the mediainfo author:

MediaInfo / Discussion / Help: What is "Original display aspect r...

Yes absolutely, have attached them here: Complete.7z (3.1 KB)

As @volts pointed out, it looks like direct play is only picking up the raw video stream aspect ratio, not the aspect ratio I have set at the MKV container level.

I’m not sure that re-encoding is an option so please tell me if I can change something else in the metadata to flag it properly for Plex.

Please let me know if I can provide any more information.

Thanks in advance.

Yep, spot on, 4:3 content ripped from both Blu-ray and Web. I can’t change anything to do with the ripping process unfortunately but am hoping there’s another metadata field I can tweak to get Plex to do what I want.

You mentioned that forcing transcoding produces correct output. Have you considered using Plex’s “Optimize…” to pre-transcode these? I don’t know how much you care about maximizing video quality, vs. having a watchable copy.

It’s possible to edit the stream-level SAR without re-encoding.

ffmpeg -i input.mkv -acodec copy -bsf:v "hevc_metadata=sample_aspect_ratio=.88" -vcodec copy output.mkv

But without some testing I’m not confident in the right values. Can you share the files or samples from them?

AFAIK, Roku devices can not scale the content. It will playback the video at the resolution it is encoded. When you force a transcode, PMS is changing the resolution for the Roku.

Hi there @Volts sorry it’s taken me so long to get back to you, hope you’re still around.

“Optimize” is a good idea although I’d rather just turn “direct play” and “direct stream” off and have Plex transcode on the fly.

I have taken a sample of one of the files in question. How do I send this to you? I can make it any size or duration. I’m not very good with using command line ffmpeg but have some GUIs I could use as tools.

PM me if you need.

Dropbox, Google Drive, OneDrive, and iCloud Drive can all create a shareable link to a file.

I’m having a similar issue, I think. I have the new hdhomerun 4k. When plex records a standard definition file from the hdhomerun and I play it back on my roku ultra using direct copy, it makes the video skinny. It looks like the video is setup already for being displayed 16:9 but the plex app on roku is determining it should not be and scrunches it.

Here’s media info on the file:
General
ID : 1 (0x1)
Complete name : P:\TV Shows\3rd Rock From the Sun (1996)\Season 05\3rd Rock From the Sun (1996) - S05E14 - This Little Dick Goes to Market.ts
Format : MPEG-TS
File size : 384 MiB
Duration : 23 min 2 s
Overall bit rate mode : Variable
Overall bit rate : 2 328 kb/s

Video
ID : 256 (0x100)
Menu ID : 1 (0x1)
Format : MPEG Video
Format version : Version 2
Format profile : Main@Main
Format settings : CustomMatrix / BVOP
Format settings, BVOP : Yes
Format settings, Matrix : Custom
Format settings, GOP : Variable
Format settings, picture structure : Frame
Codec ID : 2
Duration : 23 min 3 s
Bit rate mode : Variable
Bit rate : 2 019 kb/s
Maximum bit rate : 3 896 kb/s
Width : 704 pixels
Height : 480 pixels
Display aspect ratio : 16:9
Active Format Description : Full frame 16:9 image
Frame rate : 29.970 (30000/1001) FPS
Standard : NTSC
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Interlaced
Scan order : Top Field First
Compression mode : Lossy
Bits/(Pixel*Frame) : 0.199
Time code of first frame : 23:25:33;29
Time code source : Group of pictures header
GOP, Open/Closed : Open
Stream size : 333 MiB (87%)

Audio
ID : 257 (0x101)
Menu ID : 1 (0x1)
Format : AC-3
Format/Info : Audio Coding 3
Commercial name : Dolby Digital
Codec ID : 129
Duration : 23 min 3 s
Bit rate mode : Constant
Bit rate : 192 kb/s
Channel(s) : 2 channels
Channel layout : L R
Sampling rate : 48.0 kHz
Frame rate : 31.250 FPS (1536 SPF)
Compression mode : Lossy
Delay relative to video : -104 ms
Stream size : 31.7 MiB (8%)
Language : English
Service kind : Complete Main

Text #1
ID : 256 (0x100)-CC1
Menu ID : 1 (0x1)
Format : EIA-608
Muxing mode : A/53 / DTVCC Transport
Muxing mode, more info : Muxed in Video #1
Duration : 23 min 3 s
Bit rate mode : Constant
Stream size : 0.00 Byte (0%)
CaptionServiceName : CC1

Text #2
ID : 256 (0x100)-1
Menu ID : 1 (0x1)
Format : EIA-708
Muxing mode : A/53 / DTVCC Transport
Muxing mode, more info : Muxed in Video #1
Duration : 23 min 3 s
Bit rate mode : Constant
Stream size : 0.00 Byte (0%)

Menu
ID : 4096 (0x1000)
Menu ID : 1 (0x1)
Duration : 23 min 2 s
List : 256 (0x100) (MPEG Video) / 257 (0x101) (AC-3, English)
Language : / English
Service name : Service01
Service provider : FFmpeg
Service type : digital television

This is what I shared with @phoenix501 a while ago.

But I’m not sure if it’s relevant for MPEG2 in a TS container.

With H.264/AVC and H.265/HEVC, in MP4 or MKV, the stream itself has an aspect ratio encoded, and there’s also an aspect ratio in the container. The Roku consistently prefers the aspect ratio of the stream itself.

I don’t know if the same concepts apply to MPEG2 and TS, but your experience sounds similar.

Share a sample if you like.

1 Like

Link to sample clip created using dd on linux. Clip of 4:3 problem

I will say that it is squished on plex/roku but fine on Windows 10 plex app and fine on just straight vlc (not through plex).

Also not sure how Plex behaves with the ‘TS’ container but will give it a shot.

What Plex/Roku may be doing in your case is reading the raw “height” and “width” values (704 and 480) and displaying them as such ignoring the anamorphic 16:9 settings. 704 ÷480 would give you a 1.5 aspect ratio (somewhere between 4:3 and 16:9).

Can you check it’s displaying 4:3 and not actually 1.5 (3:2)?

@Volts

Having learned a little bit more about MPEG2 & TS, that file looks great to me.

SAR/PAR/DAR all seem right.
Active Format Description is right too, though it’s probably ignored.

I don’t see any of the discrepancy between the dimensions in the stream vs. the container that applied to the files earlier in this topic.

I don’t have a standalone Roku handy, but it plays correctly for me on both a 4K and a 1080P Roku TV.

Out of curiosity, how is your Roku connected to your TV - HDMI?

@Phoenix501, I think the dimensions are as-expected for NTSC.

It connects to a Harmon Kardon receiver via hdmi which then connects to the TV via hdmi.

Check this out - others describing the same issue, and SiliconDust says they’ve raised it with Roku.

https://forum.silicondust.com/forum/viewtopic.php?t=74590

It might be worth searching the Roku forums or raising the topic there too.

1 Like

Ah, that sounds like me! Thanks for the link, I’ll pursue it.

Any update on this?

I just bought the 2020 Roku Ultra and see this problem with DVD rips. 4:3 AR shows (e.g. Star Trek DS9) are stretched to nearly 16:9.

I realize this is a Roku problem but just wondered if Plex has made any progress getting Roku to fix the bug.

1 Like

Not really. Here’s a thread at Roku’s website. Roku Forum Discussion

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