You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

image-and-video-compressor

Package Overview
Dependencies
Maintainers
0
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

image-and-video-compressor

Compress Image and Video using Node.js

1.0.8
latest
Source
npmnpm
Version published
Weekly downloads
1
Maintainers
0
Weekly downloads
 
Created
Source

image-and-video-compressor

Compress Image and Video using Node.js

Note: This package is meant to be used as a global script to compress images and videos and change their extensions.

Overview

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.

Installation

npm install -g image-and-video-compressor

Usage

Image Compression

imgvidcompress optimise:image --loadFolder='path_to_image_folder' --quality='compression_quality' --output='output_extension'

Example

imgvidcompress optimise:image --loadFolder='/path/to/images' --quality=40 --output='.webp'

Video Compression

imgvidcompress optimise:video --loadFolder='path_to_video_folder' --quality='compression_quality' --output='output_extension'

Example

imgvidcompress optimise:video --loadFolder='/path/to/videos' --quality=30 --output='.mp4'

Options

  • 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.

Possible Error (With Video Compression)

You might need to reinstall ffmpeg on your system.

MacOS

brew install ffmpeg

Ubuntu (Linux)

sudo apt install ffmpeg
Please utilize the dedicated package manager corresponding to your Linux distribution

Windows

Please follow the instructions at the official ffmpeg website for Windows: Install ffmpeg on Windows

Credits

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.

License

This project is licensed under the MIT License - see the LICENSE file for details.

GitHub Repo URL

https://github.com/rohanpoudel2/image_video_compressor

NPMJS URL

https://www.npmjs.com/package/image-and-video-compressor

Created by

https://github.com/rohanpoudel2 https://www.rohanpoudel.com.np

Keywords

image

FAQs

Package last updated on 23 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts