-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Audio error handling made failsafe #377
Conversation
2 similar comments
The PR now only shows a warning when not enough frames can be read (happens when there are less frames than should be, according to fps*duration). Because of that, when iterating over a larger range than the actual clip (as in https://github.com/gyglim/moviepy/blob/68df86c880ec1df0f9f3e0d4b36efa02f8c2b8eb/tests/test_issues.py#L139), it was possible to request frames completely out of the estimated valid range, while before, an error would occur earlier. |
Hey. Just added a test for this. Is there anything else needed to merge it? @Earney |
Sorry i thought this was merged. Id say yes to this pr. It's a bit of a hack, but it wont be the first in moviepy, and if it solves that audio problem it's good for me. |
Ok, great :). I agree, but it makes sense and is consistent with what happens for video |
@gyglim lets merge this in.. unless someone objects? |
@Earney Yes, let's do it |
This PR is to improve audio reading robustness.
In case there are audio frames missing, this repeats the last frame, as is done in the case for video frames:
https://github.com/Zulko/moviepy/blob/master/moviepy/video/io/ffmpeg_reader.py#L109
Thus it makes the code more consistent and robust.
Fixing #246
Cheers,
Michael