How to Tweak Profile to Keep only ENG & UND Subtitles?

I’m using the MCEBuddy to automate the process of adding metadata, renaming & moving my MKV files without further encoding. I’d like to take it a step further & remove foreign subtitles. I’ve tried the MKV Unprocessed profile & renaming without conversion, but can’t figure out what adjustments to make in order to achieve this. I’ve struggled through the documentation and have no doubt it would be clear as day to someone with experience in this arena, so I’m hoping someone will take pity and provide me instruction.

Thanks in advance.

Did you try to select the language in the conversion options page? That applies to both subtitles and audio tracks.

I did, but it seems to have made no difference. I tested a bunch of files using (1) MKV Unprocessed profile - Default language, (2) MKV Unprocessed profile - English language, (3) rename only.

I attached a screenshot with the original files highlighted in yellow. You can see the conversion language specified in the file path.

This may be unrelated, but why is “S32” or “S24” being added to the name of the audio track?

Is there a way extract or trim a file to ~5 min for testing? I only have a few sample files & it’s headache running the conversion process on a large file only to have it not work out.

mcebuddy.log (1.9 MB)

You can use the file splitter on our website to cut the file. Use only the first chunk created.

I will need to see the conversion log for the file to see what’s going on.

I’ll be keeping an eye on this thread.

I attempted to play with subtitles and was only somewhat successful. The handbrake CLI does have a command to set the default lang. It will grab all the english tracks, and only the english tracks while discarding the rest. If the tracks are unmarked (und) it will grab all the tracks you specify (–subtitle “1,2,3,4,5”).

It works well, but is buggy, at least with the handbrake cli. The problem is when your file has PGS subs. Handbrake doesn’t handle them properly and always wants to either burn them right into the file (if output is mp4), or set them as forced (for mkv). Burned is a big no-no for me, and forced is a nuisance that needs to constantly be turned off in plex per each file.

I eventually gave up and just decide the pass the first 5 subs. English is always first or second, and is always within the first 5 etc, so it works. Not elegant, or efficient, but works :slight_smile:

Log files attached, happy to provide any others as well.

Lord of the Rings - The Return of the King (2003).mkv-1 Unprocessed - default-2019-08-13T23-51-13.9573571-07-00.log (456.9 KB)
Lord of the Rings - The Return of the King (2003).mkv-2 Unprocessed - Eng-2019-08-13T23-49-37.7693571-07-00.log (456.9 KB)
Casino (1995).mkv-1 Unprocessed - default-2019-08-14T03-00-26.4762071-07-00.log (3.0 MB)
Casino (1995).mkv-2 Unprocessed - Eng-2019-08-14T14-37-30.6081341-07-00.log (1.9 MB)

Lord of the rings - you haven’t enabled subtitle/closed caption extraction and I don’t see any subtitles in them. In of the you haven’t even selected the track language.

Casino 1/2 - You haven’t select any track language nor have you enabled subtitle/closed caption extraction

Profile Audio Language ->
Closed Captions ->

While there are subtitles in casino 2 since you haven’t enabled extraction in your conversion task settings it didn’t extract anything.

You can try adding
–subtitle-lang-list “eng”
to your handbrake-general. This should select the first english track for you. All other tracks are discarded.

If you add
–subtitle-lang-list “eng” --all-subtitles
it should keep all the english tracks. So if you have english, english forced, and english commentary, sing along etc - it would keep all of them.

–subtitle-lang-list “eng” --subtitle “1,2”
it should keep the first two english tracks. Usually this would be english forced and english.

It’s been a while since i played with these commands, so i don’t remember what happens when you run into UND. I think it just skips it. I do remember that PGS subs wreaked all kinds of havoc. Sometimes they would skip, sometimes they would burn in or be marked forced when they shouldn’t be etc. All other subs other then PGS worked great.

I’m not clear as to why I need to extract the subtitles since I’d like to keep them in the container. I also ran various versions of the MKV Unprocessed profile to see what changed (audio set to default vs english, extract subs, etc) and didn’t notice any difference.

I like @zhulick’s suggestion of tweaking the code. I’ll give that a go & report back in a couple days. Wish me luck!

That’s how MCEBuddy works. Not all formats and underlying encoders support all features, so it’s a step 2 process. First extract all the pieces and then put them back together in the required format. See the how MCEBuddy works page for more details.

If you want to add it back to the final output container in the Expert Settings page of the conversion task check the box for Add subtitles

In my effort to figure things out, i’m pretty sure i broke something. I’m trying to copy all the video, audio & subtitle streams without any re-encoding, as well as rename the file & and embed the poster & metadata. I’m only able to keep all the streams when I select “Rename without converting”, but then the metadata & poster aren’t embedded. How can I keep all the streams & embed the poster & metadata?

Guardians of the Galaxy Vol. 2 (2017).mkv-MKV Cleanup-2019-08-23T20-07-05.6402831-07-00.log (59.6 KB)

I’m pretty sure that “rename without converting” does exactly what it says and nothing more - it will rename and copy a file without touching anything in the file . It’s a very useful feature when you need to quickly rename a bunch of DVR recordings into a format Plex could understand, but i am not sure that it will do what you want it to do.

In fact, i’m not sure that you can do what you want to do in mcebuddy without it having to work the file somehow. I’m not a 100% sure on this, but i think even a minor change like appending the metadata and poster info requires the mkv to be remuxed/rebuild again.

You can try to pass through all the audio and video through the -copy and -copy-mask commands in the cli. You’d need to specify all the formats you want to pass etc. That should trick mcebuddy into remuxing all your existing streams into a new file, eventhough none of the streams are actually touched. During this process it should be able to add metadata. That said, i have no idea if that would actually work. It should, but … :slight_smile:

1 Like

something doesn’t make sense… the “rename without converting” option indicates that we should be able to add metadata. I also found this post, How to automatically convert MKV to MP4 and retain the Subtitles and Chapters, which clearly indicates that subtitles can be retained.

I’m building my Plex movie library to watch offline & it’s metadata function are spotty. The other day I left the house & it show A Simple Favor (2018) as Madagascar (2005). I’m trying to build something foolproof, but I’m feeling a little too much the fool.

Hopefully Goose will shed some light on this & offer a solution.

Good news, it seems the sample I was working with was corrupt & contributing to my issues. I’ll try some more tests tomorrow & hopefully get this sorted out.

Yes it does. Infact MCEBuddy now supports multiple subtitle tracks and extract/embeds them all even if you’re using a regular conversion mode (i.e. not the Rename only mode).

However if your case, your profile is invalid so MCEBuddy can’t proceed:

ERROR> 2019-08-23T20:07:09 MCEBuddy.Engine.ConversionJob --> Unhanded error during conversion, conversion cancelled
System.Exception: Invalid profile, order is empty
at MCEBuddy.Transcode.Convert.GetConversionExtension(ConversionJobOptions conversionOptions)
at MCEBuddy.Engine.ConversionJob.GetDestinationFilename(ConversionJobOptions conversionOptions, VideoMetaData metaData, String originalFileName, Log jobLog)
at MCEBuddy.Engine.ConversionJob.Convert()
INFORMATION> 2019-08-23T20:07:09 MCEBuddy.Engine.ConversionJob -->

I also noticed your profile is called *MKV Unprocessed*, no idea why there are *'s in the name or what the actual profile contains but it seems to be missing the order= directive.