Metadata-Version: 2.2
Name: ffmpeg-cut
Version: 1.0.2
Summary: Cut and join CLI wrapper for ffmpeg.
Home-page: https://github.com/ionelmc/python-ffmpeg-cut
Author: Ionel Cristian Mărieș
Author-email: contact@ionelmc.ro
License: BSD-2-Clause
Project-URL: Documentation, https://python-ffmpeg-cut.readthedocs.io/
Project-URL: Changelog, https://python-ffmpeg-cut.readthedocs.io/en/latest/changelog.html
Project-URL: Issue Tracker, https://github.com/ionelmc/python-ffmpeg-cut/issues
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: Unix
Classifier: Operating System :: POSIX
Classifier: Operating System :: Microsoft :: Windows
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Utilities
Requires-Python: >=3.9
License-File: LICENSE
License-File: AUTHORS.rst
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: home-page
Dynamic: license
Dynamic: project-url
Dynamic: requires-python
Dynamic: summary

========
Overview
========



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:

.. list-table::
    :widths: 10 90
    :stub-columns: 1

    - - 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.
