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

Loop effect needs fixing #1368

Closed
3 tasks done
tburrows13 opened this issue Oct 28, 2020 · 4 comments · Fixed by #1373
Closed
3 tasks done

Loop effect needs fixing #1368

tburrows13 opened this issue Oct 28, 2020 · 4 comments · Fixed by #1373
Assignees
Labels
bug Issues that report (apparent) bugs. good-first-issue Especially suitable for people new to moviepy and/or programming; beginner-friendly.

Comments

@tburrows13
Copy link
Collaborator

tburrows13 commented Oct 28, 2020

You can see in test_loop() that loop is not quite working as some tests are skipped or else they would cause the tests to fail. To close this issue you need to do the following

  • Try running the tests that are currently broken
  • Fix loop so that the tests can run (or convince me that the tests are wrong :) )
  • Add some new tests using BitmapClip (in the vein of test_freeze() to test for frame-perfect looping

Feel free to comment here or on GitHub if you need some help.
This is a specific case of #1355.

@tburrows13 tburrows13 added bug Issues that report (apparent) bugs. good-first-issue Especially suitable for people new to moviepy and/or programming; beginner-friendly. labels Oct 28, 2020
@tburrows13 tburrows13 changed the title Loop effect need fixing Loop effect needs fixing Oct 30, 2020
@ParikhNand
Copy link
Contributor

@tburrows13
Could you please assign this issue to me?

somstrom added a commit to somstrom/moviepy that referenced this issue Nov 2, 2020
ParikhNand pushed a commit to ParikhNand/moviepy that referenced this issue Nov 3, 2020
tburrows13 pushed a commit that referenced this issue Nov 3, 2020
* Tests for loop using BitmapClip #1368

* added test for infinite loop, commented failing tests

* added test for infinite loop, commented failing tests

* added test for infinite loop, commented failing tests #1370
@RealA10N
Copy link

RealA10N commented Nov 3, 2020

#1372 May be related & helpful :D

@julienbeisel
Copy link

Hi @tburrows13,

I'm using Moviepy a lot and I'd like to contribute.

Maybe I'm wrong but I think the loop effect is still not working properly:

def loop(clip, n=None, duration=None):
"""
Returns a clip that plays the current clip in an infinite loop.
Ideal for clips coming from gifs.
Parameters
------------
n
Number of times the clip should be played. If `None` the
the clip will loop indefinitely (i.e. with no set duration).
duration
Total duration of the clip. Can be specified instead of n.
"""
previous_duration = clip.duration
clip = clip.time_transform(lambda t: t % previous_duration)
if n:
duration = n * previous_duration
if duration:
clip = clip.with_duration(duration)
return clip

If n is set to a value but duration is set to None, the clip won't be updated. That might be one of the reasons the tests are broken.

Can I try to fix it or somebody else is already working on it ?

@mondeja mondeja linked a pull request Jan 13, 2021 that will close this issue
1 task
@mondeja mondeja removed a link to a pull request Jan 13, 2021
1 task
@mondeja mondeja linked a pull request Jan 13, 2021 that will close this issue
2 tasks
@tburrows13
Copy link
Collaborator Author

Hi @julienbeisel, I can't replicate that problem with the latest version in master (after #1373 is applied). Is it still an issue for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues that report (apparent) bugs. good-first-issue Especially suitable for people new to moviepy and/or programming; beginner-friendly.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants