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

Error in /video/fx/freeze_region.py #146

Closed
savannahniles opened this issue Mar 25, 2015 · 2 comments
Closed

Error in /video/fx/freeze_region.py #146

savannahniles opened this issue Mar 25, 2015 · 2 comments

Comments

@savannahniles
Copy link
Contributor

Hi Zulko. 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.

The portion of the code that freezes a region currently reads:

if region is not None:

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

However I get the correct results when I rewrote and tested the function by setting the position last instead of first like this:

if region is not None:

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

Thanks for building this amazing tool. 💜

@Zulko
Copy link
Owner

Zulko commented Mar 25, 2015

Thanks for the report ! Do you want to make a pull request ?

savannahniles added a commit to savannahniles/moviepy that referenced this issue Mar 25, 2015
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)
@Zulko Zulko closed this as completed Mar 26, 2015
@Zulko
Copy link
Owner

Zulko commented Mar 26, 2015

Solved by the PR referenced above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants