Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make FFMPEG_VideoReader more robust to missing information. #2253

Merged
merged 1 commit into from
Nov 25, 2024

Conversation

Breakthrough
Copy link
Contributor

@Breakthrough Breakthrough commented Nov 23, 2024

Allow FFMPEG_VideoReader to function more robustly in the presence of missing information.

I have a variety of existing tests in my project PySceneDetect that began to fail suddenly during the update to MoviePy 2.0. Some of these tests include loading corrupt videos, and testing how the FFMPEG_VideoReader class responds to certain seeking and EOF behaviors.

In previous versions, a video under test would read the first 45 frames or so before failing, but with the latest version, it throws an exception when trying to create the FFMPEG_VideoReader. This PR has the required changes to make loading the video more robust to the missing information to still allow corrupt files to be processed, even if incompletely.

Resolves #2256

  • I have provided code that clearly demonstrates the bug and that only works correctly when applying this fix
  • I have properly documented new or changed features in the documentation or in the docstrings
  • I have properly explained unusual or unexpected code in the comments around it

Breakthrough added a commit to Breakthrough/PySceneDetect that referenced this pull request Nov 23, 2024
Breakthrough added a commit to Breakthrough/PySceneDetect that referenced this pull request Nov 23, 2024
Skip corrupt video test on MoviePy awaiting Zulko/moviepy#2253
Breakthrough added a commit to Breakthrough/PySceneDetect that referenced this pull request Nov 23, 2024
Skip corrupt video test on MoviePy awaiting Zulko/moviepy#2253
Breakthrough added a commit to Breakthrough/PySceneDetect that referenced this pull request Nov 23, 2024
* [backends] Fix behavior of MoviePy backend

There are still some fixes required in MoviePy itself to make corrupt video tests pass.

* [backends] Fix MoviePy 2.0 EOF behavior

Skip corrupt video test on MoviePy awaiting Zulko/moviepy#2253

* [build] Enable Moviepy tests for builds and document workarounds for #461
Allow `FFMPEG_VideoReader` to function more robustly in the presence of missing information.

Fixes Zulko#2256
@Breakthrough
Copy link
Contributor Author

Passes unit tests locally and ensured code is formatted.

@coveralls
Copy link

Coverage Status

coverage: 86.368% (-0.06%) from 86.428%
when pulling e85d7ef on Breakthrough:master
into c88852f on Zulko:master.

@Zulko Zulko merged commit e452e45 into Zulko:master Nov 25, 2024
8 of 15 checks passed
@Zulko
Copy link
Owner

Zulko commented Nov 25, 2024

Thank you, I just released it under moviepy==2.1.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MoviePy 2.0 throws exception on loading video previous version worked with
3 participants