VLC add-on for real-time media censorship according to user personal settings, using CNSR file format.
This add-on censors categories like nudity, verbal abuse, violence and alchohol and drug consumption. The add-on is also available here.
This add-on is inspired by MEDERI's "Time v3.2" vlc extension.
Supported OS: Windows, Linux and Mac OS.
-
If you don't have VLC installed on your computer, install it now from VLC
-
download the repository: press on the "CODE" green button, and choose the option: "Download zip".
-
Using the installation file (currently only available for Mac OS):
- Open your terminal, cd into CNSR repo and run
python3 scripts/install.py
, you'll need to enter your administer's password - A link between the project's files and VLC repository is generated. For example, a file named
cnsr_intf.lua
that points tocnsr-vlc-viewer-addon/intf/cnsr_intf.lua
will be created in/Applications/VLC.app/Contents/MacOS/share/lua/intf
. Every change that will be made incnsr-vlc-viewer-addon
will be also made to the installed extension. - You can now jump to instruction #6, and also skip the entire "Setting up the project for development" section.
- Open your terminal, cd into CNSR repo and run
-
If you want the add-on to be available for all the users of the computer, access the
lua
folder using these paths:- Windows-
%ProgramFiles%\VideoLAN\VLC\lua
or%ProgramFiles (x86)%\VideoLAN\VLC\lua
- Linux-
/usr/lib/vlc/lua
or use the commandfind /usr/lib -iname VLSub.luac
to find the directory - MacOS-
/Applications/VLC.app/Contents/MacOS/share/lua
If you want the add-on to be available only for a specific user, access thelua
folder using these paths: - Windows-
%APPDATA%\VLC\lua
- Linux-
~/.local/share/vlc/lua
- MacOS-
/Users/%your_name%/Library/Application Support/org.videolan.vlc/lua
If the paths above don't exist and you already have VLC installed on your computer try to uninstall it and then reinstall it. Then, make sure you are using the most updated version of VLC.
- Windows-
-
Extract the contents of the
cnsr-vlc-viewer-addon-main
directory within the downloaded zip file into thelua
folder. -
Start the Extension in VLC menu
View > cnsr
for Windows/Linux.VLC > Extensions > cnsr
for Mac OS.
-
Choose your password and your password's hint, please choose a password you will remember and your child will not know. Click save to set the cnsr interface script as an extra interface.
-
Restart VLC
-
Start the Extension again in VLC menu
View > cnsr
for Windows/Linux.VLC > Extensions > cnsr
for Mac OS.
-
Configure the cnsr categories to your liking.
CNSR files are not created automatically, they must be downloaded or created manually
(in the future a tagging tool will be available)
by watching the video and writing tags with time-stamps.
Possible tags:
- for violence
- for verbal abuse
- for nudity
- for alcohol and drug use
You can see an example of a cnsr file here
- Explanation of the timestamps displayed: hours:minutes:seconds,millis
In order to make use of cnsr file you need to create a new file with the format as shown in example/example_file.cnsr
.
The file name must be identical to the video name you want to play (except for the file type), and must be at the same directory as the video.
For example, if the video you want to play is:
/foo/bar/myvid.mp4
Then the cnsr file should be:
/foo/bar/myvid.cnsr
- Currently there is an issue with directories that have hebrew in their path, so try to avoid them
To work conveniently with git, we recommend cloning the project in your exsisting lua folder.
Since git doesn't allow to clone a project into an existing folder, we reccomend following these steps:
-
If you don't have VLC installed on your computer, install from VLC
-
If you don't have Git installed on your computer, install from Git
-
Open a terminal\CLI with admin privileges:
- Windows-
WinKey + x > a
and approve UAC. - Linux-
ctrl + alt + t
, typesudo -i
and enter password if necessary. - macOS-
cmd + space >
, typeterminal
typesudo -i
and enter password if necessary.
- Windows-
-
Type
cd "<lua path>"
(findlua path
according to section 3 of "Installing the add-on for regular use"). -
type
git init
-
type
git remote add origin https://github.com/ophirhan/cnsr-vlc-viewer-addon.git
-
type
git fetch origin
-
type
git checkout -b main --track origin/main
And that's it! the add-on is installed, and you are ready to start developing.
- To interact with VLC we use the API documented here.
- For more support you can search this dedicated forum for scripting VLC with lua and specificaly visit this getting started thread.
- When debbuging in order to see the log messages you need to open the VLC messages panel via:
ctrl + m
orcommand + m
- Using a debugger is reported possible and explained here but we haven't tried it.
- Since the lua folder is part of the vlc installation directory and writing to it might be proteced,
in order to save your changes you might need to open your IDE as an administartor.
If you're just getting started with lua, here are some important things that set it apart from other programming languages:
- tables are equivalent to hashsets and arrays simultaneously, their index starts from 1 (not 0).
- lua is an interperted language no need to build anything!
- As for a prefered IDE we use intellij IDEA with emmyLUA plugin, but eclipse should work as well (maybe better).
For more on lua this tutorial will help you get up and running in little to no time.
If you are not an approved collaborator, changing and pushing to the main branch is not possible, in order to contribute to our code you'll need to:
- Fork this repo.
- Work on a new local branch.
- Push the changes from the local branch to github.
- Create a new pull request (to merge the changes from you branch to our main branch), and wait for it's approval.