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

Supersample Concatenated Clip #631

Open
timpauli opened this issue Aug 11, 2017 · 1 comment · May be fixed by #634 or #1910
Open

Supersample Concatenated Clip #631

timpauli opened this issue Aug 11, 2017 · 1 comment · May be fixed by #634 or #1910
Labels
bug Issues that report (apparent) bugs. fx Related to advanced effects applied via clip.fx(), or effects in general. video Related to VideoClip and related classes, or handling of video in general.

Comments

@timpauli
Copy link

If you supersample a concatenated Clip you get the following error:

File "/usr/local/lib/python3.5/dist-packages/moviepy/video/fx/supersample.py", line 12, in supersample
return clip.fl(fl)
File "/usr/local/lib/python3.5/dist-packages/moviepy/Clip.py", line 136, in fl
newclip = self.set_make_frame(lambda t: fun(self.get_frame, t))
File "", line 2, in set_make_frame
File "/usr/local/lib/python3.5/dist-packages/moviepy/decorators.py", line 14, in outplace
f(newclip, a, **k)
File "/usr/local/lib/python3.5/dist-packages/moviepy/video/VideoClip.py", line 694, in set_make_frame
self.size = self.get_frame(0).shape[:2][::-1]
File "", line 2, in get_frame
File "/usr/local/lib/python3.5/dist-packages/moviepy/decorators.py", line 89, in wrapper
return f(new_a, **new_kw)
File "/usr/local/lib/python3.5/dist-packages/moviepy/Clip.py", line 95, in get_frame
return self.make_frame(t)
File "/usr/local/lib/python3.5/dist-packages/moviepy/Clip.py", line 136, in
newclip = self.set_make_frame(lambda t: fun(self.get_frame, t))
File "/usr/local/lib/python3.5/dist-packages/moviepy/video/fx/supersample.py", line 9, in fl
avg = np.mean(1.0
np.array([gf(t_) for t_ in tt], dtype='uint16'), axis=0)
File "/usr/local/lib/python3.5/dist-packages/moviepy/video/fx/supersample.py", line 9, in
avg = np.mean(1.0
np.array([gf(t_) for t_ in tt], dtype='uint16'), axis=0)
File "", line 2, in get_frame
File "/usr/local/lib/python3.5/dist-packages/moviepy/decorators.py", line 89, in wrapper
return f(*new_a, **new_kw)
File "/usr/local/lib/python3.5/dist-packages/moviepy/Clip.py", line 95, in get_frame
return self.make_frame(t)
File "/usr/local/lib/python3.5/dist-packages/moviepy/video/compositing/concatenate.py", line 82, in make_frame
i = max([i for i, e in enumerate(tt) if e <= t])
ValueError: max() arg is an empty sequence

Example code:

from moviepy.editor import concatenate_videoclips
from moviepy.video.fx.all import supersample

def supersample_error(inputclip):
    return supersample(concatenate_videoclips([inputclip, inputclip]), 1, 1)
@timpauli
Copy link
Author

Found out that it crashes because supersample() puts negative times into the make_frame()-method.

timpauli added a commit to timpauli/moviepy that referenced this issue Aug 18, 2017
@timpauli timpauli linked a pull request Aug 24, 2017 that will close this issue
@keikoro keikoro added bug Issues that report (apparent) bugs. bug-fix For PRs and issues solving bugs. labels Nov 25, 2017
@keikoro keikoro linked a pull request Jan 13, 2022 that will close this issue
@keikoro keikoro added fx Related to advanced effects applied via clip.fx(), or effects in general. video Related to VideoClip and related classes, or handling of video in general. and removed bug-fix For PRs and issues solving bugs. labels Jan 14, 2022
koutoftimer added a commit to koutoftimer/moviepy that referenced this issue Feb 3, 2023
koutoftimer added a commit to koutoftimer/moviepy that referenced this issue Feb 3, 2023
@koutoftimer koutoftimer linked a pull request Feb 3, 2023 that will close this issue
4 tasks
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. fx Related to advanced effects applied via clip.fx(), or effects in general. video Related to VideoClip and related classes, or handling of video in general.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants