Transcoding, Direct Play, Video Resolution, Bitrates, etc.

I’m curious if the new method Plex uses to determine video resolutions has anything to do with the decision to transcode or direct play. The decision to transcode media that was previously direct playing to remote clients coincidentally began about the same time.

I posted here, (https://forums.plex.tv/discussion/266445/why-is-plex-identifying-sd-video-as-576p/p1) asking why a 720X404 video was now identified as 576p, and specifically asked if that would effect the way Plex determines a transcode is necessary. That question was never answered.

As sometimes happens, the thread became so far off topic (in my mind) that I’m pretty sure no-one with any insight bothers looking at it. @“MovieFan.Plex” did state that 480p video had to fit into a 640X480 box, and asked for a table to better define the binding boxes if that was wrong. I did provide a table, but it’s pretty much lost because of the direction the thread took.

I’ll repeat and re-word the question here now that I have more information:

Since a 720X404 video does not fit into the 640X480 defining box Plex uses to define a video as 480p, does Plex determine a
transcode is necessary despite the fact the bitrate is well below 1.5Mbps?

(I think all Plex apps have a remote quality setting of “480p @ 1.5Mbps”)

Here is an snippet of the XML of a file that was transcoded to a Roku set at 480p/1.5Mbps.

<Media videoResolution="576" id="1344335" duration="2521792" bitrate="756" width="720" height="404" 
 aspectRatio="1.78" audioChannels="2" audioCodec="aac" videoCodec="h264" container="mp4" videoFrameRate="24p" 
 optimizedForStreaming="1" audioProfile="lc" has64bitOffsets="0" videoProfile="high">
 <Part accessible="1" exists="1" id="1345423" key="/library/parts/1345423/1491410499/file.mp4" 
 duration="2521792" file="D:\Plex\Comic Book TV Heroes\iZombie\Season 03\iZombie S03E01 (SD).mp4" 
 size="238322998" audioProfile="lc" container="mp4" deepAnalysisVersion="2" 
 has64bitOffsets="0" indexes="sd" optimizedForStreaming="1" 
 requiredBandwidths="915,915,915,915,915,915,915,915" videoProfile="high">
 <Stream id="2745278" streamType="1" default="1" codec="h264" index="0" bitrate="590" 
 language="English" languageCode="eng" anamorphic="0" bitDepth="8" chromaSubsampling="4:2:0" 
 frameRate="23.976" hasScalingMatrix="0" height="404" level="40" pixelAspectRatio="3232:3231" 
 profile="high" refFrames="5" 
 requiredBandwidths="758,758,758,758,758,758,758,758" streamIdentifier="1" width="720"/>
 <Stream id="2745279" streamType="2" selected="1" default="1" codec="aac" index="1" 
 channels="2" bitrate="167" language="English" languageCode="eng" 
 audioChannelLayout="stereo" profile="lc" 
 requiredBandwidths="161,161,161,161,161,161,161,161" samplingRate="48000" streamIdentifier="2"/>

Unfortunately, I don’t have the server logs to provide, it was a couple of days ago, and they have been cycled through. I can tell you that PlexPy reported that the video was transcoded to 718X404 and the audio was copied. That is almost the identical resolution of the “optimized” version that was intended to direct play, and always did until recently. It seems to me, from the requireBandwidths reported in the XML, the original file should have direct played

Any assistance you can provide to help me get back my direct play for videos similar to this would be appreciated.

PS - while I suppose this is could be considered a “cross-post” please don’t close the thread. Maybe it will stay more on topic. :slight_smile:

No. That 480/576 designation is cosmetic. The only thing that info is used for is if you use the short/filter. It has no impact on transcoding decisions.

The transcode decision first looks at the bitrate, so this video should be direct playing. I thought maybe it was the 5 ref frames but that should be ok for that resolution. I can’t see why this would transcode. You’ll need to reproduce and provide logs.

Thank you for the quick response.

I am attaching 2 sets of logs. Both are with a Roku on my network, but with the local quality settings dropped down to 480p @ 1.5Mbps. I assume that would produce the same results a remote user would have.

In the first set, I allowed the Roku to automatically choose the version The Roku has always seemed to do this perfectly, but maybe a bug has found its way into the app. The result was a full transcode of video, and audio copied.

In the second set, I specifically chose the lower quality version. This time, it was direct streamed - a better decision, no doubt, but still a transcode\remux that I think should direct play.

Is there any other info you require? I can attach the full XML if that will provide some assistance.

Oh, sorry. I was wrong. PMS does also look at the resolution too. From your log, it appears that PMS chose the 1280x? version as the source. The 1.5Mbps setting is then using a 720x480 box for the destination resolution. This is what’s causing the transcode.

I know, I see the contradiction and have mentioned it to the team. We’ll see what happens.

@MovieFan.Plex said:
I know, I see the contradiction and have mentioned it to the team. We’ll see what happens.

Thanks. Until it’s fixed I guess the “optimized” versions are just taking up space on the hard drive since they are not used. Looking forward to having this bug eliminated.

Optimized versions are not used by default. http://forums.plex.tv/discussion/209163/optimizing-questions has a discussion on that topic.

@“MovieFan.Plex” said:
I know, I see the contradiction and have mentioned it to the team. We’ll see what happens.
and
Optimized versions are not used by default

That may be true for most apps, but the Roku has for as long as I remember, chosen the version that matches or is lower in quality than the quality settings set in the preferences for that app. It was always automatic, no user input required. It’s worked perfectly for about 2 years now.

This brings up a few followup questions…

Is it a regression in the Roku app (the Roku app no longer automatically selects), or is it a bug in the PMS (it no longer gives the option to play the alternate version to the Roku)

or is it more related to my original question…

since the PMS is reporting the video as 576p (previously 480p), it decides to transcode because the Roku asks for 480p.

Further to that, if the new definitions for 480p are the standard going forward, how should I encode videos so that they are recognized as 480p.

Thanks. Until whatever it is that needs to get some attention gets fixed, I guess the “optimized” versions are just taking up space on the hard drive since they are not used. Looking forward to having this bug eliminated.

@leelynds said:
That may be true for most apps, but the Roku has for as long as I remember, chosen the version that matches or is lower in quality than the quality settings set in the preferences for that app. It was always automatic, no user input required. It’s worked perfectly for about 2 years now.

I know the Roku can pick a version that it can direct play over others. Can you post or PM me the entire XML so I can compare the different versions you have? Maybe it didn’t like the optimized version either so it chose to transcode.

since the PMS is reporting the video as 576p (previously 480p), it decides to transcode because the Roku asks for 480p.

The 576p designation is not used for anything except sorting/filter. It has no impact on the transcode/playback decision.

LOL - make up my mind :slight_smile:

Either Plex looks at the resolution

Oh, sorry. I was wrong. PMS does also look at the resolution too.

or it doesn’t

The 576p designation is not used for anything except sorting/filter

In any event, here’s the full XML. It has the includeBandwidths options in it.

I have a windows bat file I use to encode the optimized version. It hasn’t changed for some time, and, repeating myself, until the last few weeks, the files always direct played.

The resolution and the 480/576 tag are 2 separate things. Literally, they are 2 different values in the database and in the XML. PMS looks at the resolution when it analyzes the file originally, and generates that 480/576 tag. When filtering/sorting (i.e. Plex Web), the 480/576 field is used as the criteria. When doing the decision for playback, the 480/576 info is ignored, but the actual resolution is used. You can go into the database and change the 480/576 tag and it won’t affect playback, but will impact filter/sorting.

Looking at your XML I don’t see any reason why the optimised version would not be preferred. It could be a regression in the Roku app. Do you have the logs from the Roku when starting playback?

I’m not familiar with the procedure to get Roku logs, but I did find the Plex support page for the “how-to” get them. I’ll read through the info and try to get them for you. I imagine you will also want server logs for the same time period, right? Probably sometime tomorrow, other priorities tonight.

As an experiment, I tried the “Classic” channel on several videos, and while it did seem to always select the proper version, it did direct stream/remux rather than direct play. I’m fairly certain the Classic app direct played similar videos, because one of the remote users I share with did not have an HDTV until a few months ago and had to use the Classic version. They also have a very slow internet connection, so 1.5Mbps was the max we could set it to.

According to PlexPy, everything has been direct streamed to that user since June of 2015, until the 30th of March of this year when, coincidentally, I upgraded the server to version 1.5.2 because of the " Slower than expected streaming over fast connections with high latency" that caused slow loading times for everyone.

I’ll still get the Roku logs for you, because it may be a regression in the current app. However, “Plex Classic” hasn’t been upgraded for some time, which makes me thing there might be a communication problem between the server and device here.

Better late than never… hope I have the Roku logs right, it’s a new experience for me. Still around @“MovieFan.Plex” ???

Logs for Roku, and new set of server logs. Thanks in advance.

And strangely, this video (XML Attached) direct plays, no transcoding or remuxing at 480p/1.5Mbps setting, even though the bitrate and requiredBandwidths are higher than the other one. However, please note it is a 640X480 video, that Plex identifies as a 480p video.