Skip to content

Video editing with Python

Fixed duration in meta data when generating subclips in ffmpeg_tools (#1317)

hlzl6bc7d884da54
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 976aa6d1..6efd382c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -23,6 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Removed <!-- for now removed features -->
### Fixed <!-- for any bug fixes -->
+- Fixed `ffmpeg_tools.ffmpeg_extract_subclip` creating clips with incorrect duration metadata [#1317]
- `OSError: MoviePy error: failed to read the first frame of video file...` would occasionally occur for no reason [#1220]
- Warnings are no longer being supressed by MoviePy [#1191]
- Fixed `UnicodeDecodeError` crash when file metadata contained non-UTF8 characters [#959]
diff --git a/moviepy/video/io/ffmpeg_tools.py b/moviepy/video/io/ffmpeg_tools.py
index a46ab4d1..5cb30013 100644
--- a/moviepy/video/io/ffmpeg_tools.py
+++ b/moviepy/video/io/ffmpeg_tools.py
@@ -57,6 +57,7 @@ def ffmpeg_extract_subclip(filename, t1, t2, targetname=None):
"copy",
"-acodec",
"copy",
+ "-copyts",
targetname,
]
subprocess_call(cmd)