Transcoding/Optimized quality issue

I’ve noticed that in both automatic streaming conversion and even on pre-rendered optimized versions, the quality doesn’t match the actual profiles selected. What am I doing wrong?

For reference here is an optimized version (exactly same problem in live transcoding also) for reference - notice how the optimized file isn’t using the Mbps available.

Original file:


Optimized profile:
3
Result:

if you look at the original file, it was already less than 3Mbit to begin with, video was 1.6Mbit and Audio was 224Kbit = 1.8Mbit. And now it’s using that same source, to go down to 1280x720, can’t be certain, but I would venture to say that has at least something to do with it.

You should try with a larger input file, say something in the 25-40Mbit (BluRay) range, and see if you get the same result, I’d imagine, you end up with something closer to 3Mbit at that point.

This is a cartoon so it looks very nice (perfect?) even at the source bitrate, but it is a great example to highlight this situation. There is no reason to compress the video to .5 Mbit when there is 3Mbit available.

I could accept it staying with same bitrate at a lower resolution as that would just mean better quality per frame although it was transcoded, but I see no logical reason to decrease the bitrate in this example.

I suspect that there is a “formula” when going down in resolution to also decrease bitrate without looking at the source bitrate and the available bits in the desired profile - but this is pure speculation and I’d prefer someone with proper knowledge shedding some light on this.

You are correct. If you specifically choose a lower resolution, Plex will drop the bitrate so that the bits:pixel ratio remains about the same as the original. If you want to squeeze more bits per pixel, you’re gonna need to do it outside of Plex.

2 Likes

Where do I suggest a small tweak that allows the bitrate to remain the same if the source is within the maximum bitrate of the chosen profile?

Also perhaps encoding to a constant bitrate from a variable bitrate source doesn’t seem the smartest choice, perhaps defaulting to variable for optimized content makes more sense :slight_smile:

If you want to maintain the bitrate, why are you choosing a lower resolution. Unless your original is 4K, there isn’t a need to specify a lower bitrate. I’m pretty sure all devices can handle scaling the 1080 video in-device.

The transcoder does not use a constant bitrate. It is still variable. The value you choose is the parameter used for the average, just like your original.

Yes the device can easily handle the scaling, but Plex forces the transcode because the maximum profile set in the device is 3Mbit (which Plex sets at 720p). I did enable play smaller files directly, but because the resolution follows the bitrate limitation, lower bitrate but higher resolution files are being transcoded, which they shouldn’t in my opinion.

The constant bitrate is the “optimized” pre-encodes done in Plex. Below is the video summary from Mediainfo of the Plex optimized video (Android, 3Mbit profile) and below that the original file.


Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L3.1
Format settings                          : CABAC / 5 Ref Frames
Format settings, CABAC                   : Yes
Format settings, RefFrames               : 5 frames
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 11 min 4 s
Bit rate                                 : 541 kb/s
Width                                    : 1 280 pixels
Height                                   : 720 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 25.000 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.023
Stream size                              : 42.9 MiB (71%)
Writing library                          : x264 core 157
Encoding settings                        : cabac=1 / ref=5 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=2 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=4 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=0 / threads=9 / lookahead_threads=3 / 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=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=10 / rc=crf / mbtree=1 / crf=18.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / vbv_maxrate=1125 / vbv_bufsize=2250 / crf_max=0.0 / nal_hrd=none / filler=0 / ip_ratio=1.40 / aq=1:1.00
Codec configuration box                  : avcC
Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L4
Format settings                          : CABAC / 4 Ref Frames
Format settings, CABAC                   : Yes
Format settings, RefFrames               : 4 frames
Codec ID                                 : V_MPEG4/ISO/AVC
Duration                                 : 11 min 4 s
Bit rate mode                            : Variable
Bit rate                                 : 1 688 kb/s
Maximum bit rate                         : 15.0 Mb/s
Width                                    : 1 920 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 25.000 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.033
Stream size                              : 134 MiB (88%)
Default                                  : Yes
Forced                                   : No
Color range                              : Limited
Color primaries                          : BT.709
Transfer characteristics                 : BT.709
Matrix coefficients                      : BT.709

Are you talking about streaming or the media optimizer?

Both cases apply in this situation. I just tested the media optimizer to see if it acted differently and it didn’t.

It would be ideal if the server could define their own profiles or Plex decoupled bitrate and resolution maximum in the remote streaming profile settings of the client.

Can you provide me the xml from Plex. I’m thinking it has to do with this:

Bit rate : 1 688 kb/s
Maximum bit rate : 15.0 Mb/s

PMS will analyze your file and determine what bandwidth is needed to correctly play your file. With such a high max, there are probably spikes in the stream which is causing the bitrate to get reduced a lot.

Sent in PM.

When you disable the hardware transcoder, and then optimize the file again – does it look differently?

Got the info. I think I see the issue. It’s something another user had reported before. Your file has embedded closed captions. This is throwing off the logic of the transcoder because technically it is graphical text so it’s bitrate is being included as part of the input but then not correctly being used as part of the output, so the resulting video is lower than expected.

You’re not doing anything wrong, we need a PMS fix. If you try this with a file that doesn’t have embedded closed captions, you should see things working correctly.

1 Like

Thank you for the explanation, I appreciate you taking the time to investigate it.

I will check what you suggested and get back here if it shouldn’t work as expected :slight_smile:

grab mkvtoolnix (provided it’s an mkv file), and uncheck the captions, then save the file without captions and try again, that may work :slight_smile:

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