How to create dynamic subtitles in After Effects?

  Рет қаралды 48,887

South 11

South 11

Күн бұрын

In this video tutorial you will learn how to create dynamic subtitles in After Effects, that you can quickly reuse for any future project.
0:00 - Intro
0:35 - Setting up the comp
1:11 - Creating subtitles text layer
3:04 - Adding a dynamic box behind subtitles
8:21 - Multi line setup
10:55 - Closing statement
Expression on box size:
subText = thisComp.layer("Subtitles");
textWidth = subText.sourceRectAtTime(time).width + paddingX;
textHeight = subText.sourceRectAtTime(time).height + paddingY;
[textWidth, textHeight]
Expression on text anchor:
yPos = thisLayer.sourceRectAtTime(time).height / 2;
[0, yPos]

Пікірлер: 78
@YemiDavis
@YemiDavis Жыл бұрын
This is the best, most straight foreward subtitle tutorial I've come across! Great work!!
@damiengreen5978
@damiengreen5978 2 жыл бұрын
Great tutorial, works so well. before I was resizing boxes manually
@alotenorio
@alotenorio Жыл бұрын
El mejor tutorial que he visto para generar subtítulos en After Effects ^^
@zakiroyhan
@zakiroyhan 2 жыл бұрын
Thank you so much!! it's more saving time using expression comparing to animating manually.
@a.carsandas
@a.carsandas 2 жыл бұрын
took me a while but worth it in the end, this tutorial saves me. Thank you sm ;D
@noyklas8953
@noyklas8953 Жыл бұрын
Thank you! Straight forward end well explained! :)
@rean8899
@rean8899 2 жыл бұрын
Thank you so much sir! I've been finding it for so long.
@heywazup_aep
@heywazup_aep 2 жыл бұрын
Thanks for the tutorial , I'll try this.
@wilpikidwilpikid8970
@wilpikidwilpikid8970 2 жыл бұрын
Thanks man, it helps me a lot
@user-gb2or3wc2o
@user-gb2or3wc2o 11 ай бұрын
thanks a lot, very useful!
@SekiFayt
@SekiFayt Жыл бұрын
Thank you so much. This is exactly what I needed! T^T
@turkmen_hits
@turkmen_hits 2 жыл бұрын
thank you very much broo you really helped))
@eldertauras
@eldertauras 9 ай бұрын
Thank you so much!
@nanding0718
@nanding0718 2 жыл бұрын
Thanks Man!
@nicholasfaithful7708
@nicholasfaithful7708 2 жыл бұрын
WOW dude! For me, this is epic!
@BlizeBrze
@BlizeBrze Жыл бұрын
THANKS YOU YOU SAVE MY HEAVY LIFE , YOU ARE SUPERMAN !!!
@cristelproducciones
@cristelproducciones 2 жыл бұрын
Thanks a lot bro
@SOUTH11_YT
@SOUTH11_YT 2 жыл бұрын
No problem ;)
@tilius.xyz_
@tilius.xyz_ 2 жыл бұрын
Hey, thanks a lot, nice and easy tutorial, tho I'm using it for an animated interface. I have animated text inside a button, which needs a minimum rectangle size. Could you think of a solution?
@noshiAEP
@noshiAEP Жыл бұрын
Very helpful expression! The problem I'm currently facing is that when you move the text and box in the timeline, the timing of the box gets completely messed up for me and the box moves inbetween the text hold keyframes for some reason. I tried precomposing text and the box to move it but that doesnt fix the problem. I don't really know much about expressions but maybe it has to do with the .sourceRectAtTime command? Edit: I just found a workaround to not move the layers themselves, but dragging out the back and pulling in the front and then moving the keyframes to the correct timing. That kinda fixes it.
@MCU_3883
@MCU_3883 3 жыл бұрын
thanks
@SOUTH11_YT
@SOUTH11_YT 3 жыл бұрын
You're welcome!
@deliberatevideo
@deliberatevideo Жыл бұрын
When I tried to follow you exactly typing the expression by hand it didn't work, so I checked the description and copied the one you provided. It worked! Not sure what I was missing in mine!
@deliberatevideo
@deliberatevideo Жыл бұрын
Okay I just tried again. I started with a brand new rectangle, and when it came to the expression I had better luck when I used the autofill suggestions when possible. It seemed to link things together properly. This is my first time doing an expression so I have NO idea what the proper way is. XD
@SrryNoobi
@SrryNoobi Жыл бұрын
@@deliberatevideo could be the capitalization of your text or missing punctuation
@nickdanvers547
@nickdanvers547 2 жыл бұрын
If this isn't working for you, here's something that helped me: Go to your background subtitle box layer, and make sure that every Scale or Size is set to 1920x1080, or 100%
@j6patriotnews986
@j6patriotnews986 2 жыл бұрын
Make sure you delete the stroke or you will have an error
@richochet
@richochet 2 жыл бұрын
Thank you, so well done. Subbed) How do I account for the parts of text that are below the centre like in "g" etc? They seem to make it not quite centred if you see what I mean.
@SOUTH11_YT
@SOUTH11_YT 2 жыл бұрын
Thanks Alex. Yeah that's a little annoying and I only noticed it myself after recording the tutorial. There's a couple of ways to fix it: 1. Use capitalized text. It will make all of your letters the same size. 2. You could turn off that Anchor Point expression and simply adjust your subtitles text position by hand. You'd also have to set a fixed height for Subtitles BG box expression "textHeight = 100;". This approach doesn't work with 2 lines of text. I'm sure there's a way to write an expression that looks at whether the line has any "g" or "l" type of characters that stick out either at the top or bottom, but that's a little too complex for the tutorial I wanted to share. Hope this helps.
@shriefallam8866
@shriefallam8866 9 ай бұрын
What if I want to make a background rectangle to go along with the typewriter effect on words?
@abdelazizmuhammed5340
@abdelazizmuhammed5340 Жыл бұрын
thx fot the tut mate, is there an expression that makes the rectangle follows the text word by word I asked chat gpt for this but I keep getting errors please let me know if that's possible thanks again
@JaiShreeRam_901
@JaiShreeRam_901 Жыл бұрын
Hey, Just in case anyone did not know, Textbox 2 plugin is paid but can save you alot of time with many customizations.
@antonhapunkt4287
@antonhapunkt4287 Жыл бұрын
Great tutorial! So far, the only "problem" I'm facing is that the subtitles-box even shows a little square when the text is empty (includes no letters).. So when you want to have a "break" for a moment with the subtitles you would have to work around it.. (I know it's because of the additional space which is added to the size of the letters/text). I'm sure there is a way through expressions to tell it not to show a box whenever the text remains empty... unfortunately I'm not familiar enough with expressions.
@erikj.petterson639
@erikj.petterson639 Жыл бұрын
I was having the same trouble and i didn't know how to solve it, so i asked it to ChatGPT and i can belive it but it solved that issue, change the code with this: Subtext = thisComp.layer("Subtitles"); textContent = Subtext.text.sourceText; if (textContent == " ") { [0,0] } else { TextWidth = Subtext.sourceRectAtTime(time).width+80; TextHeight = Subtext.sourceRectAtTime(time).height+30; [TextWidth, TextHeight] } Have the consideration that ( " " ) represent a space and not empty, because when i didn't have text what i did was create a space to create a keyframe. I hope it solve your problem too!
@SOUTH11_YT
@SOUTH11_YT Жыл бұрын
Lol no way GPTChat gave you that answer :)) You can make it even a little simpler. Add these 3 lines to your "Subtitles Box" layer opacity property: subs = thisComp.layer("Subtitles").text.sourceText; if (subs == "") 0 else 70 it checks the text value on your Subtitles layer and if its empty, sets box opacity to 0.
@tasnimfarah6139
@tasnimfarah6139 3 ай бұрын
@petrvorasicky3073
@petrvorasicky3073 2 ай бұрын
When I move subtitles on the timeline or copy and paste to another composition, background rectangle doesnt work properly :(
@lukaszlatkovsky4838
@lukaszlatkovsky4838 Жыл бұрын
Hey thank you for tutorial. What if I want pauses between text? I tried make more boxes with subtitles but it doesnt work.
@flyerbeyer
@flyerbeyer Жыл бұрын
Late to the Party - but: Just ad keyframes with no text or a blank space in the textelement. You will have a small backround-box with the dimensions of your padding in the pauses. to get rid of them automatically i just use an expression to set opacity of the box-Layer to the Width of the text. It's not sophisticated but worked for me (subText = thisComp.layer("Subtitles"); transform.opacity = subText.sourceRectAtTime(time).width; )
@rodrigobravo318
@rodrigobravo318 4 ай бұрын
how do i do if i don't want the box height to change? i only want the width to change.
@margueriteoosthuizen6006
@margueriteoosthuizen6006 Жыл бұрын
I do exactly what the tutorial says and copy the expressions but I keep getting errors :/
@__hushm3
@__hushm3 Жыл бұрын
Same here
@Eindrew9
@Eindrew9 2 жыл бұрын
hey! nice tutorial, but when I copy the layers to a different comp or duplicate them or whatever, it does not work anymore? why is that?
@SOUTH11_YT
@SOUTH11_YT 2 жыл бұрын
Hi Eindrew9 its strange you say it doesn't work when you copy it to a new comp. I've tested it a couple of ways here and I can't see to find a way to break it. Could you send me your file to support@southeleven.com so I can take a look? When duplicating the two layers you have to update the first expression line on "Background Box 2" layer's "size" parameter. Change it from "subText = thisComp.layer("Subtitles Text");" to "subText = thisComp.layer("Subtitles Text 2");".
@allfatihah
@allfatihah 2 жыл бұрын
How if align right?
@user-py5uq6rq2d
@user-py5uq6rq2d 10 ай бұрын
I can't get it to work. The first line returns "object of type layer found where a property is needed" - don't really see, why a layer can't be assignable to a variable...
@kelvinkinyanjui2364
@kelvinkinyanjui2364 Жыл бұрын
I'm stuck.. what did you just type on the first expression after typing sub Text min 5:39?
@SOUTH11_YT
@SOUTH11_YT Жыл бұрын
You should enter one of the expressions from video description.
@dwifebrianto9738
@dwifebrianto9738 2 жыл бұрын
It's working for 1 line subtitle, Thanks! How about if we use 2 line subtitle?
@SOUTH11_YT
@SOUTH11_YT 2 жыл бұрын
Hi Dwi, yes that should work too. See at 8:21s mark where I show how to use it with multiple lines.
@janetisnow
@janetisnow 9 ай бұрын
​@SOUTH11_YT Hey, thanks for your tutorial! Do you know of any additonal code if I want the box to look more accurate for 2 lines with different width? E.g. Top line is shorter than the bottom line, ideally would want the box above to be shorter than the one at the bottom (rather than just a rectangular box)? I am ok if there is no additional leading from line 1 to line 2 excluding the box! lmao not sure if you know what I'm talking about.
@adhamayman6142
@adhamayman6142 2 жыл бұрын
how to make the rectangle change with words
@SOUTH11_YT
@SOUTH11_YT 2 жыл бұрын
You need add those two expressions found in the description.
@syafiqyshr1
@syafiqyshr1 2 жыл бұрын
Can i ask you ? What symbol u use “ Subtext (?) ?
@SOUTH11_YT
@SOUTH11_YT 2 жыл бұрын
Hi Muhd, I'm not sure I follow your question... Take a look at video description where I've added the expressions used in this demo.
@syafiqyshr1
@syafiqyshr1 2 жыл бұрын
@@SOUTH11_YT Ok great thank u .
@connorwarden1557
@connorwarden1557 Жыл бұрын
subText = thisComp.layer("Subtitles"); textWidth = subText.sourceRectAtTime(time),width + 100; textHeight = subText.sourceRecAtTime(time),height + 40; [textWidth, textHeight] I'm getting an error with this, can anyone see what the issue is? Thanks
@SOUTH11_YT
@SOUTH11_YT Жыл бұрын
What’s the error saying? Is your subtitles text layer called “Subtitles”? Does the expression work if you just copy and paste it exactly as in description?
@connorwarden1557
@connorwarden1557 Жыл бұрын
@@SOUTH11_YT Hey I've got it all going now, only issue is when the text goes to two lines instead of one, the box is offset?
@SOUTH11_YT
@SOUTH11_YT Жыл бұрын
@@connorwarden1557 Glad to hear that. What was the problem? Could it be that you added a text box (you add it by clicking and dragging out a box using a text tool) instead of typing your text? There's no expressions on your text layer to affect how the text is displayed so I'm not sure why it would do that.
@abuabu7041
@abuabu7041 Жыл бұрын
@@SOUTH11_YT respect for replying to comments and helping 1.5 years later, nice video btw!
@jayeshkaslikar8463
@jayeshkaslikar8463 Жыл бұрын
dose it works in crack version
@SOUTH11_YT
@SOUTH11_YT Жыл бұрын
Crack version of what?
@StorytellerDan
@StorytellerDan Жыл бұрын
Remember to tell people to make sure they´ve got their text ´CENTRE ALIGNED´ before they try this.
@dhruvchavan5336
@dhruvchavan5336 10 ай бұрын
bruv..it's not staying center alligned for a new subtitle keyframe what to do :(
@27shearer
@27shearer 2 жыл бұрын
My subtitles box is changing shape a fraction of a second before the text why is that?
@kevinli7941
@kevinli7941 2 жыл бұрын
same problem
@27shearer
@27shearer 2 жыл бұрын
It seems to work fine on a blank comp as in the video but as soon as it's placed on top of a footage file it fails?
@kevinli7941
@kevinli7941 2 жыл бұрын
@@27shearer good shout, i can troubleshoot it by creating another precomp for it but still it's off, but i can manual sort it.
@SOUTH11_YT
@SOUTH11_YT 2 жыл бұрын
Hmm weird - I can't seem to be able to reproduce this. But one thing that comes to mind is that your video comp might have a different framerate to the comp where you created your subtitles. If you paste the two layers into your video comp, text layer will have the keyframes set in between the frames and no exactly on them. You could try to shift them to exact frames manually and see if that fixes is?
@mybengal
@mybengal 2 жыл бұрын
there are errors in my case
@SOUTH11_YT
@SOUTH11_YT 2 жыл бұрын
What errors are you getting?
@sounder7564
@sounder7564 2 жыл бұрын
sorry not working
@SOUTH11_YT
@SOUTH11_YT 2 жыл бұрын
What wasn’t working?
@sounder7564
@sounder7564 2 жыл бұрын
@@SOUTH11_YT that code in description. i wrote code in video after that works. wrong code in description.
@mehdiheidari4958
@mehdiheidari4958 2 жыл бұрын
Great tutorial, I have a question I have this code for a subtitle text box : text=thisComp.layer(""); width=tex.sourceRectAtTime(time-tex.inPoint,true).width+45; myFade = 12; if ( marker.numKeys > 0){ m = marker.nearestKey(time); t = m.time; d=linear(width,0,1400,45,1400); if (t
@SOUTH11_YT
@SOUTH11_YT 2 жыл бұрын
I'd probably approach it using an array and do it something like this: // Vars subs = thisComp.layer("Subtitles").text.sourceText; subsText = thisComp.layer("Subtitles"); keyArray = []; //Create an array with all keyframe times for (i = 1; i < subs.numKeys+1; i++) { keyArray.push(subs.key(i).time); } //Transition for (i = 0; i < subs.numKeys-1; i++) { if (time>keyArray[i]) { transitionTime = keyArray[i+1] keyCur = keyArray[i] keyNext = keyArray[i+1]; } } //Set box width textWidthCur = subsText.sourceRectAtTime(keyCur).width + 100; textWidthNext = subsText.sourceRectAtTime(keyNext).width + 100; //Output textWidth = ease(time, transitionTime-0.2, transitionTime, textWidthCur, textWidthNext); textHeight = subsText.sourceRectAtTime(time).height + 40; [textWidth, textHeight] --------------------------------------------------------------------------------- You'd have to clean it up a little bit but if you paste it into your "Subtitles Box" layer, it will work. Not sure how you'd approach the text to create a smooth transition but please do share the finished project as I'd like to see how it turns out. All the best,
@mehdiheidari4958
@mehdiheidari4958 2 жыл бұрын
@@SOUTH11_YT Thanks man Yeah sure, i will share it with you when it is finished.
Llegó al techo 😱
00:37
Juan De Dios Pantoja
Рет қаралды 51 МЛН
Эффект Карбонаро и нестандартная коробка
01:00
История одного вокалиста
Рет қаралды 9 МЛН
Despicable Me Fart Blaster
00:51
_vector_
Рет қаралды 26 МЛН
Create SUBTITLES in After Effects with this HACK! - Adobe Tutorial
13:25
7 Minute AE Tutorials
Рет қаралды 39 М.
How to edit SO good your viewers get addicted to your videos
14:32
Learn By Leo
Рет қаралды 1,2 МЛН
Animated Subtitle Tutorial (For Memes and Everything Else)
15:09
Learn How To Edit Stuff
Рет қаралды 84 М.
Auto-resizing Text Box With No Expressions! - Adobe After Effects Tutorial
10:19
5 Tips I Wish I Knew Before I Started Motion Design
4:18
Nowack Design
Рет қаралды 539 М.
Top 20 Free After Effects Plugins You Need in 2022
6:27
Ben Marriott
Рет қаралды 691 М.
10 Quick After Effects Techniques I LOVE
8:01
Ben Marriott
Рет қаралды 658 М.
Free AI Audio Tools You Won't Believe Exist
17:22
Mike Russell
Рет қаралды 501 М.
How to Trim and Cut Video Premiere Pro
7:44
Javier Mercedes
Рет қаралды 771 М.
4 Super Easy Ways To TRANSFORM Your After Effects Projects
4:49
Motion By Scott
Рет қаралды 466 М.
Заботьтесь о любимых❤️🫶🏾 инст:sarkison7
0:58
SARKISONCHIK.OFFICIAL
Рет қаралды 6 МЛН
My Hero Brother‼️ How to Survive Swimming Pool😎 Like a Boss💕❤️😘 | JJaiPan #Shorts
0:49
路飞太过分了,自己游泳。#海贼王#路飞
0:28
路飞与唐舞桐
Рет қаралды 8 МЛН
When Brother Refuses to Listen #shorts #funny #fypシ゚viral
0:19
Javi’s Family Adventures
Рет қаралды 21 МЛН
When Brother Refuses to Listen #shorts #funny #fypシ゚viral
0:19
Javi’s Family Adventures
Рет қаралды 21 МЛН
#kidsong
0:11
J House jr.
Рет қаралды 31 МЛН