New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

compress-videos

Package Overview
Dependencies
Maintainers
0
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

compress-videos

A package for compressing video files

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

Video Compressor

A package for compressing videos that uses ffmpeg and the libx264 compression algorithm. It reduces the size of videos by up to 40% while maintaining lossless quality.

Designer(2)(1)

Installation

  1. Install the compress-videos package
npm install compress-videos
  1. Install FFmpeg, This package requires FFmpeg to be installed on your system. Follow the instructions below based on your operating system:
For Windows:
  1. Download FFmpeg from the official website: FFmpeg Download
  2. Choose the Windows version and download the zip file.
  3. Extract the zip file to this directory (C:\ffmpeg).
For Linux:

On Ubuntu/Debian-based systems, install FFmpeg via APT:

sudo apt update
sudo apt install ffmpeg

Usage

const { compressVideo } = require('compress-videos');

const videoPath = '/videos/test.mp4'
const replaceOriginal = false; //- Whether to replace the original video with the compressed one.

compressVideo(videoPath, replaceOriginal)
  .then((resultPath) => {
    console.log(`Video compressed successfully and replaced: ${resultPath}`);
  })
  .catch((err) => {
    console.error(`Error: ${err.message}`);
  });

How It Works

This package uses ffmpeg to compress videos, reducing their size by up to 40% without sacrificing quality. The compression process is lossless, ensuring that the video retains its original visual and audio quality while reducing the file size.

The libx264 codec is widely used for its efficient compression and high-quality output. This makes it ideal for reducing storage requirements and optimizing videos for faster upload speeds while maintaining the same high-quality output.

Keywords

FAQs

Package last updated on 29 Dec 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc