Skip to main content

Video Compressing

PyPI version

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 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"
)

Metadata

Release files for video_compressing 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for video_compressing 0.1.4
File Size Uploaded Provenance Actions
video_compressing-0.1.4.tar.gz 5.3 kB Without provenance Details for video_compressing-0.1.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for video_compressing 0.1.4
File Interpreter ABI Platform Actions
video_compressing-0.1.4-py3-none-any.whl Python 3 none any Details for video_compressing-0.1.4-py3-none-any.whl

Total release size: 11.8 kB

Release files / video_compressing-0.1.4.tar.gz

Download URL video_compressing-0.1.4.tar.gz
Size 5.3 kB
Tags Source
SHA-256 checksum
How to use checksums
fd70e235c102d28cd99d4c1015705101235262feb4bdafc58639fadf6140cc5e
BLAKE2b-256 checksum
How to use checksums
288c6a652cd7a35d32ee405dee157a5ed16850669a29c25cb06f53b7a557850f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.4 CPython/3.9.7 Darwin/23.1.0

Release files / video_compressing-0.1.4-py3-none-any.whl

Download URL video_compressing-0.1.4-py3-none-any.whl
Size 6.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8cae1971ccd3ca8abbc97fc696abdfac1a3508a3e7d44c3819c2bf60236cae38
BLAKE2b-256 checksum
How to use checksums
4e22c64c03e3a5cc7b2f437a968469cd62f5cfddb5a6d8ce8a037cfdbae19ea7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.4 CPython/3.9.7 Darwin/23.1.0

Security for video_compressing 0.1.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page