Skip to content

Commit

Permalink
fixing region parameter on freeze_region
Browse files Browse the repository at this point in the history
I was having trouble with getting good results from the freeze_region function when I specified a region. Specifying an outer_region gave exactly the expected response, but specifying a region positioned the region at 0,0 regardless of the values of x1 and y1. I get the correct results when I rewrote and tested the function by setting the position last instead of first (lines 38 - 40). Issue here: Zulko#146 (comment)
  • Loading branch information
savannahniles committed Mar 25, 2015
1 parent b1d3dac commit ac789af
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions moviepy/video/fx/freeze_region.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ def freeze_region(clip, t=0, region=None, outside_region=None, mask=None):

x1, y1, x2, y2 = region
freeze = (clip.fx(crop, *region)
.set_position((x1,y1))
.to_ImageClip(t=t)
.set_duration(clip.duration))
.set_duration(clip.duration)
.set_position((x1,y1)))
return CompositeVideoClip([clip, freeze])

elif outside_region is not None:
Expand All @@ -53,4 +53,4 @@ def freeze_region(clip, t=0, region=None, outside_region=None, mask=None):
freeze = (clip.to_ImageClip(t=t)
.set_duration(clip.duration)
.set_mask(mask))
return CompositeVideoClip([clip, freeze])
return CompositeVideoClip([clip, freeze])

0 comments on commit ac789af

Please sign in to comment.