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 |
Changelog
1.0.2 (2025-01-13)
Switch to Matroska clips for the intermediate files to avoid “Non-monotonic DTS” warnings.
Added some timestamp fixup (avoid_negative_ts) in the cut phase to avoid some warnings (and maybe wrong output).
1.0.1 (2025-01-13)
Added –version option.
Fixed broken run function.
1.0.0 (2024-09-26)
First release on PyPI.
Metadata
Release files for ffmpeg-cut 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ffmpeg_cut-1.0.2.tar.gz | 19.2 kB | Without provenance | Details for ffmpeg_cut-1.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ffmpeg_cut-1.0.2-py3-none-any.whl | Python 3 | none | any | Details for ffmpeg_cut-1.0.2-py3-none-any.whl |
Total release size: 27.8 kB
Release files / ffmpeg_cut-1.0.2.tar.gz
| Download URL | ffmpeg_cut-1.0.2.tar.gz |
|---|---|
| Size | 19.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3ff5af6dc74cea72b0c988398a530217256ed7fddd383eee749c6931bba94c43
|
|
BLAKE2b-256 checksum How to use checksums |
9a88ad87d339f83685c763bfaa31101c92b61b35f2beb482c3334077cea5bcf0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.8
|
Release files / ffmpeg_cut-1.0.2-py3-none-any.whl
| Download URL | ffmpeg_cut-1.0.2-py3-none-any.whl |
|---|---|
| Size | 8.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4e5f47570401d291d637a963e50a539d3149ed392cd3c321ee272f90519c9414
|
|
BLAKE2b-256 checksum How to use checksums |
022165511c7301d3ae140a4d953ea577f07046abd6863bedfe3a915bae7ae74f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.8
|
Security for ffmpeg-cut 1.0.2
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.