Skip to content

takes mp4 file and desired output size as arguments to compress mp4 file to desired size using ffmpeg

Notifications You must be signed in to change notification settings

aetherbird/auto_compressor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 

Repository files navigation

auto_compressor.go

A command-line tool for Linux, designed to compress MP4 video files to a desired output size using FFmpeg. Calculates the appropriate video bitrate based on the duration of the video and compresses it to the target size while maintaining audio quality.

Dependencies

go and ffmpeg

Installation

If you are on a Debian or Ubuntu-based distro, you can use the following one-liner to install dependencies and clone the script:

curl -s https://raw.githubusercontent.com/aetherbird/auto_compressor/main/auto_compressor_installer.sh | bash

How to Use

Once you've installed go and cloned the auto_compressor program, you can use the following command to compress your videos:

go run auto_compressor.go <input_file.mp4> <desired_output_size_MB>

For example, to compress a video to 50 MB:

go run auto_compressor.go ~/Videos/my_video.mp4 50

Compile

Compile to binary:

go build auto_compressor.go

Add to your local or system $PATH:

Local (example):

cp -av auto_compressor ~/.local/bin/

System (example):

cp -av auto_compressor /usr/local/bin/

You are now ready to invoke:

auto_compressor <input_file.mp4> <desired_output_size_MB>

About

takes mp4 file and desired output size as arguments to compress mp4 file to desired size using ffmpeg

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published