antiboredom / vidpy

video editing and compositing with python and melt
https://antiboredom.github.io/vidpy
GNU General Public License v3.0
132 stars 19 forks source link

Center video on a square Composition #9

Open tomasdms opened 5 years ago

tomasdms commented 5 years ago

Hi, I been enjoying playing around with this library. I been trying to center (vertically) a regular 1920x1080 video on a square Composition (500x500)

I notice that the video scales correctly to the 500 width but whenever I try to move it down to center it it gets cropped at the bottom.

Am I implementing this incorrectly or is it a limitation of the library.

subclip = Clip('video.mp4').position(0, 0, '100%', '100%')
comp = Composition([subclip], width=500, height=500)
comp.preview()

I also notice that once i add a .position() there is a spacing at the top even when my Y value is 0.

Thanks again for clarifying.

antiboredom commented 5 years ago

Hi - glad you're liking it! There are definitely some issues with how I'm doing positioning and scaling. I will take a look on my end.

tomasdms commented 5 years ago

Great thanks, I have no problem implementing something similar with MoviePy but the text there uses ImageMagik and I feel that your use of MLT text filter is much cleaner and robust. On Mon, 4 Mar 2019 at 19:13, Sam Lavigne notifications@github.com wrote:

Hi - glad you're liking it! There are definitely some issues with how I'm doing positioning and scaling. I will take a look on my end.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/antiboredom/vidpy/issues/9#issuecomment-469519437, or mute the thread https://github.com/notifications/unsubscribe-auth/ASWkUDqfTl0YMGnOz4w_S2__No7gdIByks5vTeDHgaJpZM4bdpKI .

-- Tomás De Matteis tomasdms@gmail.com / +34 635 66 36 89 Fusion Films: www.fusionfilms.es Photography: www.tomasdms.com @tomasdms

Mobile signature

kyb3r commented 4 years ago

Having a similar problem with positioning.

After using a 1280x200px image as a clip and putting it in a composition and trying to change the position of the clip, the clip gets partially cropped out.

clip = Clip('image.png')
clip.position(x=0, y=100)

comp = Composition([clip], width=1280, height=720)
comp.preview()

Is there any way that I can help fix this issue?

kyb3r commented 4 years ago

There are many reasons why I would prefer using melt over moviepy, including multicore rendering support, stability - moviepy uses a tonne of ram if you are using many clips, the ability to serialize videos into XML, etc. I would gladly pay to get a stable version of this library!

antiboredom commented 4 years ago

@kyb3r any contributions would be welcome! I've neglected this library for a while but interested in getting back into it...

kyb3r commented 4 years ago

@antiboredom I made some changes on my fork that seemed to fix the issue with images, but I'm not sure if its the best way to fix it. I'm still new to the MLT Framework and would appreciate some pointers so I can do it right. I'm down to contribute to the library and turn it into something amazing. Lemme know if you wanna create a discord server or something where we can discuss the development, I feel like a realtime chat would make it easier to communicate.

antiboredom commented 4 years ago

@kyb3r I set up a discord server here: https://discord.gg/d68FKU6

fortunto2 commented 4 years ago

Hi, interesting project. I would like it to develop. I used earlier MLT and then Moviepy (there are memory problems). Now I'm looking for another solution. I wonder maybe yours VidPy. I also looked at https://github.com/PixarAnimationStudios/OpenTimelineO It is universal and more convenient than XML and can be compatible with KDENLIVE (MLT)

I like the number of effects in MLT and I would like to connect the OpenTimeline