Package: cleanvid
cleanvidcleanvidis a little script to mute profanity in video files in a few simple steps:The user provides as input a video file and matching.srtsubtitle file. If subtitles are not provided explicitly, they will be extracted from the video file if possible; if not,subliminalis used to attempt to download the best matching.srtfile.pysrtis used to parse the.srtfile, and each entry is checked against alistof profanity or other words or phrases you'd like muted. Mappings can be provided (eg., map "sh*t" to "poop"), otherwise the word will be replaced with *****.A new "clean".srtfile is created. withonlythose phrases containing the censored/replaced objectional language.ffmpegis used to create a cleaned video file. This file contains the original video stream, but the audio stream is muted during the segments containing objectional language. The audio stream is re-encoded as AAC and remultiplexed back together with the video. Optionally, the clean.srtfile can be embedded in the cleaned video file as a subtitle track.You can then use your favorite media player to play the cleaned video file together with the cleaned subtitles.As an alternative to creating a new video file, cleanvid can create a simple EDL file (see themplayeror KODIdocumentation) or a custom JSON definition file forPlexAutoSkip.cleanvidis part of a family of projects with similar goals:📼cleanvidfor video files🎤monkeyplugfor audio files📕montagfor ebooksInstallationUsingpip, to install the latestrelease from PyPI:python3 -m pip install -U cleanvidOr to install directly from GitHub:python3 -m pip install -U 'git+https://github.com/mmguero/cleanvid'Prerequisitescleanvidrequires:Python 3FFmpegbabelfishdelegator.pypysrtsubliminalTo install FFmpeg, use your operating system's package manager or install binaries fromffmpeg.org. The Python dependencies will be installed automatically if you are usingpipto install cleanvid.usageusage: cleanvid.py [-h] [-s <srt>] -i <input video> [-o <output video>] 
                   [--plex-auto-skip-json <output JSON>] [--plex-auto-skip-id <content identifier>]
                   [--subs-output <output srt>] [-w <profanity file>] [-l <language>] [-p <int>] [-e] [-f] [--subs-only] [--offline] [--edl] [-r] [-b]
                   [-v VPARAMS] [-a APARAMS]

options:
  -h, --help            show this help message and exit
  -s <srt>, --subs <srt>
                        .srt subtitle file (will attempt auto-download if unspecified and not --offline)
  -i <input video>, --input <input video>
                        input video file
  -o <output video>, --output <output video>
                        output video file
  --plex-auto-skip-json <output JSON>
                        custom JSON file for PlexAutoSkip (also implies --subs-only)
  --plex-auto-skip-id <content identifier>
                        content identifier for PlexAutoSkip (also implies --subs-only)
  --subs-output <output srt>
                        output subtitle file
  -w <profanity file>, --swears <profanity file>
                        text file containing profanity (with optional mapping)
  -l <language>, --lang <language>
                        language for srt download (default is "eng")
  -p <int>, --pad <int>
                        pad (seconds) around profanity
  -e, --embed-subs      embed subtitles in resulting video file
  -f, --full-subs       include all subtitles in output subtitle file (not just scrubbed)
  --subs-only           only operate on subtitles (do not alter audio)
  --offline             don't attempt to download subtitles
  --edl                 generate MPlayer EDL file with mute actions (also implies --subs-only)
  -r, --re-encode       Re-encode video
  -b, --burn            Hard-coded subtitles (implies re-encode)
  -v VPARAMS, --video-params VPARAMS
                        Video parameters for ffmpeg (only if re-encoding)
  -a APARAMS, --audio-params APARAMS
                        Audio parameters for ffmpegDockerAlternately, aDockerfileis provided to allow you to run cleanvid in Docker. You can build theoci.guero.top/cleanvid:latestDocker image withbuild_docker.sh, then runcleanvid-docker.shinside the directory where your video/subtitle files are located.ContributingIf you'd like to help improve cleanvid, pull requests will be welcomed!AuthorsSeth Grover-Initial work-mmgueroLicenseThis project is licensed under the BSD 3-Clause License - see theLICENSEfile for details.AcknowledgmentsThanks to:the developers ofFFmpegMattias Wadmanfor hisffmpegimagedelegator.pydeveloper Kenneth Reitz and contributorspysrtdeveloper Jean Boussier and contributorssubliminaldeveloper Antoine Bertin and contributors