[FEATURE] File Naming Convention for Subtitles and Audio

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.

OK, here is the most recent:
NOVA S46E22 The Violence Paradox.ts-MKV MPEG-2 Convert-2019-12-02T21-15-16.1308101-05-00.zip (129.5 KB)

I would like to confirm that my Plex also does not show the subtitle language, EXCEPT for the MOV_TEXT does show in English. The external SRT is unknown (which I believe is supposed to show ENG), and the EIA_608 have always shown as “unknown”.

I also see that the Audio track is back to Unknown, which was fixed before, but seems to have regressed. I have settings selected to only keep the English audio, which successfully deletes the Spanish track, but doesn’t label the one that is kept as English.

Log attached.
Below Deck _20191202_2100.mp4-MP4 Conversion-2019-12-02T22-03-28.4478557-05-00.log (820.7 KB)

Thank you!

The logs are showing that it’s adding the eng language to the embedded subtitle track but not to the external srt file.

2019-12-02T22:18:04 MCEBuddy.AppWrapper.Base --> handler_name : *srt:hdlr=sbtl:lang=eng@GPAC0.8.0-rev94-g6ada10e30-master

If I’m reading your screenshot correctly I do see the SRT (MOV_TXT) showing its as English but the external isn’t showing English because the filename doesn’t end with _eng because there is only one SRT file. See this post: [FEATURE] File Naming Convention for Subtitles and Audio
The 608 I believe are the closed captions. Not sure if a language can be assigned to it.
As for the audio we didn’t assign any default language to it since there is no way to know what language is there in the audio track unless the original file audio track indicates that language.

Tagging the Video Track with a language will also tag the 608s/CCs - Hand Grenade approach to Room Clearing, and since nobody hardly ever tags a Video Track with a language I don’t believe anyone would be upset if Buddy tagged it the same as the default language tagging everything within it at the same time (unless, of course, some of them aren’t the default language).

The reason I want those external srt files is because if I want to keep something permanently, I’ll want to remove SDH. I’d like not to have to extract them, before working on them and re-embedding them in a final version.

I no longer have the 608s 'cause Buddy stripped 'em out before converting the video track to .264. Buddy is correctly tagging the audio track via the check mark next to ‘English’, but…

All I need is an ‘.eng’ on those external subs Buddy gathered, then created and it’s all good. Buddy should already know they’re English and if not that check mark tells Buddy I want them to be.