Plex choosing the wrong tracks

Server Version#: 1.41.3.9314-a0bfb8370
Player Version#: All my players have the issue.

Issue

Summary

At some point in the last few months, Plex changed from selecting Default tracks to selecting English audio (even commentary tracks) and the last English subtitle track even though the first track was Default.

All of my existing chosen TV show subtitle tracks were modified, but it appears only movies with an English commentary track were changed.

History

In the past, Plex would use the default audio and subtitle tracks even if my language was English. This was great because I could control the defaults for all users by configuring defaults in the MKV file.

  1. For foreign movies, it’s using the English audio commentary track rather than the Chinese audio.
  2. For foreign shows with subtitles, it’s choosing the “signs and songs” track rather than the translation subtitle track even though the translation track is the first track, and it’s the default.

Details

Plex config

Movie example

This is how it looks now when I add a foreign movie:

image

This is how it should look:
image


Here’s the file in MkvToolNix:

Notice how both the first audio track in Chinese and first subtitles in English are the default? That’s how Plex used to work. It would select those.

TV Show example

I added a new Plex profile, with these settings just to verify it wasn’t my account:

Here’s an example of an foreign TV show:

It’s forced to use the Japanese audio track, but for some reason, it selects the second subtitle track. That track is “signs and songs”, not the show itself.

As you can see here, the first subtitle track is the default:

This isn’t just happening on local profiles either.

My sister ran into this issue on her Plex and was wondering why it had the English audio commentary when she wanted to watch a foreign movie.

A friend created a brand new Plex account, and I shared my Plex profile with him. He was able to reproduce the same issue with multiple shows using the second/last English subtitle track.

When did Plex stop selecting the default tracks? What changed in Plex and when? How do I fix it?

I went ahead and updated my post title and contents with screenshots and better examples so it’d be easier to read and follow. Hopefully this helps shine a light on the issue. It’s becoming a huge issue for me because I have a lot of foreign content, and it’s problematic to watch when I have to keep changing the subtitle track.

Plex does not use the track flags for selecting tracks and never has. It should read them in from an MKV to save in the database metadata_items table, but it has never selected the tracks based on those flags.

Based on your first screenshot, Plex is working exactly as intended.
If you recently changed the settings in the first screenshot to actually include preferred languages than it is possible that could be the reason. Actually, the checkbox to automatically select audio and subtitle tracks would be the more relevant setting.

I have had my language settings set to my preference for years, so I do not remember how it worked without that (I might have even done that from the beginning).

If that checkbox is not set, I believe Plex will use the first track in the list (it does not matter if that track is marked as default or not). It should be the same with the subtitles as well to take the first track. Looking at your foreign TV show example, I am not sure why it is taking the 2nd track. I was going to say what is probably happening is that Plex is assuming English as the preferred language and therefore because the show only has a Japanese audio track, it was taking the 2nd one because it was tagged as a forced track but I just checked and you do not have that flag set.

If you do not believe me about Plex not honoring the track flags, do a search of the forums and you should find a feature request to have this be implemented and probably many threads complaining about it.

Additionally, I am pretty sure it was in multiple of those threads where either a Plex ninja or employee mentioned that tracks that are not properly tagged for their language and therefore show up as “Unknown” get assumed to be English. That is where my assumption is coming from that Plex is defaulting to English (but it could be based off your account level language setting).

For TV series at least, you can edit the show at the series level and from the edit modal, click “Advanced” then scroll all the way to the bottom and you can set the preferred audio and subtitle language as well as the “auto-select subtitle mode”. That will only apply to your account (and it will look different for you if you are the admin vs a user you share with but they can do it as well).

For movies, you just have to change the tracks manually.

-Shark2k

Language preference change

I’m not sure when I changed my preferred languages. Pretty sure it was when I first set it up (in April 2023).

Missing language in MkvToolNix

If the language is missing, it shows up as und, not en, in MkvToolNix. These are both defined as English.

Workaround for Movies

I might have to change the movie language manually. That’s pretty annoying though, but not as bad.

Anime subtitles issues

The anime subtitles are way worse. I literally have to change hundreds by hand, and every profile needs those changes including the ones for my kids.

Auto-Select Subtitles

I have this already set up:

The issue is that Plex isn’t selecting the first, it’s selecting the last one. Not sure why. Very strange!


^^ I also have this “Automatically select audio and subtitle tracks” option checked, and that’s probably why Plex chooses what it does.

This is the default behavior. I don’t wanna turn this off because Plex is buggy; I’d rather the bug get fixed.

I am not sure why Plex is taking the second subtitle for you, so do not know what more to say about (outside of seeing if anything in the logs points gives a hint).

Regarding TV series (specifically Anime for you), as I mentioned above, you can change the setting on a per series level. If you have your Anime combined within your TV series library, than this would be the best option.

Hover over the poster and click the pencil icon to get to the edit dialog for the series.

  1. Click advanced in the left panel then scroll to the very bottom of the right window
  2. Select the preferred audio language
  3. Select the preferred subtitle language
  4. Select the autos-select subtitle method (if applicable)

That will update the audio and/or subtitle tracks for the series. The one thing I am not sure of is if the tracks will update if they were manually changed (I do not think they will be I am not 100% certain).

One additional suggestion I would give is for your subtitles to set the forced track for the “Signs and Songs” subtitles. There is a chance that might help with the issue as Plex should not select those subtitles when you choose a foreign audio.

In case you are not familiar with how forced subtitles work (as I see a lot of people improperly label these) here is a quick example.

Using anime, we will say that you have 2 audio tracks, Japanese and English. You only understand English so when you watch Japanese you require all speech/text to be subtitled so you know what is going on. Now, if you watch in English you normally do not require subtitles, however if there are portions of dialogue (or important on-screen text) that are in a foreign language you do not understand, forced subtitles would make subtitles appear during those parts only.

So to summarize forced subs:

  • Audio in your native language but contains portions in a foreign dialog => subtitles appear
  • Foreign audio => forced subs not enabled, full subs are used

For the past few years I have been marking my subtitles as forced when they are forced and I have not seen the issue you have with the 2nd subtitle being selected.

If you do update the file to mark the subtitle as forced, you will need to analyze the file to pick up the change. You will then see “Forced” in the subtitle drop down for that subtitle (similar to the following except my forced subtitles I keep as external subs so that is also noted in the drop down).

image

I have the “automatically select audio and subtitle tracks” selected as well, however I have never seen the 2nd subtitle track get selected. In my case, it is always the first subtitle that is selected. That said, I do set my subtitles to so that they are marked as “forced” or “SDH” if they are not (what I refer to as) “regular” subs (i.e., no SDH/Hearing Impaired stuff or just foreign parts). Additionally, if the English subtitles are in SRT format, they are extracted and are then external subs (as shown in my last screenshot again). PGS/Vobsub and ASS subtitles I keep in the MKV container (though ASS subs could be externalized since that works now).

So, sorry for the slightly long-winded response, but my last 2 suggestions would be to set the preferred audio and subtitle language per series for your anime and mark the “forced” subtitles as “forced” within the MKV container.

-Shark2k

1 Like

Configuring Languages

Edit button missing for profiles

That edit button’s not available on my other profiles:

TV Show configuration

Looks like it manually set these to account default???:

Pretty sure I configured these at the library level for the “Anime” library. That’s probably why. I’m wondering if there’s a way to change them back to “Account default” for all series.

I’ve removed English audio from all my anime in this library, so I can probably set these to “Account Default” now. I wonder if that’s related.

How to set forced?

Is there a way to bulk set these subtitles tracks to “forced” that you know?

Here’s my idea:

  1. Write code to check all subtitles tracks count === 2
  2. Using mkvpropinfo to save the second track as “Forced”.

For files with more than 2 subs:

  1. Write code to check all anime files for subtitles tracks count >= 3.
  2. Figure out which tracks are which and if I even need the others.
  3. Re-order tracks so “songs and signs” is track 2.
  4. Now use mkvpropinfo to set the second to “Forced”.

Lots of my movies have more than 2 English subs, and I’m not sure which is which. It doesn’t tell you. They all say PGS, and I have to reorder them and set the first as default. I’m curious how you can tell. I’ve seen those SDH subs before too. “:musical_note: singing song” etc. I just haven’t spent the time to name them. I wonder if it’s worth it to do that.

Does Plex look for any special text or only metadata?

Also, can you link me somewhere I can vote on the feature for adding “use Default” to Plex? That’s a killer-app feature I’d say. It lets me configure everything in the MKV file and make adjustments later. Then my other profiles won’t need this reconfigured.

Probably a “forced subs” issue

You’re right, it’s probably an issue with missing Forced subtitles. Still don’t understand why Plex wants to choose the second one as both are PGS for my Blu-ray rips or both are ASS for when I mux in fansubs. But I’m not marking any as Forced, so that’s probably related.

Many series apparently only have 1 set of subs because the code I wrote at the time only copied in 1 set of subs. Not the case anymore, but many series have 1 set of subs, so it’s possible this has always been an issue, and I simply never noticed.

Honestly, I leave the subs the way they are, but it makes sense to fix them.

Side note about subs

I always put subs in the MKV file. I time-align subs, and that’s easy to do when copying them over to my BD rip from a fan copy. If I have to modify the timings in the ASS files, that’s a lot more work.

If I have SRT, I convert them to ASS because I set Plex to not change resolutions which keeps 480p subs at 4K, but the issue with SRT is they’re way too small. If I convert them to ASS, I can control the size and placement, so that’s what I’ve done.

Hmm
 Not sure why you are not seeing the edit button on your other profiles. I just checked on my managed user and another full Plex account I have and it appeared on both.

For “TV Show configuration” I just checked and those settings cannot be changed at the library level, so it seems like you might have gone through and actually set it for each series already. I do not believe there is a way to reset the language defaults for a library.

“How to set forced?” section.
First, this is the feature suggestion I voted on, Give Option to Play Default or First Audio Track. It’s been a while since I’ve looked at it, but it should be relevant. Note it only has 23 votes and also that vote count does not necessarily mean a lot because there are feature requests out that for years (older than the one I linked) with hundreds of votes and no movement.

Yes, you can bulk set the different flags on a track. You would actually use mkvpropedit from MKVToolNix. An example of using mkvpropsedit to update the files (I have this saved as a .bat file and this particular example would set the first subtitle as forced and the next as just a “regular” subtitle (i.e., SDH subtitle without the SDH stuff). I also included the option to set the SDH/HI flag, but since it is set to 0 that means it will be off.

for %%f in (*.mkv) do (
		echo %%~nf
"C:\Program Files\MKVToolNix\mkvpropedit" "%%~nf.mkv" --edit track:s1 --set language=en-US --set flag-forced=1 --set flag-hearing-impaired=1 --set flag-default=0 --set "name=Forced" --edit track:s2 --set language=en-US --set flag-forced=0 --set flag-hearing-impaired=1 --set flag-default=0 --set "name=English"
)

For your 2 different scenarios, I have a suggestion though it depends on how you plan on coding it. To quickly get the information you are looking for, I would suggest grabbing a copy of your Plex DB and then using something like DB Browser for SQLite to open that database to query it. Easiest way to do that is go to the settings from the web app, scroll down to the “Manage” section in the left panel and then click on “Troubelshooting”. From the “Troubleshooting” page, click the “Download Database” button and wait for it make a copy of your DB and then save the zip file and extract the DB. Use DB Browser to open it (hint rename the extension to end with .db and yo ucan associate that to DB Browser) and then you can go to the “Execute SQL” tab and run this query:

SELECT mp.file, COUNT(mp.file) "total subs"
FROM media_parts mp INNER JOIN media_streams ms
	ON mp.id = ms.media_part_id INNER JOIN media_items mi
	ON ms.media_item_id = mi.id
WHERE ms.stream_type_id LIKE 3
	AND mi.library_section_id = (SELECT id FROM library_sections WHERE name = 'Anime')
GROUP BY mp.file
HAVING COUNT(mp.file) > 1

Change the name (where I have it set to ‘Anime’ to the name of your Anime library if it is different. What the above query will do is simply give you a list of the file path (as shown in Plex) and total subs. You can change the line HAVING COUNT(mp.file) > 1 to be = 2 or > 2 if you want to separately get the files that have 2 subs and 3 or more subs.

You can then either save the results to a CSV file (toolbar above the SQL tab 4th to last icon) or you can click the top left corner of the results grid and then right click and select one of the “Copy” options and then paste it into an Excel/Google Sheets file.

Going back to my “depends on how you plan to code it” sentence, you could then use that CSV file as an input to loop through and then create the mkvprops command you would need.

I process my files in a certain way so I have a Python script I wrote that will analyze the file and determine the track info and then do what I used to do manually automatically. To get that info I actually use 3 different programs, ffprobe (part of ffmpeg), mediainfo (download the CLI version) and mkvmerge (part of MKVToolNix). I actually use the mkvmerge data as the main and the others are used a supplements, but that will get you the info you need which could then allow you to determine number of subtitle tracks via code and go on from there.

I label the SDH tracks as such because if I have an SDH subtitle and a “regular” subtitle, I personally prefer the “regular” subtitle most of the time as I do not need all the additional info. I am honestly probably the only one on my server that actually pays attention to that, but since my server is first and foremost for me and I decide what gets done, I process my media to how I want it. The people I share with are generally just happy to have the access.

Regarding you question about special text vs metadata, Plex will look at the forced track flag and hearing impaired flag from a MKV and display “forced” or “sdh” for the subtitle based on that. See this example of 2 PGS subtitles in a movie with one having the hearing impaired flagged checked and Plex includes SDH next to the language.

The text underneath is set by me as the “name=” in my bat example above. That leads me to text, which is Plex does not use that to determine anything, but if you include a name for the track, Plex will parse that out and display it in the drop down (on most clients I believe, I think only a few do not show it).

Hopefully that at least starts to answer you questions. I am more than willing to help as much as I can, I just want you to be aware I am not a programmer but I like programming (but I would consider my self probably average if that). The other thing is that a lot of this comes down to personal preferences, so whether you should mark SDH subtitles as such ultimately comes down to you and if you feel it would actually be worth it. Similar to how you choose to convert SRT to ASS, whereas I had always preferred SRT for the most part (that has slightly changed with the better implementation of ASS subtitles in clients).

Let me know if you have any more questions/need anything clarified and I will answer as best as I can.

-Shark2k

1 Like

I just ripped a new show today and muxed in some fansubs. These came with 2 tracks, and the “Signs and Subs” one was already set to “Forced”.

I rearranged them in the MKV file so the first track had dialog subs.

After doing that, it chose the first subtitle track, not the second like with other shows! :+1:

1 Like

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