Note: This package is meant to be used as a global script to compress images and videos and change their extensions.
image-and-video-compressor
is a Node.js package that enables easy compression of images and videos within a specified folder. It utilizes the powerful sharp
library for image compression and fluent-ffmpeg
for video compression.
npm install -g image-and-video-compressor
imgvidcompress optimise:image --loadFolder='path_to_image_folder' --quality='compression_quality' --output='output_extension'
imgvidcompress optimise:image --loadFolder='/path/to/images' --quality=40 --output='.webp'
imgvidcompress optimise:video --loadFolder='path_to_video_folder' --quality='compression_quality' --output='output_extension'
imgvidcompress optimise:video --loadFolder='/path/to/videos' --quality=30 --output='.mp4'
-
path_to_image_folder
: Path to the folder containing images. -
path_to_video_folder
: Path to the folder containing videos. -
compression_quality
: Quality parameter for compression (between 10 and 100). -
output_extension
: Extension for the output file after compression.
You might need to reinstall ffmpeg on your system.
brew install ffmpeg
sudo apt install ffmpeg
Please follow the instructions at the official ffmpeg website for Windows: Install ffmpeg on Windows
This package wouldn't be possible without the following awesome libraries:
-
sharp
- High-performance Node.js image processing. -
fluent-ffmpeg
- A fluent API to FFMPEG.
This project is licensed under the MIT License - see the LICENSE file for details.
https://github.com/rohanpoudel2/image_video_compressor
https://www.npmjs.com/package/image-and-video-compressor
https://github.com/rohanpoudel2 https://www.rohanpoudel.com.np