Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MixVideoConcat

CodeQL Codespell 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 temporary 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!

About

Mixed Videos Concatenator based on ffmpeg

Topics

Resources

Stars

5 stars

Watchers

1 watching

Forks

Used by

Contributors

Languages