Skip to main content

Cut and join CLI wrapper for ffmpeg.

Project description

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.1 (2025-01-13)

  • Added –version option.

  • Fixed broken run function.

1.0.0 (2024-09-26)

  • First release on PyPI.

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

ffmpeg_cut-1.0.1.tar.gz (19.0 kB view details)

Uploaded Source

Built Distribution

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

ffmpeg_cut-1.0.1-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file ffmpeg_cut-1.0.1.tar.gz.

File metadata

  • Download URL: ffmpeg_cut-1.0.1.tar.gz
  • Upload date:
  • Size: 19.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.8

File hashes

Hashes for ffmpeg_cut-1.0.1.tar.gz
Algorithm Hash digest
SHA256 db358f302140026945bdb02d0b7a61ab7cac98e29c2cfb13be4b3ecef382fd36
MD5 cf0290c2d1d848a99b3aaaf056bbcb81
BLAKE2b-256 c19ed51b6f9df79ecd8f9787b845641719d26edc221166c1e52de44d4e622c7e

See more details on using hashes here.

File details

Details for the file ffmpeg_cut-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: ffmpeg_cut-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.8

File hashes

Hashes for ffmpeg_cut-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 489a586ac3aece9701329641e203e214ced750672edc2b8daebe8ed81156e684
MD5 0fe40c34a9e2a177c791bf688ec92416
BLAKE2b-256 06f6c7c3ed9f375c46f645131a14e077862f911ee20ff641414549567396fe89

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