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

Issue629 #630

Merged
34 commits merged into from
Aug 16, 2017
Merged
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
586632b
Exceptions do not have a .message attribute.
Julian-O Jun 30, 2017
c79d202
Help tests run on Windows - don't assume temp dir or fonts.
Julian-O Jun 30, 2017
328de3d
Help tests run on Windows - allow some flexibility in versions.
Julian-O Jun 30, 2017
9939f52
Issue 596: Add initial support for closing clips.
Julian-O Jul 1, 2017
e50aef7
Issue 596: Update doctest examples to call close.
Julian-O Jul 1, 2017
dc4a16a
More exception details for easier debugging of ImageMagick issues.
Julian-O Jul 1, 2017
bf9c3ad
Issue #596: Move away from expecting/requiring __del__ to be called.
Julian-O Jul 1, 2017
de5cb86
Issue #596: Move ffmpeg_writer to using close.
Julian-O Jul 1, 2017
505939f
Issue #596: Update ffmpeg_audiowriter to support close/context manager.
Julian-O Jul 1, 2017
09bc06a
Issue #596: Move AudioFileClip to use close(), away from __del__.
Julian-O Jul 1, 2017
495cd3e
Issue #596: Support close() on CompositeVideoClip.
Julian-O Jul 1, 2017
2c5307b
Issue #596: Add tests to see if this issue has been repaired.
Julian-O Jul 1, 2017
c1a1563
Issue #596: Update tests to use close().
Julian-O Jul 1, 2017
ff38df9
Further to PR #597: Change to Arial
Julian-O Jul 1, 2017
c4d8e40
Issue #596 and #598: Updated test to support close().
Julian-O Jul 1, 2017
e72cc02
Revert "More exception details for easier debugging of ImageMagick is…
Julian-O Jul 1, 2017
ff6688c
Issue #599: test_6 doesn't test anything.
Julian-O Jul 1, 2017
f4dcd47
Issue #596: Move comment to avoid incorporate into documents.
Julian-O Jul 1, 2017
65971a0
Issue #596: Add usages tips to documentation.
Julian-O Jul 1, 2017
e21be36
Clip class missing from reference documents.
Julian-O Jul 1, 2017
9383de5
Copy-edit: Clumsy sentence in documentation.
Julian-O Jul 1, 2017
7f930e8
Fix failing doctest.
Julian-O Jul 1, 2017
53c60b4
Issue 596: Add initial support for closing clips.
Julian-O Jul 1, 2017
2221c5e
Merge branch 'WindowsSupport' of C:\Users\xboxl\OneDrive\Documents\My…
Julian-O Aug 4, 2017
7c3f525
Merge
Julian-O Aug 4, 2017
0c3b1be
Neaten up output and PEP8 compliance.
Julian-O Aug 8, 2017
ce44cd7
Remove references to /tmp to allow to run on Windows.
Julian-O Aug 8, 2017
0415123
Reference to PermissionError failing on Python 2.7.
Julian-O Aug 8, 2017
2fc414f
Migrate to use requests to avoid certificate problems.
Julian-O Aug 8, 2017
ec2d5ba
Clean up of dependencies.
Julian-O Aug 8, 2017
fc2b64e
Simplification of Travis file - letting te setup.py do the heavy lifting
Julian-O Aug 8, 2017
abcf4cc
Add Appveyor support.
Julian-O Aug 8, 2017
ab19580
Solve Issue 629.
Julian-O Aug 10, 2017
98a4f14
Merge branch 'master' into Issue629
Julian-O Aug 10, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Issue #596: Support close() on CompositeVideoClip.
Note: It does NOT close all the subclips, because they may be used
again (by the caller). It is the caller's job to clean them up.

But clips created by this instance are closed by this instance.
Julian-O committed Jul 1, 2017
commit 495cd3ef3cb8362cbef12e400fe45a79438e344b
14 changes: 14 additions & 0 deletions moviepy/video/compositing/CompositeVideoClip.py
Original file line number Diff line number Diff line change
@@ -75,9 +75,11 @@ def __init__(self, clips, size=None, bg_color=None, use_bgclip=False,
if use_bgclip:
self.bg = clips[0]
self.clips = clips[1:]
self.created_bg = False
else:
self.clips = clips
self.bg = ColorClip(size, col=self.bg_color)
self.created_bg = True



@@ -117,6 +119,18 @@ def playing_clips(self, t=0):
actually playing at the given time `t`. """
return [c for c in self.clips if c.is_playing(t)]

def close(self):
if self.created_bg and self.bg:
# Only close the background clip if it was locally created.
# Otherwise, it remains the job of whoever created it.
self.bg.close()
self.bg = None
if hasattr(self, "audio") and self.audio:
self.audio.close()
self.audio = None





def clips_array(array, rows_widths=None, cols_widths=None,