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

crossfadeout "Attribute 'duration' not set" #354

Closed
groundflyer opened this issue Nov 29, 2016 · 3 comments · Fixed by #355
Closed

crossfadeout "Attribute 'duration' not set" #354

groundflyer opened this issue Nov 29, 2016 · 3 comments · Fixed by #355
Labels
bug Issues that report (apparent) bugs.

Comments

@groundflyer
Copy link
Contributor

When trying to crossfadeout a clip with defined duration ValueError: Attribute 'duration' not set raised.

@keikoro keikoro added the bug Issues that report (apparent) bugs. label Feb 25, 2017
@keikoro
Copy link
Collaborator

keikoro commented Feb 25, 2017

@groundflyer Does the bug persist on your end, using the current version of MoviePy? It might have been fixed with changes recently made to the code base, just wondering if you can still reproduce it (and how).

@groundflyer
Copy link
Contributor Author

@kerstin @Earney
I just tested the master branch with such a snippet:

from moviepy import editor

clip = editor.ImageClip("comp/title_end.jpg")

clip.duration = 10
crosstime = 1

caption = editor.TextClip("test text", font="Liberation-Sans-Bold", color='white', stroke_color='gray', stroke_width=2, method='caption', size=(1280, 720), fontsize=60, align='South-East')
caption.duration = clip.duration
fadecaption = caption.crossfadein(crosstime).crossfadeout(crosstime)
ret = editor.CompositeVideoClip([clip, fadecaption])

and still getting the same error.

Traceback (most recent call last):
  File "test_crossfade_out.py", line 10, in <module>
    fadecaption = caption.crossfadein(crosstime).crossfadeout(crosstime)
  File "<decorator-gen-81>", line 2, in crossfadeout
  File "/home/toster/.local/lib64/python3.4/site-packages/moviepy-0.2.2.13-py3.4.egg/moviepy/decorators.py", line 54, in requires_duration
    return f(clip, *a, **k)
  File "<decorator-gen-80>", line 2, in crossfadeout
  File "/home/toster/.local/lib64/python3.4/site-packages/moviepy-0.2.2.13-py3.4.egg/moviepy/decorators.py", line 104, in add_mask_if_none
    return f(clip, *a, **k)
  File "/home/toster/.local/lib64/python3.4/site-packages/moviepy-0.2.2.13-py3.4.egg/moviepy/video/compositing/transitions.py", line 29, in crossfadeout
    newclip.mask = clip.mask.fx(fadeout, duration)
  File "/home/toster/.local/lib64/python3.4/site-packages/moviepy-0.2.2.13-py3.4.egg/moviepy/Clip.py", line 215, in fx
    return func(self, *args, **kwargs)
  File "<decorator-gen-78>", line 2, in fadeout
  File "/home/toster/.local/lib64/python3.4/site-packages/moviepy-0.2.2.13-py3.4.egg/moviepy/decorators.py", line 52, in requires_duration
    raise ValueError("Attribute 'duration' not set")
ValueError: Attribute 'duration' not set

@ghost
Copy link

ghost commented Feb 26, 2017

I believe there is an issue where duration is not being set correctly, with clips and masks. I hint at this in PR #435. This maybe an issue that @Zulko will need to look into.

@ghost ghost closed this as completed in #355 Mar 10, 2017
ghost pushed a commit that referenced this issue Mar 10, 2017
This issue was closed.
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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants