Skip to main content

Tools to transcode, inspect and convert videos.

Project description

Vid Cleaner

Changelog PyPI version PyPI - Python Version Tests codecov

Tools to transcode, inspect and convert videos. This package provides convenience wrappers around ffmpeg and ffprobe to make it easier to work with video files. The functionality is highly customized to my personal workflows and needs. I am sharing it in case it is useful to others.

Features

  • Remove commentary tracks and subtitles
  • Remove unwanted audio and subtitle tracks
  • Integrate with TMDb and Radarr/Sonarr to determine languages of videos
  • Convert to H.265 or VP9
  • Convert 4k to 1080p
  • Downmix from surround to create missing stereo streams with custom filters to improve quality
  • Remove unwanted audio and subtitle tracks, optionally keeping the original language audio track
  • Create clips from a video file
  • Search for video files under a directory that match specific criteria

Install

Before installing vid-cleaner, the following dependencies must be installed:

To install vid-cleaner, run:

# With uv
uv tool install vid-cleaner

# With pip
python -m pip install --user vid-cleaner

Usage

Run vidcleaner --help to see the available commands and options.

Configuration

Defaults for vid-cleaner are set in the configuration file located at ~/.config/vid-cleaner/config.toml. When vid-cleaner is run, it will create this file if it does not exist. All options can be overridden on the command line.

If you've updated your user config file, the flags for the cli will work in reverse order. For example, if you've set downmix_stereo = true in your user config file, the flag --downmix will actually disable downmixing.

Important: Vid-cleaner makes decisions about which audio and subtitle tracks to keep based on the original language of the video. This is determined by querying the TMDb, Radarr, andSonarr APIs. To use this functionality, you must add the appropriate API keys to the configuration file.

# Languages to keep (list of ISO 639-1 codes)
langs_to_keep = ["en"]

# Keep subtitles matching the local language(s) even when the audio is not in the local language(s)
keep_local_subtitles = false

# Keep commentary audio
keep_commentary = false

# Force dropping local subtitles even if audio is not default language
drop_local_subs = false

# Keep all subtitles
keep_all_subtitles = false

# Drop original language audio if not specified in langs_to_keep
drop_original_audio = false

# Always create a stereo track
downmix_stereo = false

# Save the video after each step (default is to save after all steps are completed)
save_each_step = false

# External services used to determine the original language of a movie or TV show
radarr_api_key = ""
radarr_url     = ""
sonarr_api_key = ""
sonarr_url     = ""
tmdb_api_key   = ""

File Locations

Vid-cleaner uses the XDG specification for determining the locations of configuration files, logs, and caches.

  • Configuration file: ~/.config/vid-cleaner/config.toml
  • Cache: ~/.cache/vid-cleaner

Contributing

See CONTRIBUTING.md for more information.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vid_cleaner-0.7.4.tar.gz (129.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vid_cleaner-0.7.4-py3-none-any.whl (54.9 kB view details)

Uploaded Python 3

File details

Details for the file vid_cleaner-0.7.4.tar.gz.

File metadata

  • Download URL: vid_cleaner-0.7.4.tar.gz
  • Upload date:
  • Size: 129.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for vid_cleaner-0.7.4.tar.gz
Algorithm Hash digest
SHA256 654463f853f66976d5db0c185966440f03f7d8be4886dcc212a2a4629dfae3ed
MD5 356cbc0f6e83b6d064db27ba088adfd2
BLAKE2b-256 6a670a8fd15fed6b114cb962486335832e959d162e08d2b84f002baf4c1c656b

See more details on using hashes here.

File details

Details for the file vid_cleaner-0.7.4-py3-none-any.whl.

File metadata

  • Download URL: vid_cleaner-0.7.4-py3-none-any.whl
  • Upload date:
  • Size: 54.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for vid_cleaner-0.7.4-py3-none-any.whl
Algorithm Hash digest
SHA256 9d439e58fba0ee4d67ecc6a17efd6eaf664684a42eeeea4feb00c72db3a7656a
MD5 dd3556e3e9030a8635a31a689ac843f0
BLAKE2b-256 2847628e7c5fa8d926c1101137e1f2bae8be8a2994aeebbbcca0bc8b9ab38d91

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page