[OPEN BETA] Mute Profanity

  Thread Rating:
  • 4 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
fegunz Offline
Junior Member
Posts: 27
Joined: Apr 2010
Reputation: 1
Post: #1
After a near one year hiatus, I'm back and getting ready to release version 1.0 of my mute-profanity plugin! I've made numerous improvements and enhancements and am pleased on how much this is progressing. But before 1.0 is officially released, I need some more testing and feedback from the community. So please download the beta and test it out on your setup.

I use github for both source control and issue management. Download the zip and log any bugs you find there, but I'll be watching this thread as well.

Download link
Github Project Page

I'm especially interested in hearing from you if you meet any of the following conditions:
* You have .mp4 files with embedded subtitles
* You're running on a linux / Android / iOS system
* You need to extract subtitles from a mkv or mp4 file in Windows
* You have a lot of TV shows you want to mute profanity on

Feel free to comment about anything, from bugs to what you just don't like or wish it had. I want this to be used. However, realize that this is a beta and might not work perfectly just yet. If you're the type that gets angry when something doesn't work just right, you should hold off and get the release version in a few weeks.
find quote
fegunz Offline
Junior Member
Posts: 27
Joined: Apr 2010
Reputation: 1
Post: #2
I should probably include the README as well, so people can know what this plugin does:

I've created a plugin that is designed to mute profanity in your movie library. It works by comparing the movie's subtitle file against your filter file. When a match is found, XBMC will mute the audio for the duration of the word.

How to use it:
Navigate to a movie or TV show you'd like to edit. The add-on will try to find the subtitle file for that movie, extracting embedded subtitles if possible. If you don't have one, it will ask if you'd like to download one. Downloads come from http://www.opensubtitles.org. After a very brief processing time, you then play the movie normally. You will notice that the blocked words are muted!

Key Features:
* Category-specific strictness ratings
* Mute profanity in either movies or TV shows
* Extract subtitles automatically from MKV or MP4 files
* Download missing subtitles from the internet
* Edit the strictness in the settings menu

Configuration Details:
Since the subtitle file and not the audio itself is analyzed, you will notice that the mute times are not always exact. The script is only guessing when the blocked word is spoken, and it can be wrong sometimes. This add-on includes a setting which specifies the amount of time in milliseconds before and after the time of the blocked word that XBMC should start and end the mute. By default, this is 300ms, but can be adjusted for more or less time, depending on preferences.

It's important to have an accurate subtitles file, with correct timings. If you notice that your subtitles show up too early or too late, the script will mute too early or too late as well. Even with max timing settings, the plugin will not mute before or after the subtitle is no longer displayed.

After you download and install the application, the list of blocked words is found in the script directory under "resources"->"filter.txt". Each word should be on it's own line and you can use the '*' character to match any number of characters. Change this file as you see fit.

How it works:
XBMC has built-in the ability to read a EDL file (Edit Decision List) and process it accordingly. The script will create this file, which contains the timestamps of when mutes should occur. Again, this calculation is found from processing the subtitles file of the movie being 'edited'. If no SRT file could be found, the add-on will attempt to download one based on the name of the file from http://www.opensubtitles.org. If one could not be found, the script will fail. If you need to mute a movie and the download feature is not working, I suggest you download the SRT file separately, ensure that it's timing is correct, then re-run my script to mute the profanity.

Enjoy!
find quote
cinam Offline
Junior Member
Posts: 4
Joined: Jul 2013
Reputation: 0
Post: #3
Hi,
I'm very interested in this, but I may not be the best assistance for the test case you wanted to put forward (I have little with swearing in it and not a whole lot of MP4 encoded files). That said, I do run XBMC on linux (XBMCbuntu)

What I do have is samba mounted (read only) shares to access media which I'm sure will throw a spanner in the works for the auto-download of .srt files. I also have a number of DVD's which I'm hoping to be able to use this on.

Think it's possible to store the downloaded .srt's in a temp folder ? I saw where you download in the python script, but not sure what the effect of changing that would be (not good I'm guessing).

Thanks and great job in making the effort to produce a great addon like this!
find quote
fegunz Offline
Junior Member
Posts: 27
Joined: Apr 2010
Reputation: 1
Post: #4
(2013-07-15 03:32)cinam Wrote:  Think it's possible to store the downloaded .srt's in a temp folder ? I saw where you download in the python script, but not sure what the effect of changing that would be (not good I'm guessing).

The download location of the .srt isn't very important, I could download it anywhere, however, that's not the case for the .edl file. The output of this plugin is a edl file (Edit Decision List) that XBMC uses to know when to mute the audio. I'm not exactly sure what algorithm XBMC uses internally to find this file, but I know that as long as it's in the same folder with the same name (except the .edl suffix) as the video file, XBMC will use it. If the plugin can't write a file to the filesystem, XBMC won't find an edl file to know when the mutes should occur.

I'm curious how a subtitles downloader plugin works for samba shares. I assume they need write privileges to work as well? In theory, this plugin should work the same way.
find quote
cinam Offline
Junior Member
Posts: 4
Joined: Jul 2013
Reputation: 0
Post: #5
I'll have a play.
Technically it's just a mount point on the file system, so it shouldn't be an issue to alter the credentials to allow read/write however I set it that way to ensure no one accidentally deletes anything from the master (clumsy fingers syndrome).

I'll test out and let you know - it will involve a bit of creative editing so I don't lose my database and still allow only read only to everyone else Smile
find quote
dickalan Offline
Senior Member
Posts: 119
Joined: Jan 2009
Reputation: 0
Post: #6
This is terrific! Looks like you single handedly put Clearplay/Cleanflix out of business Smile. I've been using "Sensible Cinema" for the past while (you should look it up-had option to integrate with XBMC) but this seems to be a lot more automated/customizable/accurate for my needs. Thank you!

Great idea to include the muted word in the .edl file.
Great idea to include *** in the subtitle!
The accuracy for the muted word is really good!

Here are some things to consider:

1)
Request: Is it possible to output the EDL file to different formatting? For example, the EDL currently it looks like this:

Quote:###### This section is automatically maintained by the Mute Profanity plugin ######
00061.717 00062.560 1 #Muted:'bitch'
00982.800 00983.938 1 #Muted:'fuck'
etc.

But XBMC can also read EDL files that look like this (taken from the same movie)

Quote:01:00.54 01:02.56 1
06:09.66 06:12.40 1
etc.

The benefit to displaying the time stamp the second way is that a human can read it a LOT easier. Hence they can go in and manually edit the .EDL file if they need to. I've found two good reasons for manually editing an EDL file. First, is when looking to entirely "skip" a scene that's "objectionable". As you probably know, placing a "0" instead of a "1" will skip the scene. But obviously it doesn't make sense to automatically do this from a .srt subtitle, so you would need to add the time stamp manually. Second, sometimes "objectionable" content isn't "objectionable" when it's in a different context. For example the words Jesus, Christ, God, hell, balls, etc.. So that would be radical if this was changed to an easier-to-read time stamp. I'm not aware of any negatives to this approach (?)

2)
Something else to consider, Sensible Cinema's approach was a little more complicated (wasn't originally meant for XBMC) but in one of the steps in creating the .EDL it output this:

Quote: "0:01:01.04" , "0:01:02.56", "profanity", "b....", "Son of a [b....]!",
"0:06:10.16" , "0:06:12.40", "profanity", "h...", "To [h...] with him.",
"0:16:22.80" , "0:16:25.31", "profanity", "f...", "[f...]! PIease.",

It included some of the words before/after the profanity. This also helps with knowing the context of the profanity and then editing it.

3)
So far from my limited testing, the XBMC subtitles add-on has choosen the correct .srt file. But it would be nice to be able to manually choose it just like the regular way (I have no idea if this is possible). Like this: https://lh5.googleusercontent.com/agik3F...pcNd3X2aO0 . Also as a note, I've noticed when I've tried manually downloading a .srt file from opensubtitles (using my windows machine) I have to do a lot more trial an error with finding good matches but when I download them from within XBMC and especially when they say "sync" next to it (as shown in the above pic) they seem to be a lot more accurate. So manually making sure "Mute Profanity" chooses the sync .srt would be beneficial, I think.

4)
When navigating to the Movie Library (Mute Profanity>Edit Movies) it kinda has a strange order if you've added movies to your library. So it looks like this:
Movies A-Z - Previously added movies (before installing Mute Profanity)
Movies added after Mute Profanity was installed/used

I don't understand why my newly added movies are showing up at the bottom rather than their alphabetical location? Not a big deal, but something to look at.

5)
Also not really necessary, but it would be nice to edit the filter.txt file from within the GUI or in other words Mute Profanity>Add-on Settings. I'm not saying to remove the Block Severity settings, cause I think that's a good idea too. But being able to manually add/delete words (maybe even radio buttons) would be cool.

All-in-all, very cool! And thanks again! This add-on isn't for everyone, but for those of us with kids and are conservative with what they watch--this is awesome! Much better than anything I've found so far.

***Oh and I'm running it on Crystalbuntu on ATV1. And yes it worked well on my TV shows too!***
(This post was last modified: 2013-07-16 18:08 by dickalan.)
find quote
spiff Offline
Retired Developer
Posts: 12,384
Joined: Nov 2003
Post: #7
it's just words.
find quote
allstarfrank Offline
Junior Member
Posts: 1
Joined: Jul 2013
Reputation: 0
Post: #8
Does the filter work for anything accessed in xbmc or just TV and movies that are saved on a hard drive? If a DVD is played through xbmc, will it work? Does it work with live tv through xbmc? I have installed the filter. Is there anything else that I need to do to make it work?
find quote
dickalan Offline
Senior Member
Posts: 119
Joined: Jan 2009
Reputation: 0
Post: #9
I doubt it will work with anything "live" at the moment becuase XBMC reads the .edl file which isn't created "live". I have no idea if XBMC is even capable of that? If so, then that means the "blocking severity" settings could be modified on the fly as well... which would be cool. Fegunz... what say ye?
find quote
fegunz Offline
Junior Member
Posts: 27
Joined: Apr 2010
Reputation: 1
Post: #10
(2013-07-17 20:45)allstarfrank Wrote:  Does the filter work for anything accessed in xbmc or just TV and movies that are saved on a hard drive? If a DVD is played through xbmc, will it work? Does it work with live tv through xbmc? I have installed the filter. Is there anything else that I need to do to make it work?

The plugin only works for movies and TV show files setup in your library, nothing else for the moment. It might be possible to get something up for DVDs, I'll look into that for the next release. I need to check and see if XBMC can handle a EDL file for DVDs, and how that process works.

To make it work, you need to open up the plugin, then navigate to the TV show or movie (again, it needs to already be in your library). The plugin reads the file, analyzes it, and then you play the file normally.
find quote
fegunz Offline
Junior Member
Posts: 27
Joined: Apr 2010
Reputation: 1
Post: #11
dickalan, thanks for the input! I've added issues for each of the 5 issues into the github project page to keep track of them. Here I'll try to respond to each point separately.

1 -> Cleaner EDL output: This should be pretty easy, but I'm not sure if I should implement it. There is a concern that if we change the input format, other tools might not be able to read it (See the github issue for details). The plugin does support your own EDL additions (outside of the section automatically maintained by mute profanity). I'd like to discuss this one a little more.

2-> More context of words: This is a great idea. I should be able to do something like this fairly easily.

3-> Choose subtitle file, verify a 'sync' subtitle file: I couldn't view your pic, but the concept seems pretty cool. I need to look into how the subtitle downloader works, maybe I could piggy back of some of their logic. Then in the settings I could add a setting to choose between automatic and manual subtitle download. There's still a good amount of knowns for this one though, so I'm not sure if or when I can get around to it.

4-> Ordering of movies: I just noticed this one as well. I agree, I should order that better. I'll start off alphabetically, then maybe add the option of a sort by field (such as added date or MPAA rating)

5-> Edit the filter.txt from within plugin: I've wanted to add this one for a long time. I started with this, but the UI got too complicated for me. I'm not much of a UI guy, and would love some help with this one. It's still on my TODO list, so I'll get around to it eventually, but don't count on it anytime soon.

Thanks again for testing it and I hope others find this information useful as well. Enjoy!
find quote
dickalan Offline
Senior Member
Posts: 119
Joined: Jan 2009
Reputation: 0
Post: #12
Cool, thanks for addressing each item! By no means am I programmer, nor would I even know where to start. I wouldn't even say I'm an expert with XBMC either. I'm just an average end-user. However in the following I go into some detail, I'm not meaning to speak down to you in anyway (you obviously know a lot more about this than I do since you created it!) but I'm just trying to help others who are reading this and who may have stumbled across this cool feature of XBMC as well.

And sorry about the screen grab, it was nothing special, just showing the XBMC subtitle add-on. Like this:
http://forum.xbmc.org/showthread.php?tid=126495 (5th pic down in that thread)
This add-on can be activated from the Video Playback screen: http://wiki.xbmc.org/index.php?title=Add..._Subtitles

Anyway:

1) OK yes, before you replied I figured out that I can still add my own formatted skip (0) edits ( http://wiki.xbmc.org/index.php?title=Edi...Player_EDL ) below the ###### section. And I don't have to insert them chronologically between lines X and Z. And I don't have to follow the ".003409" formatting. At first I thought that solved everything, but if it weren't for the following:

I still run into issues when a mute (1) and a skip's (0) time stamp overlap each other. When this happens the skip doesn't register at all, as confirmed in the codec info overlay: ( http://wiki.xbmc.org/index.php?title=Codecinfo ). The overlay shows how many c (cuts) and m (mutes) there are under "edl". This is probably a limitation with XBMC's internal video player (that somehow incorporates/relies on MPlayer, right?) I wonder if this limitation could be re-coded/fixed/handled differently by the core XBMC developers? So when this happens I need to go back into the .edl file and find where the corresponding mute is, which is often at the confusing destination of .00968493729 ?!?! Smile. Then I delete it and substitute it with the skip. Of course I can just watch the movie and figure it out, but I just figured the "1:55:20.32" format would be easiest.

I read fauxpaux's comment about the output. I thought the formatting I mentioned was fairly common, since it was taken from Mplayer. But I guess not. Perhaps a solution could be to create different kinds of formatted .edl's. But perhaps that's getting a little too far out of the boundaries of what this add-on is supposed to do in the first place? Although... I dunno, this *is* an XBMC addon and not an audacity addon. Wink Is there not other options that can create an .edl for audacity?

2) Cool!

3) Yea I have no idea if the different subtitle addons allow integration with other addons? It would be cool for sure. Of course the simple solution is for people to just use XBMC's subtitle add-on FIRST, make sure everything is synced up, and then use your add-on. But I guess being all-in-one is more ideal and adds a "coolness" factor.

4) Yea at first I thought that the addon wasn't recognizing any of my recently added movies at all. I almost didn't catch them sitting there all the way at the bottom of the list. It's almost like it's not using the Library View?

5) Yea, so again I have no idea how to program. So I'm no help to you. Anybody out there?!?! This guy from the other thread said he was willing to help: http://forum.xbmc.org/showthread.php?tid...pid1232373

6) OK, now for a nit-picky thing that doesn't really matter... but:
When clicking through the following: Videos>Addons>Mute Profanity>Edit Movies/Edit TV Shows>*Name of Movie*
It pulls up a GUI that says "Play". Obviously hitting play activates it, but it would be less confusing if it said "Mute Profanity" right there.

7) Quick question, will XBMC use the .edl file when streaming over a network (smb, upnp, etc.)?

*EDIT* - I saw the github issue.

Unfortunately, I think the reason this feature hasn't made a lot of headway in the past is because people's personal opinions/views have overshadowed the function. And it's usually in a negative way. If I was a developer and created something and the only response I got back was; "why do you want to do that? that's dumb!". Then I would probably be discouraged from going too much further with it. For example, the banter usually goes something like this:

Quote:Why?
Quote:Because I don't want to see Bruce Willis' butt being scrubbed down in 12 Monkey's
But it doesn't end there, an opinion usually follows.
Quote:...and I don't think it adds anything to the film
Then somebody else interjects their opinion.
Quote:If you can't handle seeing Bruce Willis butt for 3 seconds then you shouldn't be watching 12 Monkey's.
And then it becomes this back and for thing about morals and blah, blah, blah. So there we go, I just provided the full play out of this conversation in advance for everyone. Now please, let's not have it twice and let's keep this thread/topic about the addon/function itself. We ALL can agree on an improved XBMC and this function does just that.
(This post was last modified: 2013-07-19 00:52 by dickalan.)
find quote
Robotica Offline
Banned
Posts: 1,484
Joined: Aug 2010
Post: #13
Quote:[/b][b]5-> Edit the filter.txt from within plugin: I've wanted to add this one for a long time. I started with this, but the UI got too complicated for me. I'm not much of a UI guy, and would love some help with this one. It's still on my TODO list, so I'll get around to it eventually, but don't count on it anytime soon.

Thanks again for testing it and I hope others find this information useful as well. Enjoy!

There is a file editor which may be easily resurrected: http://forum.xbmc.org/showthread.php?tid=52387
(This post was last modified: 2013-07-18 23:43 by Robotica.)
find quote
dickalan Offline
Senior Member
Posts: 119
Joined: Jan 2009
Reputation: 0
Post: #14
On the github it says there is an issue with "Problems with multiple processes". Is that referring to when I run the addon on my Windows machine and it says "Did not finish properly. Check the logs"? Where on my aTV (Crystalbuntu) it doesn't give me that error.
find quote
fegunz Offline
Junior Member
Posts: 27
Joined: Apr 2010
Reputation: 1
Post: #15
(2013-07-18 23:42)Robotica Wrote:  There is a file editor which may be easily resurrected: http://forum.xbmc.org/showthread.php?tid=52387

This looks awesome, I'll definitely take a look. Thanks!

(2013-07-19 01:01)dickalan Wrote:  On the github it says there is an issue with "Problems with multiple processes". Is that referring to when I run the addon on my Windows machine and it says "Did not finish properly. Check the logs"? Where on my aTV (Crystalbuntu) it doesn't give me that error.

No, that's a separate issue, and I'd love to be able to view your logs to see what went wrong.

The problem with multiple processes is an XBMC limitation that I've been constantly battling with. Basically XBMC has problems spawning processes (threads are OK) on various platforms. I have a work around right now by mocking processes using threads on OSX and other platforms. Actually now that I think of it, they might be related.
(This post was last modified: 2013-07-19 01:55 by fegunz.)
find quote
Post Reply