Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Diet-Video

License: GPL v3 Last commit GitHub commit activity Github Stars Github Forks Github Watchers GitHub contributors

This is a fork of the original video-diet that is no longer being updated.

This project aims to reduce the spaces of your videos and audios encoding it on hevc.

Why video-diet?

The answer is easy. I have a lot old-movies/videos and music/audios taking a lot of space in the hard-drive. So I'm always short on disk space, the by accident discover de hevc codec. when i need to shrink a video of 3GB to upload it to Telegram, the convertion take my 3GB movie and returned a 300 MB with the same quality 😱. So I decided that I would convert all my video and audio files , but they are a lot, so I build this tool for it.

More info about hevc:

https://en.wikipedia.org/wiki/High_Efficiency_Video_Coding

Installation

$ uv tool install .

This installs the diet-video command. To run it from a checkout without installing it globally, use uv run diet-video.

FFMPEG

In order to run the project you must install ffmpeg.

For Linux

In any linux machine you can get it from your favorite package manager.

For arch:

sudo pacman -S ffmpeg

For Debian/Ubuntu:

sudo apt-get install ffmpeg

For Windows

Download a windows ffmpeg build here https://ffmpeg.org/download.html. Unzip it and change the folder name to FFmpeg. Copy the folder into C:\ and then add the path C:\FFmpeg\bin to the enviroment variables of the system.

To check correct instalation open a new instance of cmd and type:

ffmpeg --version`.

Example

For a file

diet-video file test.mp4

This option conserve the original file

For a folder

diet-video folder ~/Videos

This option replaces the original file for the converted files

Ignoring files on the folder

diet-video folder ~/Videos --ignore-extension .mp4

This option ignores all the .mp4 files on ~/Videos

diet-video folder ~/Videos --ignore-path ~/Videos/subfolder

This option ignores all the files on ~/Videos/subfolder

AV1 Support

To use AV1 instead of hevc add --codec av1 to the commnads above and that will use libaom-av1 instad of libx265 to encode the files

Note

The video conversion can take some time. Depending on the original video properties; the conversion time can be longer than the video.

For developers

Requirements

Install uv, then run:

$ uv sync

The project requires Python 3.13 or newer. uv will download a compatible Python version automatically when one is not already available.

Run the command with uv run diet-video and the test suite with uv run pytest.

See CONTRIBUTING.md for more details.

Good luck 😉.

Project Structure based on awesome tutorial by @tiangolo at https://typer.tiangolo.com/tutorial/package

Metadata

Release files for diet-video 0.1.15rc0

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

Source distribution (sdist)

Source distribution for diet-video 0.1.15rc0
File Size Uploaded
diet_video-0.1.15rc0.tar.gz 6.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for diet-video 0.1.15rc0
File Interpreter ABI Platform
diet_video-0.1.15rc0-py3-none-any.whl Python 3 none any Details

Total release size: 14.8 kB

Release files / diet_video-0.1.15rc0.tar.gz

Download URL diet_video-0.1.15rc0.tar.gz
Size 6.5 kB
Tags Source
SHA-256 checksum
How to use checksums
8d5478a9ac9c239f9fc0550f5e95e75f56a5b22ab995e9200ab047be3580222e
BLAKE2b-256 checksum
How to use checksums
0cb0d6cd315a6ab6e95e8e433f16c64dae7bc56ba1e440657771f46902c1fb57
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.6 {"installer":{"name":"uv","version":"0.10.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / diet_video-0.1.15rc0-py3-none-any.whl

Download URL diet_video-0.1.15rc0-py3-none-any.whl
Size 8.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6bf53a861e42e3bd7854e05356bed479a887ea06920416b254a66feb951f2651
BLAKE2b-256 checksum
How to use checksums
6e2e05dc7465a24a8699c310d3ca696dee8034ed54484e438efcade8222c5e44
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.6 {"installer":{"name":"uv","version":"0.10.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
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