Skip to main content

Package to compress multiple large .MOV 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.0.tar.gz (5.2 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.0-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: video_compressing-0.1.0.tar.gz
  • Upload date:
  • Size: 5.2 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.0.tar.gz
Algorithm Hash digest
SHA256 f0c28df7b1ef5bd46494a4e2795ff75900e9beb7297ee6f58096c752a1da05c2
MD5 725fc0633f0faf1409127b0691cae280
BLAKE2b-256 878c19ac8df3e2a93f167712fcdbcdba4911d3612035ff305aca19a0628d0604

See more details on using hashes here.

File details

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

File metadata

  • Download URL: video_compressing-0.1.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a9df03e431fa996bedf3fe6996bc3477debe15e7a1c2da70d9f12d513ecfc304
MD5 bdd25ba2ef5dddb5d30f400b8b57ca5d
BLAKE2b-256 e7d274e1d742a1705522b35a55edd30a99e50b8fccd120ef1bfd3e845dfae1cc

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