Skip to main content

Mixed videos concatenator

Project description

MixVideoConcat

CodeQL PyPI - Version PyPI - Downloads Code style: black

MixVideoConcat is a Python tool/library based on ffmpeg for concatenating video files of different formats, resolutions, and orientations into a single video file. It supports various input formats and ensures seamless merging of videos while handling differences in resolution and orientation.

Requirements

MixVideoConcat requires FFmpeg (including ffprobe) to be installed and available on your system PATH.

  • Linux: sudo apt install ffmpeg (or your distro's package manager)
  • macOS: brew install ffmpeg
  • Windows: Download from ffmpeg.org (e.g., the gyan.dev GPL build), extract it, and add the bin folder to your system PATH.

Alternatively, you can point to a custom FFmpeg binary by setting the FFMPEG_BINARY environment variable.

Installation

You can install MixVideoConcat via pip:

pip install mixvideoconcat

Command line tool usage

mixvideoconcat [-h] [-t TMPDIR] [-l LOGFILE] [-f] sources [sources ...] destination

positional arguments:
  sources               Source files
  destination           Destination file

options:
  -h, --help            show this help message and exit
  -t TMPDIR, --tmpdir TMPDIR
                        Directory for temprary files (they can be huge!)
  -l LOGFILE, --logfile LOGFILE
                        Log file
  -f, --force           Overwrite existing
  --deinterlace {on,off,auto}
                        Deinterlace mode (default: auto)
  --stabilize {on,off}  Stabilize mode (default: on)
  -v, --verbose         Print verbose information (ffmpeg output)

Example

Concatenate three video files (video1.mp4, video2.mov, video3.avi) into a single video file named output.mp4:

mixvideoconcat video1.mp4 video2.mov video3.avi output.mp4

Library usage

from mixvideoconcat import concat

concat(['video1.mp4', 'video2.mov', 'video3.avi'], 'output.mp4')

Tune

You can override the default constant rate factor (CRF) of 23 by setting the FFMPEG_CRF environment variable. The frame rate will be determined as the maximum frame rate among the source files. To override this, use the FFMPEG_FR environment variable.

Contributing

Contributions are welcome! Please feel free to submit issues, feature requests, or pull requests.

Show your support

Give a ⭐️ if this project helped you!

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

mixvideoconcat-1.4.0.tar.gz (50.4 kB view details)

Uploaded Source

Built Distribution

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

mixvideoconcat-1.4.0-py3-none-any.whl (33.4 kB view details)

Uploaded Python 3

File details

Details for the file mixvideoconcat-1.4.0.tar.gz.

File metadata

  • Download URL: mixvideoconcat-1.4.0.tar.gz
  • Upload date:
  • Size: 50.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.12

File hashes

Hashes for mixvideoconcat-1.4.0.tar.gz
Algorithm Hash digest
SHA256 f9d3b0f5c104a505a8cda6f858df6be85a16560e44cbacb65276dcb233da03a8
MD5 09f2f245f58dd2704f04282ea36c186a
BLAKE2b-256 f54c2a11f0d7dba36dd166f5ee2d817417a635aff8fb79cd2840be6b3b791e2d

See more details on using hashes here.

File details

Details for the file mixvideoconcat-1.4.0-py3-none-any.whl.

File metadata

  • Download URL: mixvideoconcat-1.4.0-py3-none-any.whl
  • Upload date:
  • Size: 33.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.12

File hashes

Hashes for mixvideoconcat-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a4b7751bf545f5ede87cdfe8caaacc6c04310c83b9bdd2e30ff853f21f49a2b5
MD5 9f546d6a3ea1661621bd9e2333fdc9ea
BLAKE2b-256 aafbf60c64a7f4219037e42bbb2f1bb218ebfc3e698c38603542927556a2f7b6

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