Skip to content

Commit

Permalink
Get actual video duration instead of reading from metadata (#1063)
Browse files Browse the repository at this point in the history
  • Loading branch information
sarjann committed Jun 6, 2020
1 parent 5c7a69e commit 2390aec
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added <!-- for new features -->

### Changed <!-- for changes in existing functionality -->
- `ffmpeg_parse_infos()` and `VideoFileClip` now detect the actual duration of the decoded video instead of the duration stored in its metadata [#1063]

### Deprecated <!-- for soon-to-be removed features -->

Expand All @@ -22,6 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed <!-- for any bug fixes -->



## [v2.0.0.dev1](https://github.com/zulko/moviepy/tree/v2.0.0.dev1) (2020-06-04)

[Full Changelog](https://github.com/zulko/moviepy/compare/v1.0.3...v2.0.0.dev1)
Expand Down
6 changes: 3 additions & 3 deletions moviepy/video/io/ffmpeg_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@ def ffmpeg_read_image(filename, with_mask=True):
Wraps FFMPEG_Videoreader to read just one image.
Returns an ImageClip.
This function is not meant to be used directly in MoviePy,
use ImageClip instead to make clips out of image files.
This function is not meant to be used directly in MoviePy.
Use ImageClip instead to make clips out of image files.
Parameters
-----------
Expand Down Expand Up @@ -263,7 +263,7 @@ def ffmpeg_parse_infos(

# open the file in a pipe, provoke an error, read output
is_GIF = filename.endswith(".gif")
cmd = [FFMPEG_BINARY, "-i", filename]
cmd = [FFMPEG_BINARY, "-i", filename, "-acodec", "copy", "-f", "null", "-"]
if is_GIF:
cmd += ["-f", "null", "/dev/null"]

Expand Down

0 comments on commit 2390aec

Please sign in to comment.