question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CompositeVideoClip - Different rules for clip appereance

See original GitHub issue

I have stumbled upon this problem while coding a feature involving clips being sorted in a different manner than the one intended by the CompositeVideoClip.

What i mean by that is that usually while working with any video (outside of Python). You imagine the videos in layers where You would like to have different layers.

At this point every Video is in its own layer based on the index on the list [clip0, transition_clip, clip1], would make it that clip1 is cutting the transition_clip.

I haven’t tested any workarounds. but I suspect that this might be solved by using Two CompositeVideoClips with two lists of clips with different .start_time() parameters.

That would mean using:

transition_clips = CompositeVideoClip([transition_clip, transition_clip, transition_clip])
legit_clips = CompositeVideoClip([clip0, clip1, clip2])

final_composition = CompositeVideoClip([legit_clips, transition_clips])

Which might not be computationally efficient at all as there are 3x nested clips.

Please note that the code shown above is not fully operational. I have ommited .set_start()

Which leads me to thing that this might be solved simply by sorting the lists somehow.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
tburrows13commented, May 3, 2020

Implemented in #1176 😃

0reactions
Kaszanascommented, May 2, 2020

.set_layer(0) Would be the base layer if no layer is set explicitly. Any other layer with higher argument supplied would mean they are on top.

.set_layer(1) Would be rendered on top of the .set_layer(0)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Making video from clips on moviepy only showing last image
using concatenate_videoclips might help. I use the code below and it works just fine. clips = [ImageClip(m).set_duration(1/25) for m in ...
Read more >
Mixing clips — MoviePy 1.0.2 documentation
Two simple ways of putting clips together is to concatenate them (to play them one after the other in a single long clip)...
Read more >
Moviepy Transition Issues With Multiple Compositevideoclips
Two simple ways of putting clips together is to concatenate them to play them one after the other in a single long clip...
Read more >
How to be efficient with MoviePy
So, the rules of thumb are: Call close() on any clip that you construct once you have finished using it and have also...
Read more >
Working With Video Files in Python | by @lee-rowe - Medium
Even if you close a CompositeVideoClip instance, you still need to close the clips it was created from. Otherwise, if you have a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found