Skip to main content

cleancredits

A very simple tool for removing on-screen text from video, using a user-provided mask.

Dependencies

cleancredits has the following system dependencies:

Installation

  1. Mac OS: Install homebrew and run brew install python-tk to install tkinter bindings.

  2. Install pipx, a package manager for python tools.

  3. Install the latest released version of cleancredits:

    pipx install cleancredits
    

    Or install the latest version from Github:

    pipx install git+https://github.com/BeatriceEagle/cleancredits@main
    

Usage

Generate HSV mask

cleancredits mask [OPTIONS] VIDEO

Generate a mask based on a video clip

Options:

  -s, --start TIMECODE     Start timecode (HH:MM:SS[:frame]) in the input
                           video
  -e, --end TIMECODE       End timecode (HH:MM:SS[:frame]) in the input video
  -i, --input FILE         Input mask. These pixels will always be present in
                           the output mask (unless explicitly excluded).
  -o, --output FILE        Output mask to this location  [required]
  --hue-min INTEGER RANGE  Minimum hue  [0<=x<=179]
  --hue-max INTEGER RANGE  Maximum hue  [0<=x<=179]
  --sat-min INTEGER RANGE  Minimum saturation  [0<=x<=255]
  --sat-max INTEGER RANGE  Maximum saturation  [0<=x<=255]
  --val-min INTEGER RANGE  Minimum value  [0<=x<=255]
  --val-max INTEGER RANGE  Maximum value  [0<=x<=255]
  --grow INTEGER RANGE     Grow amount  [0<=x<=20]
  --bbox-x1 INTEGER RANGE  Bounding box left x  [x>=0]
  --bbox-x2 INTEGER RANGE  Bounding box right x  [x>=0]
  --bbox-y1 INTEGER RANGE  Bounding box top y  [x>=0]
  --bbox-y2 INTEGER RANGE  Bounding box bottom y  [x>=0]
  --gui / --no-gui         Set --no-gui to directly render the mask without
                           displaying the GUI
  --help                   Show this message and exit.

This command will display a graphical interface for modifying a mask that allows isolating part of an image based on hue / saturation / value, as well as a bounding box. You can also manually add or exclude parts of an image.

You can layer combine masks for multiple colors or areas of credits by outputting a mask, then passing that as an --input to the mask command.

Clean credits

cleancredits clean [OPTIONS] VIDEO MASK

Arguments:

  • VIDEO: Path to the video file being cleaned
  • MASK: Path to the mask file. This should be a black and white png, where white indicates areas that will be removed and interpolated.

Options:

  • --start/--end: The start/end timecodes (HH:MM:SS[:frame]) to process from the input video. Default: Start and end of the input video.

  • --radius: The number of pixels the inpaint algorithm uses for interpolation. The default is 3, and this generally gives good results, but if you want to experiment, go wild.

  • --framerate: The framerate (fps) of the video being cleaned. The default is the input framerate.

  • --output PATH: If this flag is selected, the cleaned frames will be remuxed into video and output at the specified PATH. You can omit this option if you want to do your own muxing. cleancredits muxes video using ffmpeg's libx264 codec and yuv420p colorspace, which in testing were found to give the best quality video while also still being recognizable by most editors and players. Outputting as a .mp4 file is recommended.

Example:

# Takes a video.mkv and mask.png from the current directory and outputs
# output.mp4 to the current directory.
cleancredits clean video.mkv mask.png -o output.mp4

Output:

A folder containing all the cleaned frames of the video, and the cleaned video.

Metadata

Release files for cleancredits 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cleancredits 2.0.0
File Size Uploaded
cleancredits-2.0.0.tar.gz 27.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cleancredits 2.0.0
File Interpreter ABI Platform
cleancredits-2.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 54.3 kB

Release files / cleancredits-2.0.0.tar.gz

Download URL cleancredits-2.0.0.tar.gz
Size 27.3 kB
Tags Source
SHA-256 checksum
How to use checksums
e45177b4e74e5a6dca646988570b9632aaf9df0a2135929b50a4e095d440cb6d
BLAKE2b-256 checksum
How to use checksums
6615c0eba68cc5e82e84bad99faf4fe389d8a8fcd9b9e700fab22c944e3fa6ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.11

Release files / cleancredits-2.0.0-py3-none-any.whl

Download URL cleancredits-2.0.0-py3-none-any.whl
Size 26.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d84551958efcd6fb44fdf496d57d0021a790a0443665296244b933830d278a82
BLAKE2b-256 checksum
How to use checksums
e072d2a10bed2f4c3dd5fa49538595391373455d450bdf4a5d1ab325033b3af6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.11

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files

0.1.3

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page