Skip to content

CLI tool make joining and cutting clips using ffmpeg a bit more pleasant.

License

Notifications You must be signed in to change notification settings

ionelmc/python-ffmpeg-cut

Repository files navigation

Overview

docs Documentation Status
tests GitHub Actions Build Status
package PyPI Package latest release PyPI Wheel Supported versions Supported implementations Commits since latest release

Cut and join CLI wrapper for ffmpeg.

  • Free software: BSD 2-Clause License

Installation

pip install ffmpeg-cut

You can also install the in-development version with:

pip install https://github.com/ionelmc/python-ffmpeg-cut/archive/main.zip

Documentation

https://python-ffmpeg-cut.readthedocs.io/

Usage: ffmpeg-cut [-h] [[-j | -c W:H | -f W:H |] -n] [-q CRF] [-d] [-r] [-s FPS] [-e ENCODER] [-t] [-l] input output [cut] [cut ...]

positional arguments:
input
input file
output
output file
cut
pair of timestamps to cut
options:
-h, --help show this help message and exit
-j, --join input file is ffmpeg concat instruction file
-c SIZE, --crop SIZE
 crop input to a given ratio
-f SIZE, --filter SIZE
 arbitrary filter on specific zone
-n, --no-join only produce the intermediary clips and ffmpeg concat instruction file
-q CRF, --quality CRF
 libx265 crf
-d, --dry-run only display what would be run
-r, --dirty do not delete intermediary files
-s FPS, --fps FPS
 output framerate
-e ENCODER, --encoder ENCODER
 you can use libx265 for better compression but possibly worse player support
-t, --text input file is text file with cuts
-l, --clips input file is clips file with cuts

If you use --text then the input file must contain instructions in the form:

path/to/video.mkv
HH:MM:SS.mmm-HH:MM:SS.mmm
HH:MM:SS.mmm-HH:MM:SS.mmm

path/to/another/video.mp4
HH:MM:SS.mmm-HH:MM:SS.mmm
HH:MM:SS.mmm-HH:MM:SS.mmm
HH:MM:SS.mmm-HH:MM:SS.mmm

Development

To run all the tests run:

tox

Note, to combine the coverage data from all the tox environments run:

Windows
set PYTEST_ADDOPTS=--cov-append
tox
Other
PYTEST_ADDOPTS=--cov-append tox

About

CLI tool make joining and cutting clips using ffmpeg a bit more pleasant.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages