Screen Replacement with Mocha
are you ready to take it to the next level? Because this lesson hopefully will blow your mind as much as it did when I learned this skill. So for this lesson we're going to be replacing this screen right here, which is a moving device, the camera's moving, the hand is shaking. And so in the past, if we were trying to figure out how to replace the screen like we did with the last two TVs, well we wouldn't really know where to start. There'd be key frame animations, all kinds of stuff, but there's a much easier way to do it with a tool that's built in to after effects. So go to after effects and take your screen replacement video clip and drag it into a new layer. This works best with any footage of this kind of green screen on a device. So it is beneficial to shoot or record your video with the device that has a green screen image like this that has these little targets or something similar. So there's a little bit more detail, not just the green screen, you can do this for computer scr...
eens, for tv screens, mobile devices like this. Now with this layer selected, go to the animation menu up here and choose track in mocha e, which is this add on tool I've been talking about. So this is going to open up another program. So wait till that opens. What happens is it starts a new project in mocha and it will match the settings of your video clips. So unless you want to change the location, which it will save the results, the data from what you're doing in this program to the same location as where the video clip lives itself, just leave everything the same. If you want to change that location, it's this option right here. So I just click Ok though there's lots you can do in mocha but all you need to know is this workflow. So first click the little pen tool with the X icon right there along the edges of the screen, click And you don't have to drag just click once and then click around the corners. And as you can see, I'm just clicking 123 four times. It's not perfect but that's okay then right click when you're done. So just right click anywhere. So that's our first sort of selection. Then we have to go in and select the corners and fine tune it. So click this little s buttons show Planer surface. Now you get this blue rectangle and we're going to take the corners of this blue rectangle and move them to the corners of our screen. So I like to put them just a little bit outside of the screen because you get a little bit of that glow from the green screen along the edges and this is going to remove that. It's going to actually remove the entire screen plus a few pixels out the edge. So go around each corner, make that selection and you have that little pop up that helps you see what's happening and it's good if the screen starts where there's not a finger across the screen. So if you see that you need to move things out just a little bit more. That's totally fine. Next we're going to let mocha do the work but there's a few settings you can change down here. So under pre processing for minimum Percentage Pixels used if you wanted to do a little bit more work and have an even better result type in 100 under motion. Make sure you check perspective because with this shot there is a perspective switch with that screen moving around even though it's subtle and then just click this track forwards button. It's the one on the far right that has the t with the play button. So mocha is going to go through the entire shot frame by frame and it's going to track the motion of the screen. So let's let it do that. Once it's done you can go scroll back through the timeline and see if it works. So you can just play through it and see if it was tracking properly. If you need to make adjustments, just go back to the start, move your points around. But if you're happy with it, which you should be because it does a really good job, click the export tracking data button down here from this menu, it gets a little confusing. What you want to do is just click copy to clipboard now it doesn't seem like anything happened. But if we go back to after effects again, this is a confusing workflow. But this is what you want to do. Go up to layer new solid or command. Why create a blank solid and call this screen or whatever you want? And then press paste. So command V on a Mac or control D on a Pc and you'll see what happens is that it basically moved this white screen to the screen itself. If we scrub through this now that white screen, it has replaced the green screen. Now the next thing we want to do is pre compose this. So right click pre compose screen replacement and then make sure it's leave all attributes in screen replacement, click OK. If we open this now we have this full screen and this composition is where we put any asset we want to add to the screen. So if I put it in the ocean video, for example, what happens when we go back to the screen replacement is that it actually squeezes the ocean to this size so this ocean screen is now squeeze so we don't want that necessarily. So we want to find some sort of image or asset or you could build a complete motion graphic composition within the screen that matches the sort of aspect ratio. So it's not being squeezed. One example of this is if you go to the graphics folder, I've added an apps, screen image. This is just the screen of my homepage for video school online and if I bring that down here into the composition, well look what happens if we go back to screen replacement, it looks all funky, Right? But if I go back here, right, click go to transform and go to fit to comp. What happens is it stretches this image to this full composition. But when we go back to screen replacement, it squeezes it back to the right aspect ratio. So I know it's really weird how this works but that's what you're going to want to do when you're replacing your image. So here in the screen replacement. Make sure that whatever you add you right click go to transform and choose fit to comp or you can find that from the layer transform, fit to comp menu. So that is basically how you can replace this screen. Of course this would work too. If you had a shot of this person clicking on the app and then so if you want to animate the app itself, what you would do is animate whatever is in the screen replacement. If you think this is too bright. For example, what you can do is add a little bit of, you know, darkness, add a new solid, make it black and then decrease the opacity, you could find something from within this shot or from another shot and add some sort of reflection to make it look a little bit more natural. You could do all kinds of things within here to make it look better. But now you know how to use mocha to replace a screen, a green screen that is moving, it doesn't actually have to be a green screen as long as the corners of the device are clear. Cool. So if you have any questions about that, please let me know, I know this is a confusing lesson, but just rewind and follow the steps step by step and you'll be able to get it. Thanks so much for watching and we'll see you in another lesson.