Skip to main content

Package to compress multiple large .MOV or .MP4 videos into a single light .mp4 video.

Project description

Video Compressing

A Python library for reducing the size of and merging multiple video files. This package is designed for simplicity and efficiency, leveraging FFmpeg for video compression and manipulation.

Features

  • Reduce Video Size: Scale down video dimensions and bitrate using a customizable reduction factor.
  • Merge Multiple Videos: Combine multiple video files into a single output.
  • Command-Line Interface: Use the package directly from the terminal for quick processing.

Installation

Clone the Repository

git clone https://github.com/Gabriel-melki/video-compressing.git
cd video-compressing

Install Dependencies

This project uses Poetry for dependency management. Install Poetry if you don’t have it:

pip install poetry

Install the dependencies and activate the vitual environment:

poetry install
poetry shell

Ensure FFmpeg is installed on your system:

Ubuntu/Debian:

sudo apt update && sudo apt install ffmpeg

MacOS (with Homebrew):

brew install ffmpeg

Windows:

Download FFmpeg and add it to your PATH.

Usage

Command-Line Tool You can run the VideoCompressing tool directly from the terminal.

python -m src.video_compressing.reduce_video input1.mp4 input2.mp4 -r 0.5 -o output.mp4

Parameters:

  • input_files: List of input video files (required)
  • -r, --reduction-factor: A float value to scale down videos (required). Example: 0.5 reduces the size by 50%.
  • o, --output-file: Name of the output file (optional). Default: Automatically generated if not provided.

Example:

Reduce and merge video1.mp4 and video2.mp4 by 50% into output.mp4:

python -m src.video_compressing.reduce_video video1.mp4 video2.mp4 -r 0.5 -o output.mp4

Without an output file:

python -m src.video_compressing.reduce_video video1.mp4 video2.mp4 -r 0.5

Using as a Library Import and call the reduce_and_merge_videos function directly in your Python code:

from src.video_compressing.tools import reduce_and_merge_videos

reduce_and_merge_videos(
    input_files=["video1.mp4", "video2.mp4"],
    reduction_factor=0.5,
    output_file="output.mp4"
)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

video_compressing-0.1.1.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

video_compressing-0.1.1-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file video_compressing-0.1.1.tar.gz.

File metadata

  • Download URL: video_compressing-0.1.1.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.9.7 Darwin/23.1.0

File hashes

Hashes for video_compressing-0.1.1.tar.gz
Algorithm Hash digest
SHA256 06651a29f859b05f3ba5d9a8ee63af7d829968342af9a79321017ee75ebee645
MD5 552c70dde611852dc2345e85446f47fc
BLAKE2b-256 cbba7c3cfbd340102c42fe9352e5d52e9a0d3d78e27926d4e36e184e6443d854

See more details on using hashes here.

File details

Details for the file video_compressing-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: video_compressing-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.9.7 Darwin/23.1.0

File hashes

Hashes for video_compressing-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 98d776751fab8c3ff29402b5690855866bb91527caa54ba26b6c09593524b958
MD5 187418b18d8ded09f7df759cfc5bd2db
BLAKE2b-256 e5a47d16c28efa4111214412563386fa7e883e0a4dbfd2eae3f5fdf2f9ffb9f4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page