File Naming Convention for Subtitles and Audio

I ran into this same issue. Plex shows Unknown for subtitle tracks that MCEbuddy either extracts from dvr’d shows. I use mkv files exclusively so the solution for me was to have MCEBuddy call mkvedit in post processing and add ‘English’ to the subtitle properties so Plex displays it correctly. I can post my post-processing command line if you’d like. But I think it only works for mkv not mp4 files, YMMV.

Thanks for the reply and trying to assist here! So to understand clearly, your solution is to use a Plex post-processing script to add “English” to the file properties. Correct me if I am wrong, but I believe that script option is only available if you use Plex DVR functionality. Is that right? I can’t find a post processing script option in my plex server settings.

I am using TV Mosaic to record my shows, then MCEBuddy picks up the file and removes the commercials and creates the subtitle file.

Does this mean that for you also, MCEBuddy does NOT add the language extension to the SRT file as well? Or for an MKV file, is the subtitle burned into the file, so there is no separate SRT file? I use both an Apple TV and an NVidia shield, but the Apple TV doesn’t seem to like files in an MKV format, unfortunately.

Yes, I use PLEX Dvr… but it shouldn’t matter what you use… MCE is picking up the recording like yours does and then removing the commercials, and extracting the subtitles into an srt file. Then my post process script (that mce buddy runs) is what sets the specific ‘english’ attributes (property) to the subtitles (and I know the audio could be set too) again, not sure mkvedit can do mp4 files, but I’m sure there’s something else out there that can.

  Hope that helps, and let me know if you want my script. It's just basically a couple of lines that set the properties of each thing correctly.

Oh OK, didn’t even know that MCEBuddy had a post processing section. Yes, please share. Can you also share where this script would go? Is this in the GUI and I’ve never noticed it? I’ll take a look and see if it the same type of modification can be adopted for an MP4 file. I appreciate the info. Very helpful.

It’s not in the main interface, but easily added by adding a couple of lines of code to the profiles.conf file… I’ll send detailed instructions in a separate post along with the code to make it work.

1 Like

Thanks to @bob0937 for this:

For clarification, it adds the _xxx language name if there is more than 1 subtitle track in the file

Thank you so much! I was messing around with the script above, but am a bit confused. It is written specifically to delete the SRT and EDL file (I need the SRT file) and my files are formatted in MP4 format rather than MKV. After a little bit of googling I realized that my command line skills are quite minimal. So this is what I came up with for an MP4 file:

CustomCommandPath=C:\Windows\System32\cmd.exe
CustomCommandParameters="/c mp4box.exe "%convertedfile%" -lang 1=eng -lang 2=eng"
CustomCommandHangPeriod=100
CustomCommandCritical=true
CustomCommandUISession=false
CustomCommandShowWindow=false

This seems to work on SOME of my files (tested with different file types, as well as testing out changing of the font of the burned in SRT’s at the same time, so now getting 2 different subtitle options showing in Plex with different fonts, although there is only one SRT or none if burned in), but Plex still shows another codec as “unknown” ( * Codec MOV_TEXT * Stream Identifier 3 * Display Title Unknown (MOV_TEXT)), but now both the video and main audio files are showing as English. I am sure that there are better ways to achieve this, and if anyone has suggestions, I would appreciate them.

Also, the other part of my original question was renaming the closed captions SRT file to add the ENG.srt language code for Plex as well. You say that MCEBuddy will automatically do this if there is only one subtitle file, which is all that I am generating - one SRT file. In the original TS file, there are EIA-608, EIA-708, and timed text captions present, which I would LOVE to keep, but the MP4 conversion deletes those and keeps 1 SRT file, which doesn’t have a language code.

I looked through the advanced settings/tweaking guide but only found the SRT referred to as %srtfile% and when I messed with changing the file name in the same post processing script method as above, any changes ended up adding the ENG to the end of the file, as the srt section of the filename appears to be hard coded based on what I saw in the log file: %SRTFILE% = “filename.srt”. Changes only resulted in “filename.srt.eng”. It doesn’t appear that I can change that filename to add a language code in the same way as adding a post processing file above (at least with my limited knowledge). What am I missing here?

For the time being, I have just added .ENG into the filename as a custom file rename in order to get it to work.

Thank you again!

1 Like

Yes, it keeps the first track encountered when extracting SRT files from MP4 or MKV containers or Closed Captions from a TS, WTV or DVRMS file.

Can you upload a copy of your TS file with the EIA-608 and EIA-708 streams and we’ll see if we can add support for multiple streams in CC timed text.

Sure. File has been uploaded to FTP site, user robtheone folder. Thank you!

This features has been added in Release 2.4.9

MCEBuddy will now detect the language name from the SRT file name (e.g. filename.fre.srt) from the metadata inside the file if the subtitles is being extracted from the original video file and use this 3 digit language code in the final SRT filename.

MCEBuddy can read Plex and Serviio subtitle filename formats including the .forced tag to parse the language name.

It also include the language tag in the MP4 and MKV files metadata for the subtitle tracks. If there is no language code detected then it will use the 3 digit code from the language selected in the MCEBuddy settings page.

1 Like

Thanks for the feature update! MUCH appreciated. Plex is indeed seeing the both the Audio as well as the subtitle files with the ENG label! That is awesome! It is odd though, that when I use another program to watch the file, I have to locate the subtitle file because the SRT filename is not matching the generated MP4 file. The SRT files seems to always be whatever the original filename was. Generally I either put a custom filename or even let MCEBuddy generate the file name, and the MP4 filename is correct, but the SRT name doesn’t match.

If I use MRMC or Kodi to watch the program, then they don’t seem to find the SRT file. I always assumed the filenames had to match, except for the 3 digit language extension.

Example:

Original Recorded filename: NBC Nightly News With Lester Holt -20181102.mp4 (originally a .TS file in an MP4 container)
MCEBuddy Generated Filename (After commercial removal and conversion):
NBC Nightly News With Lester Holt -2018-11-03 1311.mp4
MCEBuddy SRT Filename: NBC Nightly News With Lester Holt -20181102.srt

Shouldn’t the SRT filename match the MP4 filename? I will upload the LOG file for your review. Thanks!

Yes it should, please upload the log so we can see what’s going on.

Thanks. Already uploaded. Let me know if you need additional info.

1 Like

Thanks for pointing that out, it’s been fixed in today’s 2.4.9 build

WOW! Lightning fast, incredible! Thank you! Will give it a try

A year later, but I am having no luck getting the sub file tagged.
I have ‘eng’ set as the preferred Audio Track identifier (if none is present).
I am not muxing in the sub track (will remove HI - at some point).

The original audio track is tagged English, but the original text tracks are not (I assume):
(2.4.10)

General
ID                                       : 1 (0x1)
Complete name                            : H:\Buddy-Deck\NOVA S43E18 Treasures of the Earth Gems.ts
Format                                   : MPEG-TS
File size                                : 2.84 GiB
Duration                                 : 52 min 51 s
Overall bit rate mode                    : Variable
Overall bit rate                         : 7 701 kb/s
Law rating                               : TV-G

Video
ID                                       : 49 (0x31)
Menu ID                                  : 3 (0x3)
Format                                   : MPEG Video
Format version                           : Version 2
Format profile                           : Main@High
Format settings                          : CustomMatrix / BVOP
Format settings, BVOP                    : Yes
Format settings, Matrix                  : Custom
Format settings, GOP                     : Variable
Codec ID                                 : 2
Duration                                 : 52 min 51 s
Bit rate mode                            : Variable
Bit rate                                 : 6 932 kb/s
Maximum bit rate                         : 24.0 Mb/s
Width                                    : 1 920 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 16:9
Active Format Description                : Pillarbox 4:3 image
Frame rate                               : 29.970 (30000/1001) FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Compression mode                         : Lossy
Bits/(Pixel*Frame)                       : 0.112
Time code of first frame                 : 00:00:00;00
Time code source                         : Group of pictures header
GOP, Open/Closed                         : Open
GOP, Open/Closed of first frame          : Closed
Stream size                              : 2.56 GiB (90%)

Audio #1
ID                                       : 52 (0x34)
Menu ID                                  : 3 (0x3)
Format                                   : AC-3
Format/Info                              : Audio Coding 3
Commercial name                          : Dolby Digital
Codec ID                                 : 129
Duration                                 : 52 min 50 s
Bit rate mode                            : Constant
Bit rate                                 : 192 kb/s
Channel(s)                               : 2 channels
Channel layout                           : L R
Sampling rate                            : 48.0 kHz
Frame rate                               : 31.250 FPS (1536 SPF)
Bit depth                                : 16 bits
Compression mode                         : Lossy
Delay relative to video                  : 29 ms
Stream size                              : 72.6 MiB (2%)
Language                                 : English
Service kind                             : Complete Main

Audio #2
ID                                       : 53 (0x35)
Menu ID                                  : 3 (0x3)
Format                                   : AC-3
Format/Info                              : Audio Coding 3
Commercial name                          : Dolby Digital
Codec ID                                 : 129
Duration                                 : 52 min 50 s
Bit rate mode                            : Constant
Bit rate                                 : 192 kb/s
Channel(s)                               : 2 channels
Channel layout                           : L R
Sampling rate                            : 48.0 kHz
Frame rate                               : 31.250 FPS (1536 SPF)
Bit depth                                : 16 bits
Compression mode                         : Lossy
Delay relative to video                  : 29 ms
Stream size                              : 72.6 MiB (2%)
Language                                 : English
Service kind                             : Complete Main

Text #1
ID                                       : 49 (0x31)-CC1
Menu ID                                  : 3 (0x3)
Format                                   : EIA-608
Muxing mode                              : A/53 / DTVCC Transport
Muxing mode, more info                   : Muxed in Video #1
Duration                                 : 52 min 51 s
Bit rate mode                            : Constant
Stream size                              : 0.00 Byte (0%)
CaptionServiceName                       : CC1

Text #2
ID                                       : 49 (0x31)-1
Menu ID                                  : 3 (0x3)
Format                                   : EIA-708
Muxing mode                              : A/53 / DTVCC Transport
Muxing mode, more info                   : Muxed in Video #1
Duration                                 : 52 min 51 s
Bit rate mode                            : Constant
Stream size                              : 0.00 Byte (0%)

Regards… Tony

This topic has been a little confusing. I can confirm that it did work in 2.4.9, however I can not recall at the moment if it ever actually added ENG to the subtitle name to identify the language. I am using 2.4.10.1 today, and although the ENG is not in the subtitle name, Plex now identifies the Audio in English rather than unknown, and subtitle language in English only for the MOV_Text. My SRT External file now shows as “unknown” also, as well as the timed text’s EIA-608 and 708. I believe that perhaps functionality may have been lost with updates, but not 100% sure.

Well, I gave up, but have just revisted again as I’m recording with Plex-DVR - then post processing with MCEBuddy and can’t seem to get the external srt files tagged with ‘.eng’, and of course they remain ‘Unknown’ as such, for without that tag - they are, in fact, Unknown:

Unknown%20Subs
^^ that’s 20 minutes old on 2.5.1

Also recently this shortcoming came to a boil when I recorded ‘Professor T’ - in German - and Plex didn’t know I needed those subs, 'cause they were ‘Unknown’. Had they been '.eng’ed, Plex would have made an informed decision and turned them on.

You can attach your conversion log and we can see whats going on.