VideoSqueeze is a CLI tool that compresses your videos
VideoSqueeze CLI is a simple JavaScript project that compresses a given video by its path. It uses FFmpeg under the hood. It's able to compress a single video, or a directory with multiple videos at once. Key features include:
- Compress a single video quickly
- Compress a bunch of videos with a few clicks
- Resume from where you stopped compressing
- Customizable compression profiles and presets
- CPU limiter for controlling resource usage
- View total compressed videos and saved space
- Configuration file for easy customization
To install VideoSqueezer CLI, you have two options:
- Download the Windows release.
- Extract the downloaded archive.
- Open the extracted folder and locate the
VideoSqueezeCLI.exe
file. - Double-click on
VideoSqueezeCLI.exe
to launch the CLI tool.
(Note: Option 2 requires Node.js to be installed on your machine. Make sure you have Node.js installed)
- Clone this project to your local machine.
- Open a terminal and navigate to the project directory.
- Install the required dependencies by running the following command:
npm install
- Run VideoSqueezer CLI by executing the following command:
npm start
These commands will install the necessary dependencies and start VideoSqueezer CLI.
VideoSqueeze is a user-friendly CLI tool that is easy to use and navigate. Click here to get a quick guide.
You will find ./config.json
file that contains the possible configuration and customization for the program. Here's a brief explanation for each option and possible values:
{
"PathToFfmpegForExe": "./ffmpeg/bin/ffmpeg.exe",
"PathToFfprobeForExe": "./ffmpeg/bin/ffprobe.exe",
"compressionPath": "./compressed_videos",
"numberOfThreads": 0,
"ffmpegCodec": "libx264",
"compressAudioToo": false,
"compressionPreset": "faster",
"compressionHistory": "./compression_log.json"
}
"PathToFfmpegForExe"
and"PathToFfprobeForExe"
(For Windows release only):
These are the paths for your ffmpeg.exe
and ffprobe.exe
. These are only relevant for the windows release. The default behavior for the program to assume that they are located in the same folder where the program is running. The windows release is bundled with the necessary FFmpeg and ffprobe to be able to run the program. However, you may alter the values to you ffmpeg and ffprobe paths and delete the bundled FFmpeg to save space.
If you're running the program via NodeJS, the npm libraries "@ffmpeg-installer/ffmpeg"
and "@ffprobe-installer/ffprobe"
will automatically install the appropriate FFmpegs for your system, whether was it Windows or Linux/Unix.
"compressionPath"
:
This is the path where your compressed videos will be saved. By default, the program will store them in a folder named ./compressed-videos
in wherever the program is running from. You may alter the value to your second drive for better space and disk management.
"numberOfThreads"
:
This is the number of threads used for video compression. By default, the value is set to 0
, which means that all available threads will be utilized. You may alter the value to a specified number of threads for better resource management.
"ffmpegCodec"
:
This is the codec used to compress your videos. The default value is "libx264"
which is widely-used H.264 video codec. It's excellent balance between video quality and file size. Possible codecs are:
"libx265"
: This codec is based on the HEVC. Offers improved compression efficiency compared to libx264 But it may not be as widely supported as libx264 on older or less capable devices
"compressAudioToo"
:
This is a toggle for compressing the audio stream of the video. By default it's set to false
which means that the audio will be copied as-is to the compressed video without any compression applied. You may set it to true
to compress the audio too for smaller file size
"compressionPreset"
:
This is the preset for you video compression. A preset is a trade-off between encoding speed and compression ratio. By default it's set to faster
. Which provide a quick compression time and reasonably reduced file size. Possible presets are:
"ultrafast"
"veryfast"
"faster"
"fast"
"medium"
"slow"
"slower"
"veryslow"
"placebo"
"compressionHistory"
:
This is where all compressed video details are going to be stored for logging purposes. By default, the program will read and store them in a file named compressionHistory.json
, wherever the program is running from.
If you encountered any issues using VideoSqueeze-CLI, please create an issue in Github using the following link. Your report will improve and enhance VideoSqueeze-CLI!
If you find VideoSqueeze-CLI useful and would like to share your experience with the community, please share it using the following link. Please include a screenshot or a copy of your terminal after printing the [3]: View compression history
option. Feel free to write anything you like in your discussion message.
It depends on your specific needs and preferences. Here's a brief description:
- High Quality (-crf 18): Prioritizes video quality while still applying compression.
- Balanced (-crf 23): Achieves a balance between compression level and video quality.
- Small Size (-crf 28): Prioritizes smaller file sizes while sacrificing some video quality.
The other profiles are self-descriptive and optimized for specific scenarios.
- Locate the video file you want to copy the path of.
- Press the Shift key and right-click on the video file.
- From the context menu that appears, select "Copy as path".
- In the terminal window, click left-click to paste the path into the terminal.
If you encountered any issues using VideoSqueeze-CLI, please create an issue in Github using the following link. Your report will improve and enhance VideoSqueeze-CLI!
Alternatively, you can try the following troubleshooting steps:
- Try restarting the app.
- Try deleting the config file. It's located in
./config.json
. Then restart the app. - Try deleting the compression history file. It's usally located in
./compression_log.json
. Then restart the app. - Try deleteing compressed videos directory. It's usally located in
./compressed_videos
. Then restart the app. - Try pulling/downloading the new project files from the repository.
- Start fresh. Download/clone the project from the start.
.