Search Delnay.com

Saturday, February 8, 2014

Removing Profanity In Movies


There are so many great movies produced in this country that are completely and deliberately trashed by profanity. Aiming for a specific rating to seemingly draw the largest audience, Hollywood constantly tempts us to lower our standards. I have been searching for a long time for a way to legally watch these movies and not be subject to the profane language. I have tried the $100 profanity filter "black boxes" that used to work great, but are catching less and less on the newer movies -so it now sits in my basement, unused. Other systems are subscription based -I wanted something free.

I have found a solution that is not perfect, but it catches everything I want it to. It is not painless -nor is it for a non technical person. For those who enjoy a mild challenge, it will be right up your alley. Here is (as one of my friends put it) my "recipe". I use both Windows 7 and Linux in this solution, but most of the software is OS agnostic. Depending on the quality of the subtitles, it takes me about 30-45 minutes to "prep" a movie for the family to watch. Most of that time is spent pulling the movie off the DVD. Apparently this works for Blue-Ray as well, but I have not tested it yet.


Stuff you'll need to download (in order of appearance):
  • XBMC
    • http://xbmc.org
  • MakeMKV 
    • http://makemkv.com
  • Subtitle Edit
    •  http://download.cnet.com/Subtitle-Edit/3000-2170_4-90536.html
  • XBMC-Language-Filter-Linux-1.0.tar.gz
    •  https://github.com/compwright/XBMC-Language-Filter/tree/master/Linux

Optional:
I have a MythTV backend-only PVR to store media and watch / pause / record live TV. It's nice if you have it, but it is not mandatory.

XBMC
Install XBMC somewhere and play around with it a little to get familiar with how it works. It is my favorite front end for a media center and is very easy to install and use. Using it is a little overwhelming at first because of all of the optional plugins, but they are not mandatory. There is a profanity filter add-on for XBMC, but I found it not to work nearly as well as the standalone one I mention above. XBMC works great for Windows and Linux and interfaces with many media centers (Windows MediaCenter, MythTV, NextPVR, and more.)

MakeMKV
Download and install MakeMKV. I have it on Windows 7 and it works great. Use this to create a mkv (video and audio) AND an english subtitle track. DO NOT make these files available to anyone who does not legally have the right to own them! Using MakeMKV takes a little time. You want to extract the video, audio and at least one of the subtitle tracks (there are usually many languages available).

Subtitle Edit
Use the resulting mkv file to extract an *.srt file (the subtitles) with Subtitle Edit program. This is the most painful part of the process as you have to audit / correct the subtitle images that the OCR code does not understand. You will likely see some bad words as the OCR scans through the subtitles, but no one will see these when the movie plays. I usually ADD all unrecognized valid words to the dictionary so I get asked less and less as the dictionary becomes larger.

Now, you have a mkv and an srt file.

Language Filter
The language filter is a perl script, so make sure that the Perl interpreter is installed on your machine first. Use the XBMC Language Filter script to extract the timestamps (where the bad words are found) from the srt (text subtitles) file. An "edl" file is created from the perl script. BTW: You can edit which words you want XBMC to mute if you choose. Beware, all of the bad words are in these text files, so if you go in adding some additional words, please understand you will see all the bad stuff (that is muted in the movie).

Put the eld file and the mkv file in the SAME DIRECTORY. Name these two files EXACTLY THE SAME -except for the extension.


Use XBMC to scan in your new video and play it. It should mute at exactly the points where profanity shows up in the subtitles.  Of course, you'll want to watch the movie with the subtitles OFF.

There are other ways of doing this by downloading subtitle files from the web, but I have found that it is difficult to get those subtitles lined up properly with the movie you are watching. Even if they are only a second off, you'll hear bad stuff. It's best to extract the subtitles directly from the same file you'll be watching.

That's it in a nutshell. At some point in the future, I will edit this and make it more 'step-by-step'.

Enjoy!