Plex-scripts icon indicating copy to clipboard operation
Plex-scripts copied to clipboard

Audio_sub_changer: More control over the selection of the track, looking at the "version" of the stream

Open Mushin opened this issue 2 years ago • 4 comments

In what file should the feature be added? audio_sub_changer.py

What is the feature request? I'd like to auto select English subtitles, where available, rather than English Forced (which are often auto selected by Plex). Please could you add the functionality to discriminate (and prefer) between Forced and non-Forced subtitles.

Mushin avatar May 28 '22 18:05 Mushin

Just to add a different use case, e.g. anime series may have multiple versions of English subtitles. It would be nice to somehow set a specific subtitle track to be used for the whole series.

Mushin avatar Jul 03 '22 11:07 Mushin

Just to add a different use case, e.g. anime series may have multiple versions of English subtitles. It would be nice to somehow set a specific subtitle track to be used for the whole series.

@Mushin how do these multiple English subtitles differentiate from each other? For example, your original request was "I want the script to select non-forced above forced". That's very clear. Formulate such "rule" but then for these anime versions too. E.g. "give preference if the subtitle has a certain name". Or "give preference if the subtitle is longer". Make a clear rule that I can make in the script.

Casvt avatar Jul 04 '22 08:07 Casvt

@Casvt thanks for the guidance - I hope I haven't over complicated this. See below for an example of 2x subtitle track info from Plex - in this case, it seems the discriminating field would be Title

image

Mushin avatar Jul 04 '22 08:07 Mushin

Alright that's clear. Thank you

Casvt avatar Jul 04 '22 09:07 Casvt

Request completed. See the documentation and examples inside the file to learn how to use the new arguments. The script has had a major face lift with many new features added, speed improvements and has even replaced a whole script (auto_audiochannels.py is now integrated into this script).

The user can now make the script decide the best stream to select based on (all optional except language):

  1. language (e.g. en -> english)
  2. forced status (avoid or prefer)
  3. codec (e.g. ass)
  4. title (e.g. title contains songs)
  5. channel count (audio only; e.g. 6 -> prefer 5.1 audio streams)

You can even give "preference orders" now via the arguments. That means that you can give a selector multiple times like this:

--Language en --Language nl --Language it

This way, English streams are preferred, but if there are none available, then choose Dutch and if that's not available choose Italian, etc. etc. This is available for languages and codecs.

Enjoy!

Casvt avatar Sep 01 '22 15:09 Casvt