[FEATURE] File Naming Convention for Subtitles and Audio


(Robert Johnson) #1

I use Plex for watching most of my media, and I have issues with it finding the subtitle files, even though they are placed as an .SRT file right in the same folder and the .MP4 file. Plex wants the subtitle file to match the MP4 file name, but have a 2 or 3 digit language code added at the end. Right now, IF plex can find the subtitle file, it always displays as “Unknown (SRT External)”. If I add ENG to the file name as in: filename.eng.srt, then Plex will display the file as an English subtitle, and then automatically select that file, based on my preferences.

I have searched for a way to add the ENG to the end of the subtitle file name systematically via MCEBuddy, but can not find that option. Is that available? In the conversion task settings, under Audio and Video, I have audio language set to only keep the english audio track, but would be nice if the ENG could be added to the subtitle file as well.

It is the same exact issue for audio files, yet doesn’t cause any problems with Plex, like subtitles do. It will display all audio as an “Unknown (AAC Stereo)”. I don’t know of a way to tag the Audio as English, as it seems to get that info from the metadata. Is that information created in MCEBuddy or my recording (TV Mosaic) software?


(Goose) #2

Can you attach your conversion log.

MCEBuddy does append the 3 digit language code to the SRT files if it’s extracting them from Closed Caption or from an internal stream. It doesn’t append the 3 digit code if it’s copying an existing SRT file that lies along with the source file but we can definitely look into what’s going on.

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


(Robert Johnson) #3

Wow, that is news to me. I have never seen it add a language code ever. Pretty sure it’s a setup or a settings issue. So many settings! The latest file conversion happened 3 minutes ago, and I uploaded the file now to your ftp server under user robtheone. Looks like logging level was already set to Debug, so hopefully this is the file you need. Let me know if you need additional details.

Thanks a million!


(Bob) #4

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.


(Robert Johnson) #5

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.


(Bob) #6

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.

(Robert Johnson) #7

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.


(Bob) #8

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.


(Goose) #9

Thanks to @bob0937 for this:


(Goose) #10

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


(Robert Johnson) #11

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!


(Goose) #12

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.


(Robert Johnson) #13

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


(Goose) #14

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.


How To Fix: Plex Shows 'Unknown' For Audio and/or Subtitle Tracks
(Robert Johnson) #15

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!


(Goose) #16

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


(Robert Johnson) #17

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


(Goose) #18

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


(Robert Johnson) #19

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