Skip to main content

Video diet

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

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

$ pip install video-diet

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

video-diet file test.mp4

This option conserve the original file

For a folder

video-diet folder ~/Videos

This option replaces the original file for the converted files

Ignoring files on the folder

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

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

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

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

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

You must first install poetry

Poetry provides a custom installer that will install poetry isolated from the rest of your system by vendorizing its dependencies. This is the recommended way of installing poetry.

osx / linux / bashonwindows install instructions

curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python

windows powershell install instructions

(Invoke-WebRequest -Uri https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py -UseBasicParsing).Content | python

The installer installs the poetry tool to Poetry's bin directory. On Unix it is located at $HOME/.poetry/bin and on Windows at %USERPROFILE%\.poetry\bin.

This directory will be in your $PATH environment variable, which means you can run them from the shell without further configuration.

Then you need to configure the environment

Inside the project make poetry install and after poetry shell for start the virtualenv.

For testing the code run video-diet.

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 video-diet 0.1.10

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

Source distribution (sdist)

Source distribution for video-diet 0.1.10
File Size Uploaded Provenance Actions
video-diet-0.1.10.tar.gz 19.5 kB Without provenance Details for video-diet-0.1.10.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for video-diet 0.1.10
File Interpreter ABI Platform Actions
video_diet-0.1.10-py3-none-any.whl Python 3 none any Details for video_diet-0.1.10-py3-none-any.whl

Total release size: 39.6 kB

Release files / video-diet-0.1.10.tar.gz

Download URL video-diet-0.1.10.tar.gz
Size 19.5 kB
Tags Source
SHA-256 checksum
How to use checksums
01095169724e09ee890cd3a4dbdebc1d295fd50abc3b3e57d3812897a410bbd7
BLAKE2b-256 checksum
How to use checksums
e8bb89f3b55a93f5ed854e60614a0a0564890c4daf0017e7a13f096e77ad5bf6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.5 CPython/3.8.5 Linux/5.8.8-arch1-1

Release files / video_diet-0.1.10-py3-none-any.whl

Download URL video_diet-0.1.10-py3-none-any.whl
Size 20.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
09d1c40301725a5d0cd63a38886deb339b3cfb7c712b9ee0942bb3b106d39318
BLAKE2b-256 checksum
How to use checksums
61c9f1dff0f93b6f17a05038589120201819973d33169ad7d67184beb15845f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.5 CPython/3.8.5 Linux/5.8.8-arch1-1

Security for video-diet 0.1.10

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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