Reputation: 1967
I'm trying to add hardcoded text or subtitles to a video. I've used .ass file to easily add subtitles with custom background color, font color, font size and placement and fade animation.
But now I want to add slide animation to the text. Also, note that if this is not possible in .ass (Advanced Substation Alpha) how would one go about trying to add this using DrawText?
Also not sure how I can split the text into multiple lines. (Wouldn't this involve knowing the size of the text and splitting)
Upvotes: 0
Views: 2459
Reputation: 777
About slide animation using ffmpeg drawtext, here is my command . And it work for me
command = "-i $inputVideoPath -vf \"drawtext=fontfile=$fontPath:text='slide animation':fontcolor=white:fontsize=24:x='if(lt(t-0.5\\,0)\\,-text_w + ((w-text_w)/2 -(-text_w))*t/0.5\\,(w-text_w)/2)':y=(h-text_h)-10:enable='between(t,0,3)'\" -c:v libx264 -codec:a copy -b:v 5000k -pix_fmt yuv420p -movflags +faststart $outputPath"
Hope this can help someone else.
Upvotes: 0
Reputation: 1967
Turns out most videos like these are generally created using a combination of HTML5 canvas animation so they can easily be previewed to the user without any server processing. And once the video needs to be rendered a similar setup in the server with headless chrome is used to record a video.
Upvotes: 3