Plex Web Max Supported MKV settings

Hello, this is my first post here, so hopefully i will provide as much info as needed.

I was using MeGui for compressing MKV files (Series mostly) and in the last five months i have switched to Handbrake.
Lately i switched my fans(installed some pwm) on my server and then it was that i realized that all my series was transcoding when playing from plex web player.

I run Plex as a Docker on Unraid and on the same machine i run my windows VM which i use to watch the series through Plex Web.

All settings on transcoder and client are set to maximum. But it still transcodes from H264 to H264.
Everything is 720p, Audio and subs are direct played.

On Plex App all playing fine without transcoding. Well i dont mind using the app but i have some friends that prefer the Web Client to view my Series.

I tried to play an older file which was compressed with MeGui and it was playing fine without transcode from Plex Web.

So i tried to dig in and find what was causing it. It is probably something to do with my Handbrake profile.
After reading some posts on these forums i got to the point that is either
-4.1 High level h264
or
-ref=5:bframes=5 (extra parameters on handbrake)

Tried to reduce both ref and bframes to 4 but still got transcoding.
Tried to remove the parameters

If anyone can validate my what is the max level, profile and ref frames is supported on Plex Web i would be very thankfull.

Also a way to reencode the files to this level,profile and ref frames without losing a ton of quality*, would be very helpful.
I dont mind the time it will take. I know reencoding takes time…
(*except the quality that will lose anyway from the profile-level-refframes reduction)

Thanks

Transcoding from H.264 to H.264 can be triggered by:

  • Automatic quality
  • restricting the bandwidth to a value below of the bandwidth of the file
  • activating subtitles

Please post the Plex XML info of a typical episode that causes transcoding.

Do also determine whether ā€œsoftā€ subtitles are enabled or not.

  1. activate debug logging (not ā€˜verbose’!)
  2. quit Plex Server
  3. wait 1 minute
  4. start Plex Server
  5. wait 2 minutes
  6. play one of these episodes
  7. wait 3 minutes
  8. fetch log files and attach them here

Or inspect the log yourself. You need the Plex Media Server.log
seek until you find the first line containing MDE:
The reasons for transcoding are written out in these lines. Give attention to which streams are transcoded (video, audio, or subtitle, and any combination thereof).

XML File

This XML file does not appear to have any style information associated with it. The document tree is shown below.

<MediaContainer size="1" allowSync="1" identifier="com.plexapp.plugins.library" librarySectionID="1" librarySectionTitle="TV Shows" librarySectionUUID="73da5221-10d4-47c1-890d-949cfe47302f" mediaTagPrefix="/system/bundle/media/flags/" mediaTagVersion="1579823211">

<Video ratingKey="32046" key="/library/metadata/32046" parentRatingKey="32043" grandparentRatingKey="30283" guid="com.plexapp.agents.thetvdb://356317/2/3?lang=en" parentGuid="com.plexapp.agents.thetvdb://356317/2?lang=en" grandparentGuid="com.plexapp.agents.thetvdb://356317?lang=en" type="episode" title="Episode 3" grandparentKey="/library/metadata/30283" parentKey="/library/metadata/32043" librarySectionTitle="TV Shows" librarySectionID="1" librarySectionKey="/library/sections/1" grandparentTitle="Sex Education" parentTitle="Season 2" contentRating="TV-MA" summary="On her way to surprise Maeve, Aimee gets a horrible shock on the bus. Rahim connects with Eric as a Milburn family dinner gets seriously awkward." index="3" parentIndex="2" viewOffset="87000" lastViewedAt="1580398129" year="2020" thumb="/library/metadata/32046/thumb/1579793665" art="/library/metadata/30283/art/1579725157" parentThumb="/library/metadata/32043/thumb/1579725157" grandparentThumb="/library/metadata/30283/thumb/1579725157" grandparentArt="/library/metadata/30283/art/1579725157" grandparentTheme="/library/metadata/30283/theme/1579725157" duration="2934954" originallyAvailableAt="2020-01-17" addedAt="1579725097" updatedAt="1579793665">

<Media id="33967" duration="2934954" bitrate="1190" width="1280" height="720" aspectRatio="1.85" audioChannels="6" audioCodec="aac" videoCodec="h264" videoResolution="720" container="mkv" videoFrameRate="PAL" audioProfile="lc" videoProfile="high">

<Part accessible="1" exists="1" id="34793" key="/library/parts/34793/1579724924/file.mkv" duration="2934954" file="/tv/Sex Education/Season 02/Sex Education - S02E03 - Episode 3.mkv" size="438240779" audioProfile="lc" container="mkv" deepAnalysisVersion="4" requiredBandwidths="2679,1874,1874,1874,1874,1874,1874,1874" videoProfile="high">

<Stream id="53399" streamType="1" default="1" codec="h264" index="0" bitrate="1001" anamorphic="1" bitDepth="8" chromaLocation="left" chromaSubsampling="4:2:0" codedHeight="720" codedWidth="1280" colorPrimaries="bt709" colorRange="tv" colorSpace="bt709" colorTrc="bt709" frameRate="25.000" hasScalingMatrix="0" height="720" level="41" pixelAspectRatio="9:8" profile="high" refFrames="5" requiredBandwidths="2486,1714,1714,1714,1714,1714,1714,1714" scanType="progressive" width="1280" displayTitle="720p (H.264)"/>

<Stream id="53400" streamType="2" selected="1" default="1" codec="aac" index="1" channels="6" bitrate="190" language="English" languageCode="eng" audioChannelLayout="5.1" profile="lc" requiredBandwidths="193,193,193,193,193,193,193,193" samplingRate="48000" title="English" displayTitle="English (AAC 5.1)"/>

<Stream id="53401" streamType="3" selected="1" default="1" codec="ass" index="2" bitrate="0" language="Ελληνικά" languageCode="gre" requiredBandwidths="1,1,1,1,1,1,1,1" title="Greek" displayTitle="Ελληνικά (ASS)"/>

</Part>

</Media>

<Extras size="0"> </Extras>

</Video>

</MediaContainer>

Log File: (should be at Jan 30, 2020 17:27:18)

Jan 30, 2020 17:27:18.005 [0x14f7102af700] DEBUG - MDE: Selected protocol dash; container: mp4
Jan 30, 2020 17:27:18.005 [0x14f7102af700] DEBUG - MDE: analyzing media item 33967
Jan 30, 2020 17:27:18.005 [0x14f7102af700] DEBUG - MDE: E3 - Episode 3: Direct Play is disabled
Jan 30, 2020 17:27:18.005 [0x14f7102af700] DEBUG - MDE: E3 - Episode 3: media must be transcoded in order to use the dash protocol
Jan 30, 2020 17:27:18.005 [0x14f7102af700] DEBUG - MDE: E3 - Episode 3: selected subtitle cannot be converted to a compatible format, burning into video stream
Jan 30, 2020 17:27:18.005 [0x14f7102af700] DEBUG - MDE: E3 - Episode 3: avoiding video remux due to burned subtitle stream
Jan 30, 2020 17:27:18.005 [0x14f7102af700] DEBUG - MDE: E3 - Episode 3: no remuxable profile found, so video stream will be transcoded
Jan 30, 2020 17:27:18.005 [0x14f7102af700] DEBUG - MDE: Cannot direct stream video stream due to profile or setting limitations```

Link for the Log File
https://my.pcloud.com/publink/show?code=XZWM32kZQ7q3lT7WF68uaAFzoDwTVJ0VJhyX

There you have it.
Disable the subtitle and play again. See if it’s transcoding as well.

Hmm, you are correct. I’ve really missed that,
Then do you happen to know what subs are supported on Plex Web?
Should be easy to just convert subs on MKV files. without reencoding then

Practically nothing except SRT, error free and using a text encoding of UTF-8.

Subtitle Edit (https://www.nikse.dk/subtitleedit) and MKVToolnix will probably help you out

That should explain why. Handbrake puts ASS typed subs. (i laugh every time on this type of subs lol)

Thanks.
@leelynds Thanks also, ill check those. I hope they support batch, have more than 300 files to do. Bah. at least i found the problem!

Yes, they are devious. They even, without asking, convert SRT files into the ASS format when you add them to the project.

I always send the output of Handbrake through MKVtoolnixGUI again, to replace the ASS sub with the original SRT version and to remove all those useless ā€œtagsā€ they are adding.

Use Plex for Windows instead of Plex Web.

Plex Web is limited by the web browser. Plex for Win/Mac direct plays many more audio formats and subtitles.

Edit: I saw your comment that friends prefer Plex Web. However, they might go along with Plex for Win/Mac if you explain the situation to them.

I’ll have to add one extra step on my flow then.
But now i can use the handbrakes watchfolder.
I was only doing it manual so i can add subs in the process, but since i wont do it anymore.
I will just throw the episodes on the watchfolder and let it do its job.

I have a profile compressing them at 1k bit rate video @ 720p, Just to have them handy if i want to watch someintg again plus All my friends watch the series from tablets/ laptops so more quality is not needed.

Yea until i fix the sub issue atleast ill disable transcoding ( new versions of plex allows you to do it) so they will be forced to hehe 3:)

Huh? I use HandBrake all the time, even extracting Subtitles from DVD’s etc.

Does this ASS conversion take place in those cases as well or just if you add an SRT to a project in HandBrake?

I have only experienced it in the latter case.

(I’d be kinda pleased if it’d happen with PGS and VOBSUB tracks, but of course that’s not the case. :wink: )

Anyone have a handy script that
a) Converts subs to UTF-8 (if not already, i’m having some iso-8859 some times)
b) merges them to the same named mkv file
c) do it in batch. (eg. for all the files in the folder.)

A) and C) can be done with SubtitleEdit

B) I don’t know. Probably not.

B) i can write a script maybe with mkvmerge, but i tried with SubtitleEdit, while on the GUI batch converter works fine. When i try the Command it gives me giberish output.
I think the problem is that GUI recognizes the input encoding, but command does not automaticaly, you have to specify input encoding.
if this is the case is not very practical, because when i download subs its not always a specific encoding. And sometimes might be UTF8 already.

I’ll go read the manual again later today and see what i can find.

EDIT** Tried command again and seems to work without specify input encoding.
Might was a problem with a specific sub i tried

There is also this, which might still work: [REL] SRT2Utf-8

I’m close to finish my script (which i’ll post in case anyone will need it in the future)
The only think i want to find is to make subtitleedit to work.
I’m using the following command
subtitleedit /convert "*.srt" subrip /encoding:utf-8
But it gives me and output srt with ā€œ???ā€ instead of text.
The input encoding is iso 8859-7

EDIT* It works on Windows perfectly. It only does this on Linux. I guess it might be some kind of locale issue. I’ll have to look into it. as i want to run the script on linux

So here is the script i came up with!

I put all my mkv’s to a folder watched by handbrake, it encodes them and puts them to HandbrakeOutput.
There i also put my srt files, I run the script after its finished that converts any sub to utf8 and then merges them with the mkv file and puts the result on a folder Ready

Hope it helps someone

#!/bin/bash
echo "You need mkvmerge, iconv, uchardet and mkvpropedit packages installed."
echo "USE AT YOUR OWN RISK"
#Set the output folder of the merged files
mergedoutputfolder=Ready

for mkvfile in *.mkv
do
	echo -n "Encoding of ${mkvfile%.*}.srt is: "
	uchardet ${mkvfile%.*}.srt
	iconv -f $(uchardet ${mkvfile%.*}.srt) -t utf8 ${mkvfile%.*}.srt -o ${mkvfile%.*}-converted.srt
	mv ${mkvfile%.*}-converted.srt ${mkvfile%.*}.srt
	echo ""
	echo "-----------------START!-----------------"
	echo "Merging $mkvfile!"
	echo ""
	echo "-----> Follows mkvmerge command output <-----"
	echo ""
	mkvmerge -o ${mkvfile%.*}-merged.mkv ${mkvfile%.*}.mkv ${mkvfile%.*}.srt
	status=$?
	echo ""
	echo "-----> mkvmerge command output finished! <-----"
	echo ""
	if [ $status -eq 2 ] 
	then 
		echo "Merge FAILED, Check mkvmerge output above for more info!"
		echo ""		
	else
		echo "Merged $mkvfile to ${mkvfile%.*}-merged.mkv!"
		echo ""
		echo "Setting tags with mkvpropedit! (Audio: English-Default, Subs: Greek-Default, Title: Blank)"
		echo ""
		echo "-----> Follows mkvpropedit command output <-----"
		echo ""
		"mkvpropedit" "${mkvfile%.*}-merged.mkv" --edit info --set title="" --edit track:a1 --set flag-default=1 --set name="English" --set language="eng" --edit track:s1 --set flag-default=1 --set name="Greek" --set language="gre"
		echo ""
		echo "-----> mkvpropedit command output finished! <-----"
		echo ""
		echo "Moving ${mkvfile%.*}-merged.mkv file to Ready folder!"
		echo ""
		mv ${mkvfile%.*}-merged.mkv $mergedoutputfolder/${mkvfile%.*}-merged.mkv
		status=$?
		if [ $status -eq 0 ] 
		then 
			echo "Moved successfully!"
		else
			echo "Move FAILED."
		fi
		echo ""
	fi
	echo "------------------END-------------------"
	echo ""
done

1 Like