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

FFmpeg Writer: handle redirected logs when checking for errors #890

Merged
merged 8 commits into from
Mar 30, 2020

Conversation

declension
Copy link
Contributor

@declension declension commented Dec 18, 2018

  • Previously we were looking for 'foo' in None resulting in a TypeError (FFMPEG VideoWriter throws TypeError on error when logged. #877)
  • Now, if an IOError occurs when running FFmpeg to write video clips, but there is no output returned, assume we are redirected, and give the user a helpful message about where to look for errors (i.e. in the logs), instead of throwing a secondary TypeError.
  • Add test for this case.

Fixes #877.

  • If this is a bugfix, I have provided code that clearly demonstrates the problem and that works when used with this PR
  • I have added a test to the test suite, if necessary
  • I have properly documented new or changed features in the documention, or the docstrings
  • I have properly documented unusual changes to the code in the comments around it
  • I have made note of any breaking/backwards incompatible changes

 * Previously we were looking for `'foo' in None` resulting in a TypeError (Zulko#877)
 * Now, if an `IOError` occurs when running FFmpeg to write video clips, **but** there is no output returned, assume we are redirected, and give the user a helpful message about where to look for errors (i.e. in the logs), instead of throwing a secondary `TypeError`.
 * Add test for this case.

Fixes Zulko#877.
For some reason Pytest on Python 2 is not catching this, even though they are aliases in the code, and Python 3.4 - 3.6 all do...
Copy link
Collaborator

@Overdrivr Overdrivr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've made some quick feedback, could you also read the contents of the logfile instead of the telling the user to do it ? It would be more transparent and easier. Thanks again for your contrib !

moviepy/video/io/ffmpeg_writer.py Outdated Show resolved Hide resolved
moviepy/video/io/ffmpeg_writer.py Outdated Show resolved Hide resolved
@Overdrivr Overdrivr added the review-needed PRs which need to be reviewed (further) by project maintainers. label Mar 28, 2019
@coveralls
Copy link

coveralls commented Feb 11, 2020

Coverage Status

Coverage increased (+0.3%) to 64.686% when pulling db36ff6 on declension:fix-logged-ffmpeg-type-error into 30bd852 on Zulko:master.

@declension
Copy link
Contributor Author

@Overdrivr Sorry - I never saw the feedback. I've updated as suggested...

@mgaitan mgaitan self-assigned this Mar 27, 2020
@mgaitan
Copy link
Collaborator

mgaitan commented Mar 27, 2020

@declension this is ok for me and I would like to merge it. Could you fix the conflicts?

@mgaitan
Copy link
Collaborator

mgaitan commented Mar 27, 2020

maybe we should rebase it against v2 @tburrows13 ?

@tburrows13
Copy link
Collaborator

That's the conflicts fixed (just through the web editor). If the tests pass, feel free to merge.

I can't say I love its newlines, but hey it's here now...
@declension
Copy link
Contributor Author

@tburrows13 @mgaitan fixed the remaining PR bits up now, please merge whenever.

@tburrows13 tburrows13 removed the review-needed PRs which need to be reviewed (further) by project maintainers. label Mar 30, 2020
@tburrows13
Copy link
Collaborator

Great, thanks for fixing it up. It will be released with v2.0.

@tburrows13 tburrows13 merged commit 98c73cd into Zulko:master Mar 30, 2020
@keikoro keikoro added breaking-change Must not merge without proper approval. Requires full documentation (own section) in the changelog. and removed new-behaviour labels Oct 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change Must not merge without proper approval. Requires full documentation (own section) in the changelog.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FFMPEG VideoWriter throws TypeError on error when logged.
6 participants