You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This kind of relates to MoviePy as well, but I'm pretty sure the issue lies with Gizeh somehow. After spending a lot of time trying things out I've resorted to this.
I've got a MoviePy script which superimposes text on a pre existing video clip whilst animating the text to increase in size. I think I've posted all the relevant code, but let me know if anything else would help.
And e is an object like: { "text": "Hello", "font": "Courier", "fontSize": 100, "fontColor": "white", "start": 0.01, "end": 1.3, "x": 960, "y": 540, }
This all works very smoothly locally, however when I deploy (to Ubuntu 14.04 on AWS), the final product is jumpy, the text isn't as crisp and the animation isn't very smooth. Have you got any suggestions as to why that would be the case? I have checked everything I can think of, and the size and time variables are exactly the same for both versions for each frame, so essentially exactly the same thing is happening, just for some reason the local one produces a far smooth animation.
To my eye it appears that in some frames the text grows more than in others, however when I increased the sizeGrow it became clear the font size was increasing in every frame.
Any help would be really appreciated, it's driving me crazy!
Thanks!
The text was updated successfully, but these errors were encountered:
@zamirkhan Hey!
The short answer is no, I never managed to get it to work perfectly smoothly. I tried a whole range of ways of calculating the size of text for each frame, but it was never possible to recreate the local performance.
I haven't played with it for a couple of years, but I wonder if a docker container might offer a solution to this now.
Hi!
This kind of relates to MoviePy as well, but I'm pretty sure the issue lies with Gizeh somehow. After spending a lot of time trying things out I've resorted to this.
I've got a MoviePy script which superimposes text on a pre existing video clip whilst animating the text to increase in size. I think I've posted all the relevant code, but let me know if anything else would help.
text_mask = mpy.VideoClip(make_frame=self.make_frame_text, duration=duration).to_mask()
text_mask.write_videofile(maskfilename, fps=25)
def make_frame_text(self, t):
e = self.current_element
if e.x == "center":
e.x = self.w/2
e.y = self.h/2
duration = e.end - e.start
sizeGrow = e.fontSize*0.2
sizeStart = e.fontSize-sizeGrow
currFrame = (t*100)/4
frameGrow = sizeGrow/(duration*25)
fsize = sizeStart + (currFrame * frameGrow)
bom = gizeh.text(e.text, fontfamily=e.font, fontsize=fsize,fill=(255,255,255), xy=(e.x,e.y))
surface = gizeh.Surface(self.w,self.h) # width, height
bom.draw(surface)
return surface.get_npimage() # returns a 8-bit RGB array
And e is an object like:
{ "text": "Hello", "font": "Courier", "fontSize": 100, "fontColor": "white", "start": 0.01, "end": 1.3, "x": 960, "y": 540, }
This all works very smoothly locally, however when I deploy (to Ubuntu 14.04 on AWS), the final product is jumpy, the text isn't as crisp and the animation isn't very smooth. Have you got any suggestions as to why that would be the case? I have checked everything I can think of, and the size and time variables are exactly the same for both versions for each frame, so essentially exactly the same thing is happening, just for some reason the local one produces a far smooth animation.
To my eye it appears that in some frames the text grows more than in others, however when I increased the sizeGrow it became clear the font size was increasing in every frame.
Any help would be really appreciated, it's driving me crazy!
Thanks!
The text was updated successfully, but these errors were encountered: