This is a script to automatically calculate the required bitrate and call ffmpeg in order to keep the file size at or below the requirement file size. Very useful in order to compress a video so that it fits in Discord's upload file rescrictions.
- Install
gitif not installed - Open
Powershellorcmd - Clone the repo by running
git clone https://github.com/Rocket009/Video-Compressor-Script.git - Run
cd Video-Compressor-Script - Execute the ffmpeg installer by running
.\install_ffmpeg.bat - After its complete restart your terminal
This command is added to your User PATH Environment Variable so you can run it at any directory
- Open the directory that the video is in
Powershellorcdto it. Note: you must execute it in powershell - Run
vidcmp filenameThis will compress and override the video file and compress it to 20 MiB
The script contains additional arguments to be passed in order to do different things
Filenameis the default argument that must be passed containing the filename of the file to compress.Filesizeis the size of the output file in MiB. It has a default value of 20 MiBOutputis the name of the output file. Its default value is equal toFilename.
vidcmp filenameCompresses and overwrites file with a file size of 20 MiBvidcmp -Filename filename.mp4 -Filesize 10 -Output compressed.mp4Compresses the file to 10 MiB and saves it as compressed.mp4