đ
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!
You can go back to the homepage right here: Homepage





