How To Do A Screen Replacement In After Effects - After Effects Screen Replacement Tutorial - YouTube

Channel: Motion Array Tutorials

[1]
Oh, hi there! Jordan with Motion Array.
[3]
And looks like you’ve just caught me browsing motionarray.com
[7]
While also looking at images of my adorable cat, and video chatting with my wife.
[13]
Stop Calling Me!
[14]
If you call me again, i'll call the police!
[16]
Haha, it’s actually not a touchscreen. And I’m pretty sure you realized that
[22]
wasn't me actually cycling through those images.
[24]
It was all added in post production.
[26]
There’s a lot of different reasons why you'd need to replace a screen in After Effects.
[30]
Maybe, you don't have the graphics ready ahead of time, or maybe you're on set
[35]
and you just can’t get the screen to look right.
[37]
Or maybe getting the timing down perfectly is just too complicated.
[40]
Whatever your reason, we're going to show you how to do an After Effects Screen Replacement
[44]
And we're gonna start with a screen that's not moving, and then
[47]
move onto a screen where you’re going to need to track it all in post.
[49]
But let's jump right into this effect!
[53]
So here we are inside of After Effects, and the first thing that we’re going to do bring
[57]
in the footage that we want to work with.
[59]
Our example here is a shot from Motion Array’s Library and you can find the link in the description
[63]
below.
[64]
It’s a person with their tablet on a table and they’re swiping through some imaginary
[68]
images.
[71]
Step one is simple, take your footage and trim it down to only what you’re going to
[74]
be using.
[75]
We’re going to be adding some effects that will make After Effects work pretty hard,
[79]
so the less unnecessary frames you have to render the better.
[83]
If you’re not sure if your decision on how much footage you’ll use will work, just
[87]
use the B and N keys to set in and out points and work with that.
[92]
So for us our footage looks like this.
[97]
Now what we’re going to do is create a solid that will double as the screen so that we
[101]
can line everything up nicely to start with.
[104]
Create a new composition by going to composition, new, composition.
[109]
This will act as the screen of the tablet.
[111]
I went ahead and looked up the dimensions of the tablet used in the shot, but really
[115]
even just an approximation will do if you’re not 100% sure.
[118]
So i found that the dimensions are 1024x768.
[123]
But it’s vertical so it’s actually 768x1024.
[128]
You might also have to uncheck the lock aspect ratio to make this work.
[132]
Name it so that you’ll remember it’s the screen composition and Hit okay.
[137]
Cool, now this is what will appear in your screen.
[140]
Now we’re going to add a solid that will contrast the green easily.
[146]
So i’m going to click the swatch here and choose red.
[151]
Go back to your main composition and now let’s drag your screen composition into your main
[157]
project.
[160]
Next we’re going to line up this screen composition so that it matches the actual
[164]
screen of the tablet. we need to add a Corner Pin effect.
[168]
Go to your effects panel and search for it, and then drag and drop it onto your composition
[173]
layer.
[174]
When it’s highlighted, you should be able to see dots on the corners of your layer.
[178]
If not, make sure layer controls are checked by going to view > show layer controls.
[185]
Drag Corners really rough at first and then when it’s closer do a really fine tune job.
[193]
And it’ll help to drop the opacity of your screen composition so that you can see both
[197]
at the same time.
[200]
Get as close as you can, then i’d suggest to scale up ever so slightly so that it’s
[205]
just a tad larger than the actual screen.
[207]
A little too big is better than too small.
[215]
Bring opacity back up and then this is what you have.
[217]
Great.
[218]
Now go into your composition for your screen and this is where you decide what’s actually
[223]
actually going to be on your screen.
[225]
For me its a picture of a dog.
[228]
Drag it in above your solid layer, and resize it to fit your composition.
[233]
Whatever you see here is what you're actually going to see on the screen.
[239]
Then just hide your solid layer instead of deleting it
[242]
instead of deleting it in case you need to re-adjust things later.
[246]
You can also add video if you’d like, and it’ll work the same.
[250]
But for simplicity and because our example is portrait I’ll work with this still image
[254]
for now.
[256]
But when we go forward here we can see we have a problem.
[259]
Our finger goes beneath the picture of the dog.
[262]
So there’s two main methods to fix this.
[266]
One is you can keep the photo on top and rotoscope the finger to out of each frame individually.
[271]
That’s not the method we’re using, but if you want a quick touch up on rotoscoping,
[277]
check out this video we did here, and the link is in the description below.
[281]
If you use that method, you can join back in once you finish rotoscoping, but for us
[287]
in this example, what we’re going to do is take advantage of the fact that the tablet
[290]
has a green screen, and we’re literally going to work with it as if it was a green
[294]
screen.
[295]
So drop the screen comp below your footage and now let’s search for the keylight effect.
[311]
And actually in just one click you can see that it does not too bad of a job.
[319]
But there’s a couple problems we need to address.
[321]
First, our green didn’t entirely key out as there were some strange glare and banding
[326]
from left over.
[328]
And then there’s also some blur on the finger as it moves through the image.
[332]
So let’s take care of both of those.
[335]
Go to the view and set it to screen matte.
[338]
Now you should see a black and white representation.
[341]
Black is transparent and white is opaque.
[344]
You want to focus on the screen for now and make the screen completely black as possible.
[349]
So go down to the screen matte options and move the clip black slider until its completely
[354]
black and no banding.
[358]
Cool.
[360]
Now take the whites down until it becomes a lot better too here outside the screen.
[367]
In this case you don’t have to worry about the outside too too much because we’re going
[370]
to be isolating the screen in a second.
[373]
But in other cases it’s good to get everything as black and white as possible.
[378]
Great.
[379]
Now let’s go to final result and we can see that it’s looking better, but it’s
[385]
still not amazing here with the finger.
[387]
There’s some discoloration when it gets blurry moving from right to left.
[394]
So let’s go into another view mode.
[396]
Status.
[397]
And here we can see that we actually didn’t get all the screen completely keyed out.
[402]
So let’s keep raising the blacks and get our screen completely black.
[408]
Then we can notice that our finger has a grey fringe around it when it’s wiping across.
[414]
This is that motion blur that makes it really tough to distinguish for keylight.
[419]
So we’re going to keep playing with the clip black and clip white until we get it
[423]
to a place where we reduce the grey around the finger but we don’t take away the actual
[428]
realistic blur.
[429]
It’s a happy medium and it’s going to take a little trial and error, but if you’re
[433]
looking at my clip as a reference, I found that clip black of 64 and clip white of 92
[438]
work really nicely.
[439]
Great!
[440]
And lastly what I’m going to suggest is to take your locked despill bias and alpha
[442]
bias and select a color that’s in the actual image you’re projecting onto the screen.
[443]
And this is our final result.
[444]
It’s really looking great!
[445]
But there’s one other thing that it looks like we missed.
[448]
In taking away the green from our screen, we also took it out of the plant here and
[452]
the pens.
[454]
So how to we isolate this to the screen only?
[457]
Let’s make a mask by highlighting the actual footage layer, and hitting q to bring up our
[461]
rectangle tool.
[463]
Then click and drag over the screen.
[465]
It doesn’t have to be perfect.
[467]
Just so that it captures all of the screen and excludes the other green elements.
[472]
Now go down to your mask in your layer and set it to none.
[476]
So now we’ve created a mask that’s not active, But we can tell only keylight to use
[481]
it by going to inside mask, choosing our mask 1, and then hitting invert.
[487]
Now our green outside of the mask is returned and we still key out our image!
[492]
And guys this is our effect!
[499]
But let’s take it just one quick step further by animating our picture off screen.
[504]
Go to the first point of contact that the finger makes here.
[507]
Now dive into your screen comp.
[509]
Your playhead should be at the same place as in your previous composition.
[516]
So set a keyframe for position then go back.
[519]
Now move forwards to the place where you want your image to be fully off screen.
[524]
And dive back into your screen comp and keyframe your image offscreen.
[530]
Nice
[531]
Now let’s see what it looks like.
[533]
Set a beginning and end point with B and N respectively to watch your footage on a loop.
[540]
It’s a start, but we need to make it more realistic.
[544]
Let’s go back to our keyframes and highlight them and add an easy ease.
[552]
It’s getting better.
[555]
And if you really wanted to finess it, you can higfhlight your keyframes, and open up
[559]
the graph editor.
[561]
From here you can tweak your motion to perfection.
[564]
But let’s add the finishing touch by going to our motion blur option and selecting it,
[570]
then enabling it for that image layer in specific.
[574]
And if we place in another image for realism, like that person is scrolling through images,
[579]
this is what we get.
[584]
And this is what we get for our final result.
[587]
But if you study this image in depth, you can pick out that it’s a little too perfect
[592]
to be projected from a screen being recorded.
[594]
In a pinch, this will be good enough, but let me show you two more things that will
[598]
really help to sell the effect.
[600]
First, add a realistic blur by searching for camera lens blur.
[605]
Add it to your footage, and blur your footage out really really subtly.
[610]
Like only 1-2 pixels of blur.
[614]
If you don’t do this, its assuming that your screen was in perfect focus on an amazingly
[620]
expensive lens.
[622]
The second piece might also not be as intuitive.
[624]
Go to your comp for your screen and add a white solid on top.
[635]
Then set a mask for the solid that’s going to represent some fake screen glare from an
[639]
off camera light source, cutting across only part of the screen.
[647]
Now add a subtle feather to it and drop the opacity down really low, like below 25%.
[658]
Do some minor touch ups to what you think would make it look realistic
[666]
And now when we take a look at the final image we can see that there’s a little more of
[670]
a realistic look to our screen.
[672]
It’s subtle but it makes the whole thing feel a little bit more reel.
[677]
And guys that’s how your replace a screen that’s not moving.
[681]
But what if your screen is moving.
[683]
Let’s dive into a second example to check that out.
[687]
Okay so here we have a woman who’s on her phone and it’s moving around in her hand.
[692]
To actually make any sort of screen replacement work, we need to track the movement of the
[696]
screen exactly.
[698]
Now, if you can see all the corners of your screen, a traditional perspective corner pin
[703]
track could work.
[705]
And we did a video on tracking objects using after effects built in tracker and the link
[710]
to that video is in the description below if you want to learn more about using it.
[714]
But when we tried doing a corner pin track on our footage, we noticed that it was very
[719]
easily disturbed by the woman’s hand here interacting with the phone.
[723]
So instead, we’re going to be using an incredibly powerful tracker that comes with After Effects.
[729]
It’s called Mocha, and we’re going to walk through together how to use it.
[735]
It’s actually easier than you’d expect, so let’s go through it together.
[739]
With your footage on your timeline, go up to animation, and track in mocha AE.
[746]
And Mocha should recognize the footage and automatically set up your composition for
[750]
you.
[751]
But there is the rare occasion that it doesn’t recognize when you bring it in.
[756]
If that’s the case, what’s probably happening is that your footage format isn’t recognized.
[761]
So an easy solution is to just take your footage as it is, and export it as an H.264 format.
[768]
That’s one that mocha will read easily.
[773]
Then bring it back onto your timeline and keep going with our next steps.
[777]
With your footage on the new mocha timeline here, we’re just going to do a couple simple
[782]
steps.
[783]
Bring your footage playhead back to the start.
[786]
Click the x-spline tool and now like the pen tool in after effects.
[792]
Click and make a basic shape around the screen of your phone.
[796]
As long as the phone is within the confines of your mask, it’s pretty good at doing
[801]
the rest of the work for you.
[803]
You’re just telling Mocha where to look and the rough shape of your object.
[808]
Once you’ve finished your last dot, hit the right mouse button to complete your outline.
[813]
Great, almost done, but before we track, we’re just going to make things a little easier
[818]
for After Effects later on.
[820]
Go to this tool called the show planer surface, and click it.
[824]
Now a box comes up and you’re going to use this to tell Mocha exactly where the screen
[829]
is on your phone.
[831]
Just click and drag these corners here and try to get it as exact as possible.
[836]
Up in the top left corner you should get a zoomed in view to help you be extra super accurate.
[846]
This last corner we just have to estimate by using the parallel lines here and get the
[851]
borders as close as possible to the existing boarders of the phone.
[854]
Great!
[855]
Once you’re done, go down to this track forward button and click it to let Mocha do
[860]
the work for you!
[861]
It’ll take a little while, so you can take a break and come back in a few minutes.
[866]
But wat you should notice is that even interractions like the hand moving across the mask won’t
[872]
interrupt it at all.
[873]
Becuase you’ve specified the overall shape of the phone, and the planer surface of the
[878]
screen, the track is going to be incredibly precise and it should stick very well.
[883]
Now that that’s done, you just need to tell after effects to use the data that mocha just
[887]
collected.
[888]
To do that, we’re basically going to copy and paste our findings into after effects.
[893]
Go to export tracking data, and choose “after effects corner blur supporting motion blur”,
[900]
and then when you hit copy to clipboard, you’ve basically just copied a bunch of information
[905]
and the next time you paste, it will paste all of the information Mocha collected.
[910]
So go back to after effects, and let’s just quickly set up a new Solid to double as the
[915]
screen.
[917]
Right Click here and go to new, solid.
[920]
Let’s make it yellow so that it’s really easy to contrast with the blue of the phone.
[925]
Cool.
[926]
Now let’s pre-compose it and label it so we know it’s our screen composition.
[935]
Now we need to bring our playhead all the way back to the start.
[940]
This is because the mocha data was measured from the first frame.
[944]
Now when we go to our transform properties of our screen composition, highlight it, and
[950]
hit control or command V to paste.
[953]
All our tracking data should now be pasted to the composition with the yellow solid.
[959]
And you can play your footage back to see that it’s sticking incredibly well!
[963]
It’s lined up perfectly to our phone screen.
[967]
And guys that’s honestly the only part that’s different from our previous still example.
[973]
From here on out we’re just going to blaze through the same process that we did for the
[976]
still tablet because we don’t have to worry about the jiggling motion now.
[981]
Let’s add in our video here in our screen layer.
[985]
Drop the screen layer below our footage layer.
[987]
Add a keylight effect.
[990]
Key out the blue.
[993]
Mask around the screen.
[995]
Set the mask to keylight.
[1000]
Tweak the blue key.
[1002]
And animate our footage to be a little bit more engaging, making sure to enable motion
[1008]
blur.
[1010]
And top it all off with a lens blur a little bit of fake screen glare.
[1017]
And guys that's how you replace a screen in After Effects.
[1019]
I hope you found this video helpful. If you did,
[1022]
Hey what's up! Andrew Kramer here!
[1023]
We’ve got lot's of other tutorials on after effects over at motionarray.com
[1028]
And if you wanted to use any of the stock screen videos in this tutorial, we’ve got
[1033]
the links to those as well as a list of even more stock screen videos in the description
[1037]
below.
[1039]
And make sure to subscribe to our channel and click the bell icon so that you never
[1042]
miss whenever we post.
[1044]
Thanks so much for watching and I can’t wait to see you in the next video!