SOLUTION: EIA_608 Subtitles Suck - Here's how to automatically replace them with srt goodness

Hey,

Thanks for writing the code. I’m not much of a coding guy so I need some additional help. I managed to get the file added to the script folder and I set up most of the configuration you specified.

For the step:

Then under Arguments scroll down to Recently Added and enter the following:
{media_type} {file} {filename}

Do I need to specify the media type, file or file name or just copy paste as is?

For the step:

Then all you have to do is modify the top of my script to update the specific locations, and you’re all set.

Could you please clarify this step? How do I update this and specific locations of what?

I have a bunch of tv shows and recordings in one folder for plex. To get this crispy to work, do I need to move these files somewhere else where the script will recognize it?

Any help would be greatly appreciated!

Just copy and paste that as is into Tautaulli. That let’s it know to replace those items with that specific media’s info.

This script is designed to work with an external plex app called Tautulli. It does a lot of things but one thing it can do is run a script when new media is added to plex. My script also uses other external programs, ffmpeg, mediainfo and so on, you’ll see references to these in the code. You need to update the locations for those program where they are stored on your computer.

You can run this script manually if you’ve got python installed, just open a command prompt and call the script like this:

Subprocessing.py episode filepath filename
so something like:

Subprocessing.py episode //tv_shows/Familyguy/familyguy123.mkv familyguy123.mkv

That command would process that one file for you.

Hi,

Thank you for your reply! I really appreciate it.
I apologize, I’m still not understanding what exactly you mean. This may be an extremely stupid question. I am running Plex on QNAP and playing with NVIDEA SHIELD. So when I play recorded shows with subtitles, it is transcoding. I installed separately the Tautulli app in QNAP. I put the py file in hard drive. I mapped the path to the py file in Tautulli app and set up the settings according to your instructions above.
I am not planning to use this for any other program so are you saying the last step, the script doesn’t need to be changed if using for plex? And if we add this script, it will automatically change the sub from unknown to English SRT, right?
If it does need to be changed, where exactly do I need to change it in the script and how do I specify the location for a plex app in QNAP (ie, a path)?

Thank you

Hi,

I tried it the way you explained but I keep getting an error. Here is the error message that I get:

Tautulli Notifiers :: Script error:
Traceback (most recent call last):
File “/share/CACHEDEV2_DATA/Videos/SubProcessing.py”, line 6, in
import sys, os, datetime, subprocess, traceback, re, shutil, difflib, time, errno
ImportError: /share/CACHEDEV1_DATA/.qpkg/Tautulli/lib/python2.7/lib-dynload/datetime.so: undefined symbol: PyUnicodeUCS2_FromFormat

Do you know what this error message is indicating? How can I fix it so that I dont get this error message?

Thank you in advance again for your help.

Those are python errors, my script makes use of python libraries that qnap might not have installed.

Honestly, my script relies on many different programs (all windows based) so I doubt it would work on a qnap anyway. Do you have a windows machine on your network you could install Tautulli on and try that?
You still need to install ffmpeg and mediainfo command line for it to work.

Okay I will try this with Windows.
Thanks you

Cguy1234…

I’m in a similar situation to you except instead of a household of deaf people I have one full of people who speak Spanish as a first language.

Unfortunately I did not realize until yesterday I could use MCEBuddy to extract the CCs from my recorded movies, convert them, and then reinsert them into the MKV file…so I have a library of 3200 movies I now need to fix the subtitles in. Like you, I prefer the subtitles recorded with the movie as they are more correct and the timing is spot on even after editing the TS files.

I apologize because I know just enough to work with all these things but I am in no way a person who can code. Is there a way I could modify your script to process an entire library to process each MKV in it’s own directory with the ability to queue up an entire hard drive.

I would need you to point me to some resources to read to understand the scripts as most of the technical stuff in your original post is Greek to me but I’m a fast learner and I would rather spend a few evenings playing with this to automate the task than months of evenings doing 3200 movies manually.

Great work and thank you for your effort, people like you make this hobby fun and exciting. I wish I had the knowledge to code, but my talents are cars and mechanical things…

OH…one important thing I forgot. Most of my movies are recorded from TCM and have not only two audio streams but four individual CCs streams…Is there a way to modify this to handle all four into individual subtitle files that could be added back into the MKV?

I’m assuming you’re on windows? probably win 10? If yes, you can use a batch script that’s pointed at a folder with your movies in it to process them one at a time. I have one that should do the trick which I’ll post shortly, you might need to modify it slightly. BUT, before you do that, you should make sure you’ve got my script working first. You can call my script from a command prompt and pass it the command line options of {episide} {file location} {file name} and it should process it for you. If it works with one file, then the batch script should do the rest.

You will need to modify my script and put in the specific locations of your various external programs my script relies on. ffdshow, mediainfo, ect…

Make sense?

@echo off

For %%A in (%1) do (
    Set Folder=%%~dpA
    Set Name=%%~nA
)

cd "Path To my script"

subprocessing.py episode filelocation filename
# for example: subprocessing.py episode d:\storage\movies\ghostbusters ghostbusters.mkv  should process that movie. 

Thank you Cguy1234. I am on WIndows 8.1 BTW. I will have to go back to your original post and see if I can figure out how to make the script work. I will have to do a little research to try and understand the basics so I can try your script. I will probably take a few evenings since most of this is Greek to me but you provided enough for me to at least try.

I will post back as soon as I see what I can get working…or not working…LOL

Thanks again…if this works it will save me a ton of work.

Sounds good. The biggest thing is to make sure you’ve got python installed and the necessary python modules. Just google it and you’ll find detailed instructions on how to setup python and associate it with .py scripts. You’ll find the needed python modules at the top of my script.

Just thought I’d let you know the same day you answered me a guy over on the Emby forum, who originally pointed me to this thread, wrote me a custom script using CCextractor as a self contained executable that simply asks for the parent directory where the movies are stored and then it does all the work. He just finished it yesterday and I tried it out and it works fantastic. When I have time I will probably still look at your work because I would like to learn how these things work because it seems I always want to do something almost no one else is doing.

Thank you

Hi, this looks great – exactly what I need for some of my media with 608 closed captions with no subtitles to be found anywhere…

I’m running my Plex server on an ubuntu machine with my NAS mounted via NFS. How can I set this script up? Do I just have to put it on my ubuntu machine, install things, change the path, etc? It looks like it requires python, handbrake(?), mkvtoolnix, and ccextractor.

This script is designed to be called by Tautulli (https://github.com/Tautulli), so make sure you’ve got that installed and configured first. I know there was another user on this thread that got it to work on ubuntu with some modifications, which you’ll need to do as well, or just sit tight and I’ll post a version for linux systems soon, because I’m moving my server off windows to ubuntu soon as well, and will re-write the script when I do so.

I’ve re-written this script, making it FAR more efficient, and adding features, removed bugs. You can get the Ubuntu version here:

The above script is designed just for your PlexDVR recordings, the script for processing files that come into plex from any other source will be posted soon - still getting the bugs out of that one.

Enjoy,
{c}guy

1 Like