When trimming, FFmpeg 5.x retains the input presentation timestamp (PTS)
in the output. This causes the trimmed output frames to be duplicates
of the first. To prevent this, the output PTS needs to be recalculated.
* Import ABC from collections.abc instead of collections for Python 3.9 compatibility.
* Fix deprecation warnings due to invalid escape sequences.
* Support Python 3.10
Co-authored-by: Karl Kroening <karlk@kralnet.us>
This sets up GitHub Actions (GHA) to run in place of the
currently broken Travis CI. Initially, this only covers running
tox/pytest and Black, but may eventually be extended to run pylint,
mypy, flake8, etc. - see #605, for example.
Notes:
* Python 3.10 is not yet supported due to the `collections.Iterable`
issue discussed in #330, #624, etc.
* The Black CI step acts as a linting step, rather than attempting to
have the GHA job automatically update/commit/push the reformarted
code.
* Black is currently pinned to an older version that supports
`--target-version py27` until Python 2 compatibility can be dropped in
the final Python 2 compatibility release of ffmpeg-python.
* Only the main source directory (`ffmpeg/`) is checked with Black at
the moment. The `examples/` directory should also be checked, but
will be done as a separate PR.
Co-authored by: Christian Clauss <cclauss@me.com>
Fix for Python2 so that timeout is only used as keyword argument if it
is provided
Added a test for the new timeout argument that will run for Python >
3.3.
For instance, add multiple `streamid` in the output can be done like this:
ffmpeg.input(url).output('video.mp4', streamid=['0:0x101', '1:0x102'])
will output this command line
ffmpeg -i video.mp4 -streamid 0:0x101 -streamid 1:0x102 video.mp4