This release is a pre-release and may not be stable for production use.
Diet-Video
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
Converted files are marked with the Processed with diet-video metadata
comment. Future folder runs detect that marker and skip those files, so they
are not converted again.
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
To deliberately process an already marked file with the file command, pass
--force.
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.16rc0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| diet_video-0.1.16rc0.tar.gz | 7.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| diet_video-0.1.16rc0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.3 kB
Release files / diet_video-0.1.16rc0.tar.gz
| Download URL | diet_video-0.1.16rc0.tar.gz |
|---|---|
| Size | 7.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
001eb079432d643e90f6b0f297ab61d76ea54c236a86790c59efdb5b52184029
|
|
BLAKE2b-256 checksum How to use checksums |
4dc07fc29b8134b22a64658fbbcde38b8df1d6bd70010e675008bad303d685ae
|
| 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.16rc0-py3-none-any.whl
| Download URL | diet_video-0.1.16rc0-py3-none-any.whl |
|---|---|
| Size | 9.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b9f6a9d8359408fff7bef0611bd577cc4faf09eb0db0178a303c14ec763655dd
|
|
BLAKE2b-256 checksum How to use checksums |
46e0b7ea30465b6dea3b4ad4a21e80a282209b00dec750f548501a04488e3146
|
| 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}
|