(As another approach, I tried modifying the Roku-7.x.xml profile to generate MP4 (or HLS) instead of MKV. I didn’t get anywhere. I don’t understand the options or how all of the components interact.)
Ran the new command on my test movie, plays fine on my Kodi box, plays fine on Roku 4 thru Plex, Roku Ultra 4400x still looks bad when played thru Plex.
I’ll have to play it with Roku Media Player from a thumbdrive, later. The Roku is currently being used by other family members.
Heres the video info from ‘mediainfo -f’ for my test movie.
Video
Count : 377
Count of stream of this kind : 1
Kind of stream : Video
Kind of stream : Video
Stream identifier : 0
StreamOrder : 0
ID : 1
ID : 1
Unique ID : 551129781509055373
Format : HEVC
Format : HEVC
Format/Info : High Efficiency Video Coding
Format/Url : http://www.itu.int
Commercial name : HEVC
Format profile : Main@L4@High
Internet media type : video/H265
Codec ID : V_MPEGH/ISO/HEVC
Duration : 6554763.000000
Duration : 1 h 49 min
Duration : 1 h 49 min 14 s 763 ms
Duration : 1 h 49 min
Duration : 01:49:14.763
Duration : 01:49:16;11
Duration : 01:49:14.763 (01:49:16;11)
Bit rate : 3616110
Bit rate : 3 616 kb/s
Width : 1920
Width : 1 920 pixels
Height : 1080
Height : 1 080 pixels
Stored_Height : 1088
Sampled_Width : 1920
Sampled_Height : 1080
Pixel aspect ratio : 1.000
Display aspect ratio : 1.778
Display aspect ratio : 16:9
Frame rate mode : CFR
Frame rate mode : Constant
Frame rate : 23.976
Frame rate : 23.976 (23976/1000) FPS
FrameRate_Num : 23976
FrameRate_Den : 1000
Original frame rate : 23.976
Original frame rate : 23.976 (24000/1001) FPS
FrameRate_Original_Num : 24000
FrameRate_Original_Den : 1001
Frame count : 157157
Color space : YUV
Chroma subsampling : 4:2:0
Chroma subsampling : 4:2:0
Bit depth : 8
Bit depth : 8 bits
Bits/(Pixel*Frame) : 0.073
Delay : 0
Delay : 00:00:00.000
Delay, origin : Container
Delay, origin : Container
Stream size : 2962843355
Stream size : 2.76 GiB (93%)
Stream size : 3 GiB
Stream size : 2.8 GiB
Stream size : 2.76 GiB
Stream size : 2.759 GiB
Stream size : 2.76 GiB (93%)
Proportion of this stream : 0.92583
Default : Yes
Default : Yes
Forced : No
Forced : No
Was it Direct Play?
If the Roku shows it as “Direct Stream” or “Video * Copy” then it’s being remuxed by the ffmpeg
-derived Transcoder and the headers are being regenerated again.
Direct Play - Auto
Direct Stream - Selected
Playback → Direct Stream (throttled)
Can I Force Direct Play? This has AAC audio.
I set Direct Play to Force
Disabled Direct Stream
Looks better now! AAC audio seems fine too!
Nice!
How’s the audio sound?
How’s your audio setup, and how’s the Roku connected? Roku TVs frustratingly downmix multichannel AAC to PCM stereo. I wonder how standalone units are, and if they can convert to AC3.
Roku Ultra-> HDMI → Sony AV receiver → HDMI → Pioneer Plasma 1080p TV. The LED display on the receiver doesnt work so I cant see what stream Im actually receiving. I also only have 3.1 audio. I’ll have to if the subwoofer is being driven.
With Direct Play AAC must be sent to the Roku Ultra, maybe its converting to AC-3.
When Direct Play was Auto, why was it transcoding when the Roku Ultra client can handle the streams without modification?
Not transcoding, just remuxing. Extracting the required video and audio and repackaging it for the client.
Because remuxing is trivial for ~any server.
Many files are muxed really badly, and it’s beneficial to let Plex remux them properly, so the bits of audio and video can be downloaded efficiently by the player. Bad muxing causes some players to download, discard, and re-download over and over - it can total more than the size of the file!
So that unnecessary additional tracks aren’t sent to the player. Extra bandwidth. They would be sent with Direct Play.
Because the Roku supports different audio codecs in MKV vs. MP4, so any necessary audio switching can happen seamlessly.
To make it easier to activate subtitles down the road.
Default remuxing to MKV is a good way to make things more predictable and reliable.
Direct Play is completely overrated.
This Roku bug on 100%-normal MKV is just an anomaly.
(Plex could, technically, make code changes & suppress those headers from being sent. It would be a workaround to dodge the Roku bug - but what other consequences might it have??)
Plex could remove those headers, just like I am removing them from the source mkv. I don’t see any negative consequences, especially if its just for the 4400x model.
I worked @ DirecTV a few years ago in Software Engineering and they had many client (TV, receiver) specific code changes to make problem client hardware work, especially Bose equipment. Bose was the worst offender of the HDMI spec I was told by the engineer who got to debug and add specific code to fix all the problems.
I was actually thinking about that. Does Plex use a custom version of FFmpeg? If not, a person could modify the FFmpeg source code and build a new version of FFmpeg which would not add the extra header info, when remuxing.
Every bit of code has cost. Maybe Plex will make a change, but it’s so obviously a Roku bug that it’s hard not to suggest pressuring them.
Yeah. The Plex Transcoder
is derived from FFmpeg. But if you replace it with a baseline ffmpeg
a variety of things don’t work.
Some folks have created wrappers around the Plex Transcoder
, but I think that would be more difficult here. I don’t think ffmpeg
exposes any knobs to control behavior of these headers.
A wrapper could race to modify the remux’d temporary files before the client got them. Probably doable, kinda gross.
Easier to bug Roku.
I’ve run mkvpropedit on 25 movies, all play perfectly on Roku 4, Roku Ultra thru Plex, and Kodi. So the resulting MKV files are still ‘correct’ after removing the additional elements. Thanks to @Volts, @gbballpack for their help. Hopefully @ljunkie can get Roku to fix their firmware. I’ll attach my Bash script that does the conversions tonight.
Two easy approaches:
# bourne-type shells
for FILE in *.mkv; do mkvpropedit "${FILE}" --edit track:v1 --delete colour-primaries --delete colour-range --delete colour-matrix-coefficients --delete colour-transfer-characteristics --delete chroma-siting-horizontal --delete chroma-siting-vertical done
# using `find` - this is my favorite technique
find /path/to/files -type f -iname "*.mkv" -exec mkvpropedit {} --edit track:v1 --delete colour-primaries --delete colour-range --delete colour-matrix-coefficients --delete colour-transfer-characteristics --delete chroma-siting-horizontal --delete chroma-siting-vertical \;
I also do an additional check, mediainfo $FILE | grep HEVC, since I dont need to modify files that use AVC.
Nice - don’t let me discourage you from sharing it!
I include the video codec in my filenames. If I ran this I would modify my glob or add another ‘-iname’ to the find
args.
You could consider using mediainfo
to check for those elements in the Container before stripping them out. mkvpropedit
updates the modification date of the files, even on subsequent runs. But that’s not very harmful; it doesn’t change the contents or checksum again.
Heres my script for modifying MKV files.
#!/bin/bash
#
# This script will for all MKV files remove some 'color' elements from HEVC video stream that are broken in the Roku Ultra player.
# Removing these elements does not result in an invalid MKV stream, this is just a band-aid because the Roku Ultra firmware is broken.
# Having these elements set in the video stream cause the Roku to switch to from BT.702 to BT.2020 which causes colors on a
# 1080p TV to be oversaturated and display incorrectly.
#
#
for f in *.mkv *.MKV
do
convert=$(mediainfo $f | grep HEVC )
# echo $f ": "$convert
if [[ -n $convert ]]
then
echo "Modifying $f:"
mkvpropedit $f --edit track:v1 --delete colour-primaries --delete colour-range --delete colour-matrix-coefficients --delete colour-transfer-characteristics --delete chroma-siting-horizontal --delete chroma-siting-vertical
fi
done
hello granjan7,
You can help me with a powershell (windows) script to make fix.
I have my plex server in windows
Regards,
Post to keep the thread open, as I do not believe this issue has been resolved.
As we know, the cause is a Roku firmware issue and not a Plex issue. Posting here to keep the thread open as this has not yet been resolved by Roku.
I have this problem on Roku Ultra’s connected to a couple Samsung TV’s, these Ultra’s were purchased in Fall '21. I had a TCL roku TV and a Vizio with an older Ultra that don’t have this problem.
I plex direct play HEVC encodes and the picture is orange / red tint. People are oompa loompa colored. If I turn on sub’s, then plex transcodes to 264 and the color is back to normal.
I picked up a Firestick 4K Max and it doesn’t have this problem