-
Notifications
You must be signed in to change notification settings - Fork 22
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
transition animation #25
Comments
Thank you for your interest. The simplest method is to overlay two layers, similar to how it's done in Premiere or After Effects, and then add animation related to opacity. For example, let's say we are creating a video that totals 7 seconds, combining a 3-second clip and a 5-second clip with a 1-second fade period. In this case, you would apply the animation as follows. import movis as mv
w, h = 640, 480
img1 = mv.layer.Rectangle(size=(w, h), color='pink', duration=3.0)
img2 = mv.layer.Rectangle(size=(w, h), color='turquoise', duration=5.0)
scene = mv.layer.Composition(size=(w, h), duration=7.0)
scene.add_layer(img1, name='video1')
scene.add_layer(img2, name='video2', offset=2.0)
scene['video2'].opacity.enable_motion().extend(
keyframes=[0.0, 1.0],
values=[0.0, 1.0],
) If you are using an IPython notebook, you can easily check the results with However, for simple fade processing, it would be better for me to implement a shortcut function like |
Great, thank you very much, hope to add more preset special effects. |
感谢您的建议。我们正在考虑如何在当前的界面中添加这些典型的效果,但无论如何,我们都认为这是一个非常重要的问题。如果您有其他任何要求,请随时告诉我们。 Thank you for your suggestion. We are considering how to add such typical effects in the current interface, but in any case, we think it is a very important issue. If you have any other requests, please feel free to let us know. |
Conveniently adding filters to videos and adding transition effects when splicing multiple video segments are extremely useful for video editing. |
我目前正在创建一些快捷函数,以便简单地实现淡入和淡出效果。我认为这些函数可能会直观易用,但如果您有任何不明白的地方,请告诉我。 I am currently creating a set of shortcut functions to easily implement fade-in and fade-out effects. I believe these functions will likely be intuitive to use, but if there is anything unclear, please let me know. |
scene1 = mv.layer.Image.from_color(size=(640, 480), color='pink', duration=5.0) |
layer = mv.layer.Video(r'D:\video\2\07.mp4') If there are more clips to trim, is there a simpler way to add fade-ins and fade-outs, And the speed is very slow |
In that case, these codes can be simplified as follows: layer = mv.layer.Video('input.mp4')
scene = mv.trim(layer, start_times=[10, 50], end_times=[13, 53])
scene = mv.fade_in_out(scene, 1.0, 1.0)
scene.write_video('output.mp4')
I need to investigate what is causing the slowness. If the same level of slowness occurs even when outputting with the following type of code, then it is an issue with ffmpeg. If not, then it is a problem on the composition side. I don't often do operations that create many compositions, so there may be an issue there. layer = mv.layer.Video('input.mp4')
scene = mv.layer.Composition(size=layer.size, duration=layer.duration)
scene.add_layer(layer)
scene.write_video('output.mp4') |
|
Thank you. I have partially understood the situation. The reason why we're currently getting 6.24 iter/sec instead of the expected 14.73 iter/sec is likely due to the processing of If possible, could you please confirm this? (If not, for instance, if |
|
I see. Currently I am considering to replace movis.ops functions with ones without compositions (#43).
I do think that there is some slow cause in the composition caching mechanism, but since such a situation where it becomes 1/3 slower does not occur in my environment, it may take some time to reproduce the issue. |
No problem, thank you very much. |
#43 I have experimentally attempted to speed up using layers with mv.concatenate and mv.trim. Could you test from the master branch to see if it speeds up? |
|
Hi, I'm trying to do a simple transition of a 2nd clip sliding in from the side, so far my code is per below. The issue is the second clip slides in between keyframes 5 and 6 but then it dissapears. What am I doing wrong? Is there a better way to do this? Thanks. import os w, h = 1080, 1920 scene = mv.layer.Composition(size=(w, h), duration=12.0) scene.add_layer(mv.layer.Video("/home/deep/movis/browndog.mp4"), scale=1, name="browndog") initial_position = np.array([-w, 0]) scene['jackdog'].position.enable_motion().extend( |
I followed the bunny example on the google colab notebook so have kind of got it to work now however is there a way to add motion blur to the slide in/out? |
Hi, At first glance, there does not seem to be anything odd in the code. I will now try to reproduce it with a simple code. |
Thank you! Motion blur would be great for quick transitions 🙂 |
How to add transition animations, such as fading in and out, when video stitching
The text was updated successfully, but these errors were encountered: