Skip to main content

No project description provided

Project description

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

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

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

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

diet_video-0.1.14rc0.tar.gz (21.4 kB view details)

Uploaded Source

Built Distribution

diet_video-0.1.14rc0-py3-none-any.whl (20.6 kB view details)

Uploaded Python 3

File details

Details for the file diet_video-0.1.14rc0.tar.gz.

File metadata

  • Download URL: diet_video-0.1.14rc0.tar.gz
  • Upload date:
  • Size: 21.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.9.7 Linux/5.16.5-arch1-1

File hashes

Hashes for diet_video-0.1.14rc0.tar.gz
Algorithm Hash digest
SHA256 97f33e4e22f48fc2e9801c248fe88c0e109e0fcdfd53374dcbf0dea130db8fed
MD5 34cd64e8cdf5e8a989a5621f92fbd5b1
BLAKE2b-256 53d046125c8a5fb17e5aaa4a865a6d98002a834c6d1ba7b3ca95913ac0d1b66b

See more details on using hashes here.

File details

Details for the file diet_video-0.1.14rc0-py3-none-any.whl.

File metadata

  • Download URL: diet_video-0.1.14rc0-py3-none-any.whl
  • Upload date:
  • Size: 20.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.9.7 Linux/5.16.5-arch1-1

File hashes

Hashes for diet_video-0.1.14rc0-py3-none-any.whl
Algorithm Hash digest
SHA256 4ad45e06e7215d785beb51d0c342346c8b57cfaf8df44886d49860617ddb1048
MD5 11be2fec6cb6f8959244d369664a63e8
BLAKE2b-256 56c78a1e119b6954fe0a4d56e2ddba472f5c810ec3611c925cb030ecbcbadf7a

See more details on using hashes here.

Supported by

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