 Okay, today we're going to be working with Blender 2.78a or any Blender around that number should work. Then we're going to be doing some motion tracking. Now keep in mind there is between motion tracking and camera tracking. I may do a video on camera tracking in the future, but right now we're going to do some motion tracking. And I did this a while ago in Blender when they first got the feature. I thought I'd do an updated video. If you check out in the description of this video, hopefully I have a link to a YouTube video which will be the video I'm using right now so you can download the exact same file. I've uploaded it to YouTube and downloaded it so I'll be working with the same exact copy as you if you download the 1080p version. So here we go. First of all, anytime you're working with Blender, you've got to remember that Blender is working with frames per second. It's working with frames, not necessarily a timestamp. So if you're going to be working with any type of video clip in Blender, be sure before you really start doing anything to change the frame rate to the frame rate the videos are working with. So I'm going to change mine to 30 frames a second here. Next I'm going to delete the default cube. I'm going to press one on my number pad and control zero on the number pad to bring my camera into front view. Some people like to do it from a top view down when doing this sort of stuff. I do it from the front view because if I decide to do any type of physics stuff, I want down to be down, although I don't have the grid here but I don't really use that grid when I'm doing this anyway. So at this point I'm going to go up to where it says default here and change a different layout. I'm going to choose motion tracking. So now I can click open and I can choose the video I want to work with. So I'm going to go ahead and import that clip. The first part of this clip I can scroll through and it gets me getting ready. So I'm just going to go to frame 30 and that's where I'm going to start with this particular project. So I'm going to change my start frame here to 30. And if I go all the way through it seems good till I get to the end here. Yeah, pretty good. So let me go ahead and go to the first frame here and say prefetch and you'll see this little purple line going here and in some cases will go all the way to the end, some case will stop. So what it's doing is it's pre-loading the video into your RAM so it's ready to go. But Blender has a certain amount of RAM allocated for it at the beginning and this video is too large. If it was more compressed or a smaller, lower resolution you might get it all. So what we're going to do here since it's only, see if I press alt A here it's going to play smooth until it gets to this point it might, in this case it's playing through but you can see the track is getting, it's not all staying purple. If you want it to all be purple, we're going to go into user preferences, system, scroll down here and here you can see sequencer, clip editor, memory, cache, limit. And now don't overload your system. I have 8 gigs of RAM and I also have 8 gigs of swap space set up. So I'm going to set this to 4 gigs. By default it's 1 so I probably only need 2 for this particular project. But if you can't pre-fetch the whole thing try increasing this number just don't go higher than the RAM you have and leave some space, you know, some buffer room. But I'm going to go 4 gigs there and now if I click pre-fetch it should be able to pre-fetch the whole thing. There we go. And some projects that makes more of a difference than others but definitely for this I would say go ahead and do that. Next we're going to say here where it says marker we're going to say add and I'm going to click now when you're motion tracking it's a great idea to put markers in your video. I purposely didn't do that because I wanted to make it more difficult for our tracking. I wanted to track actually something in the video that I don't have to try to get rid of later even though our 3D model is going to be over it. But we're going to click mark add and I'm going to click just you know on my hand right here in this dark spot between my fingers. I'm going to go ahead and click that and then I can hit S to scale it up a little bit and then G to move it around and you can see a close up view right here. At this point make sure you're at the first frame in this case our first frame is frame 30. I'm going to scroll down a little bit here and under track I'm going to go ahead and track forward. Now you notice it goes a little bit and stops. So you also notice that my hand gets kind of blurry on how fast I'm moving so it's kind of lost its tracking point. So we're going to do is we're going to hit left arrow once to go back a frame and then just grab and kind of reposition it. And a lot of times you don't even need to really move it. And then we'll track some more and we'll go a little bit further and stop. And this might happen a lot depending on how clear your video is. One way to get this and I've watched a lot of videos and most of them don't mention this as you notice it's saying match here it says key frame. So here it's the key frame it's trying to look for the key frame that it originally was searching on. If we change this to previous frame you're going to get some better it's going to lose the tracking less often because it's not going to look at hey a hundred frames ago what did this look like it's going to look at what did it look like one frame ago now you're more likely to have it go off its tracking a little bit but that doesn't really seem to happen too much. So if you're having an issue where it's constantly losing its tracking you might want to try switching this to previous rather than key frame. So I'm going to do now again I'm going to hit left arrow more time and if I hover over this tracking for but you can see it says shortcut it says control T. So instead of going back and forth I'm just going to hit control T it will track a little bit more I'm going to grab and move it a little bit control T and then I'm going to grab and move it to where it needs to be control T grab and move it where it needs to be control T and grab and again the reason we're losing it so much is just because my hand is so blurry and that has to do with lighting and stuff like that and just how defined my tracker is. So this might seem a little annoying but imagine we're doing you know over 200 frames here didn't have the motion tracking even though it's losing it some here it's still better than going through frame by frame I probably had to stop maybe six or seven times there it's better than again trying to do it frame by frame now that I've gotten to the end I can hit alt A and you can see make sure that my little tracker follows my hand now again because of the blurriness and me adjusting it it might be off a little bit you might if you're going for real realism you might want to spend a little more time one again put trackers something that you can track better in the scene make sure you use better lighting and stuff like that and but this is good enough for this little project here we're getting a pretty good track here it's going to hit escape to stop that so how do we take this 2D tracker on this 2D image and relate it to a 3D world what we're going to do here is we're going to go over here to solve and I am going to go to geometry and say link empty to track now I click that and you'll see up here in our 3D view also we have an empty we're done with the motion tracking part of this we can now go up here to our layout and go back to default our 3D view here and you can see that in our 3D scene we have a empty which is just something that you're not going to see your render it's basically a point but when I hit Alt A you can see it's moving around and if I hit zero on my number pad to go to camera view you can see it's moving around and about where my hand was so I'm going to do now is going to hit escape I'm going to hit end to bring out this side panel here and I'm going to go down to background image I'm going to click check that I'm going to say add image and then here I'm going to say open and select the same file that I selected before now we can see a background image here and I can hit Alt A and you can see that tracker following my hand now if I hit F12 you're not going to see that background video we'll get to that in a moment but now we can link any 3D object to that empty so what we're going to do is I'm going to hit spacebar and over make sure your cursor is over the 3D view and hit spacebar I'm going to type in monkey or you can import whatever model or create whatever model you want so we have a monkey I'm going to smooth it so it looks a little nicer and I'm going to grab it and line it up kind of with my hand it doesn't even have to be right with the tracker because it's going to move relative to the tracker so I'm going to put it there so it's over my hand and you can see it's it's right there by the tracker and of course at this point it's not tracking but with the monkey selected and I shift select that tracker I can then hit uh control P and set the parent so now this empty which we don't see we render is now it's the parent of our monkey which means the the monkey follows it just like children follow their parents and I can hit Alt A now to play the preview and you can see it's following my hand not perfect it wobbles around a little bit again because our tracking wasn't perfect um so now if I hit F12 again you can see the monkey the lighting is in the background and it's it's you're going to want to move your lighting I like to go to my world tab here and again I'm working with the internal blender renderer so if you're going to work with cycles hopefully you know how lighting works in that I'm going to hit environment lighting change that to uh no sorry environment lighting and ambient inclusion occlusion and change that to multiply I just like the look of the ambient occlusion with the environment lighting uh what I'm also going to do just to make it look a little nicer I'm going to uh subsurface that monkey and so we can hit F12 now you can see what it looks like and I'm also going to give it a material we'll give it we'll make it a green monkey how about that now I can hit F12 and that's what it looks like now you'll notice that our background is a gray it's our sky color we can adjust what our sky looks like but we want to get rid of our sky because we don't want to see the sky so we're going to do here is under our render tab I'm going to scroll down to some place uh shading yes shading and then here where it says alpha sky we're going to say transparent so that's basically saying anything is not a 3D model that we can't see do you want to render it to look like the sky in our scene or just make it transparent and we want to be transparent parent I'm going to hit F12 and now you can see instead of a great background you get this checkered background that means it's transparent you can't see what's there I'm also going to turn uh well I'll leave that there for a second so I can explain that later okay so we're good at this point we don't have our background image at this point we're going to move into the compositor which can be overwhelming there's lots of different ways to put images and videos in the background of your scene uh and I think this is probably one of the best is using the compositor here so choose compositor we're going to choose use nodes and we're going to add a backdrop and I'm going to shift A and add an output of a viewer put that over here and I'm going to right click and G the keys in here are the same as in any other part of Blender you're going to you know right click stuff I can uh drag this here and there you can see our monkey in the background G to move these around and now I'm going to shift A add an input and I'm going to choose movie clip and here from this drop down I'm going to choose our video clip again and that will be our video clip I'm going to drag that here and now shift A again and I'm going to go to color and I'm going to go to alpha over and I'm going to choose put that there and I'm going to put this here and it's kind of confusing here you want your top video in the bottom uh input here so our background goes on the top you would think it would go the other way which your videos on top you would put on top that's not how it works anyway so there's our monkey now you'll notice the monkey isn't lined up with my hand why is that well the reason is because our view our video is 1080p in this case right well if you look over here at our render settings you'll notice it's set to 1080p but it's set to render at 50% so if I put this up to 100% and hit f12 it renders out now the size is matched now let's say you want to render out a a quick render of it so at a lower resolution just to see how it looks well again if I put this down to like 50 or 25 percent and render it out the images aren't going to line up also we want to make sure I connect our alpha over here we're looking at the viewer the preview here we also want to make sure in the end we have it connected to our composite here so here is what our actual render looks like right now there's our monkey but you can't see our whole video because we're rendering at 25 percent but the video is still full size the way you adjust this is shift A and under distort we're going to choose scale and we're going to drop that in here between the movie clip and our alpha over and here we can change this to render size and now no matter what size we set our renderer to the video is going to be resized to match and that is pretty much it at this point we choose how we want to render the output and and render it out so I'm going to do is I'm going to choose xvid here I'm going to do encoding xvid but choose whatever you know rendering you want I'm going to make sure I put this at 100 percent and I'm going to choose where I want this video to go for now I'll just throw it in my tenth folder I'll call it monkey tracking there we go accept and then at this point I can click animate and it will start rendering out our video here and right now I'm getting on my machine about a second and a half per frame we've got just over 200 frames it's going to take a couple of minutes but I'll play the rendered out version at the end here but that's pretty much it other things you might want to think about I didn't go over in this is if you wanted the original audio you can use the sequence editor to lay down the audio and then you can add a codec here we have none we can change this to whatever audio you want and then the audio play or you can use you can render out the video and add the audio back later right now I'm just rendering it without audio but that's it now you know doing this there's no shadows casted on me there's stuff you can do to do that basically you put like a invisible 3d object that renders shadows only where my hand is motion track that and then the shadows will be cast on that 3d object but you won't see the 3d object you only see the shadows on it uh you'll see that a little bit if I end up having time to do that camera tracking video and uh that is pretty much it and this is uh I'll I'll post it again check out the description of this video where you can download this exact video I'm working with and again I uploaded it and then downloaded it from YouTube to make sure that I'm working with the same quality copy as you so there's no questions to you know the quality being a problem although I also uh did a test on this with the same video at half resolution it still worked you know the picture the picture looked the video looked more pixelated when I zoomed in but it still tracked it no problem and that is it I thank you for watching uh please visit filmsbychrist.com that's chrisofdk there should be a link in the description to that there you can search through all my videos from this channel and my uh other channel also think about coming a supporter over at patreon.com if you like my videos and want to support me patreon.com forward slash metal x1000 is a great way to do that link in the description even a dollar a month is much appreciated if you can't support me regularly uh if you go to again filmsbychrist.com you can um uh there's a paypal link there that you can send me stuff money through that'd be great I appreciate that and don't feel like you have to support me financially I would really appreciate if you did but if you can't if you like this and you found it useful or find my videos useful be sure to like subscribe and comment uh those things help me out a lot and as always I hope that you have a great day here is that video finally rendered