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

Issue #574, fix duration of masks when using concatenate(.., method="compose") #585

Merged
38 commits merged into from Jul 14, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
b035660
add scipy for py2.7 on travis-ci
bearney74 Mar 14, 2017
1426eb2
Merge branch 'master' of github.com:Zulko/moviepy
bearney74 Mar 14, 2017
26ab7dc
add tests for ffmeg_parse_infos
bearney74 Mar 15, 2017
24f3f47
put communicate back in
bearney74 Mar 15, 2017
4f9709d
fix syntax error
bearney74 Mar 15, 2017
2e9f460
Update test_misc.py
bearney74 Mar 15, 2017
2c70ab2
Merge branch 'master' of github.com:Zulko/moviepy
bearney74 Mar 15, 2017
29089b2
Merge branch 'master' of github.com:Zulko/moviepy
bearney74 Mar 30, 2017
f54556c
Merge branch 'master' of github.com:Zulko/moviepy
bearney74 Mar 31, 2017
8eb6d9b
Merge branch 'master' of github.com:Zulko/moviepy
bearney74 Apr 4, 2017
b2ff5fd
Merge branch 'master' of github.com:Zulko/moviepy
bearney74 Apr 5, 2017
6e93d02
add scroll test
bearney74 Apr 7, 2017
478f44d
Merge branch 'master' of github.com:Zulko/moviepy
bearney74 Apr 10, 2017
745030b
Merge branch 'master' of github.com:Zulko/moviepy
bearney74 Apr 12, 2017
852466d
remove issue 527/528, this is in another PR
bearney74 Apr 12, 2017
a787a3d
Merge branch 'master' of github.com:Zulko/moviepy
bearney74 Apr 12, 2017
bd49aa9
add tests for colorx, fadein, fadeout
bearney74 Apr 12, 2017
fce552c
fix: cv2.CV_AA does not exist error in cv2 version 3
bearney74 Apr 12, 2017
51ea1f4
add headblur example, add opencv dependency
bearney74 Apr 12, 2017
f8c488f
openvcv only supports 2.7 and 3.4+
bearney74 Apr 12, 2017
878101f
Merge branch 'master' of github.com:Zulko/moviepy
bearney74 Apr 13, 2017
57b50dd
Merge branch 'master' of github.com:Zulko/moviepy
bearney74 Apr 17, 2017
de83bb6
Merge branch 'master' of github.com:Zulko/moviepy
bearney74 Apr 19, 2017
f210c1e
add Exception to ImageSequenceClip when sizes do not match
bearney74 Apr 19, 2017
90fe625
add test for ImageSequenceClip
bearney74 Apr 19, 2017
a712102
Merge branch 'master' of github.com:Zulko/moviepy
bearney74 Apr 19, 2017
26ac231
fix test mains
bearney74 Apr 19, 2017
9838451
fix copy error
bearney74 Apr 19, 2017
47cf9ec
add ImageSequenceClip exception test
bearney74 Apr 19, 2017
6bae0bc
Merge branch 'master' of github.com:Zulko/moviepy
bearney74 Apr 19, 2017
e747292
add second image to ImageSequenceClip test
bearney74 Apr 20, 2017
bdfb0fe
Merge branch 'master' of github.com:Zulko/moviepy
bearney74 Apr 20, 2017
e27df22
Merge branch 'master' of github.com:Zulko/moviepy
bearney74 Apr 28, 2017
dd4bac4
Merge branch 'master' of github.com:Zulko/moviepy
bearney74 May 30, 2017
cc5c14c
Merge branch 'master' of github.com:Zulko/moviepy
bearney74 Jun 14, 2017
2464e40
fix incorrect duration calculation when concatenate method=compose
bearney74 Jun 14, 2017
416279c
fix duration issue of masks when using concatenate method=compose
bearney74 Jun 14, 2017
0cc8b3b
`concatenate` -> `concatenate_videoclips
Jun 15, 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
2 changes: 1 addition & 1 deletion moviepy/Clip.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ def set_end(self, t):
of the returned clip.
"""
self.end = t
if self.end is None: return
if self.start is None:
if self.duration is not None:
self.start = max(0, t - newclip.duration)
Expand Down Expand Up @@ -387,7 +388,6 @@ def subclip(self, t_start=0, t_end=None):
t_start = self.duration + t_start #remeber t_start is negative

if (self.duration is not None) and (t_start>self.duration):

raise ValueError("t_start (%.02f) "%t_start +
"should be smaller than the clip's "+
"duration (%.02f)."%self.duration)
Expand Down
2 changes: 1 addition & 1 deletion moviepy/video/compositing/CompositeVideoClip.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def __init__(self, clips, size=None, bg_color=None, use_bgclip=False,
# compute mask if necessary
if transparent:
maskclips = [(c.mask if (c.mask is not None) else
c.add_mask().mask).set_pos(c.pos)
c.add_mask().mask).set_pos(c.pos).set_end(c.end).set_start(c.start, change_end=False)
for c in self.clips]

self.mask = CompositeVideoClip(maskclips,self.size, ismask=True,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_TextClip.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def test_duration():
return

clip = TextClip('hello world', size=(1280,720), color='white')
clip.set_duration(5)
clip=clip.set_duration(5)
assert clip.duration == 5

clip2 = clip.fx(blink, d_on=1, d_off=1)
Expand Down
13 changes: 13 additions & 0 deletions tests/test_issues.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,19 @@ def test_audio_reader():
subclip.write_audiofile(os.path.join(TMP_DIR, 'issue_246.wav'),
write_logfile=True)

def test_issue_547():
red = ColorClip((640, 480), color=(255,0,0)).set_duration(1)
green = ColorClip((640, 480), color=(0,255,0)).set_duration(2)
blue = ColorClip((640, 480), color=(0,0,255)).set_duration(3)

video=concatenate_videoclips([red, green, blue], method="compose")
assert video.duration == 6
assert video.mask.duration == 6

video=concatenate_videoclips([red, green, blue])
assert video.duration == 6


if __name__ == '__main__':
pytest.main()