View Full Version : (fast ?) Rotation plugin
Reel.Deel
27th June 2020, 19:41
Thanks for the update StainlessS!
Rob105
29th October 2023, 18:49
https://i.postimg.cc/pTxrDM1p/Rot-00.jpg
When overlaying one video over another video background color is very undesirable.
Here is example attached, orange box is a video i am rotating, over teal background, of course i can set a background color to teal as well to have no visible background. But that trick will not work when overlaying video over another video.
Could you please add option to make background transparent as opposed to black or any other color, e.g. adjustable background opacity option?
https://forum.doom9.org/attachment.php?attachmentid=18496&d=1698601922
Reel.Deel
29th October 2023, 19:38
When overlaying one video over another video background color is very undesirable.
Here is example attached, orange box is a video i am rotating, over teal background, of course i can set a background color to teal as well to have no visible background. But that trick will not work when overlaying video over another video.
Could you please add option to make background transparent as opposed to black or any other color, e.g. adjustable background opacity option?
https://forum.doom9.org/attachment.php?attachmentid=18496&d=1698601922
You need to add a fully white mask:
# For RGB
a = ColorBars(width=320, height=240)
b = Version(pixel_type="RGB32").AddAlphaPlane(255).Rotate(33)
c = b.ExtractA()
Overlay(a, b, mask=c)
# For YUV
a = ColorBars(width=320, height=240, pixel_type="YUV420P8")
b = Version(pixel_type="YUV420P8").Rotate(33)
c = BlankClip(b, pixel_type="Y8", colors=[255]).Rotate(33).ColorYUV(levels="TV->PC")
Overlay(a, b, mask=c)
Note that if the mask is fully static, it will be faster to process just one frame.
https://i.ibb.co/mhdgdP5/rotate.png
Rob105
30th October 2023, 19:24
Thanks works great.
Note that if the mask is fully static, it will be faster to process just one frame.
What exactly do you mean by that?
Reel.Deel
30th October 2023, 19:35
Thanks works great.
What exactly do you mean by that?
If angle and endangle are the same it means that the rotation is static (does not change over time). So in that case it will be faster to process just one frame for the mask, like so:
# For YUV
a = ColorBars(width=320, height=240, pixel_type="YUV420P8")
b = Version(pixel_type="YUV420P8").Rotate(33)
c = BlankClip(b, pixel_type="Y8", colors=[255], length=1).Rotate(33).ColorYUV(levels="TV->PC")
Overlay(a, b, mask=c)
For RGB, it would also be done this way.
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.