 Okay, a lot of viewers seemed really interested in this, which is doing chroma keying blue screen or green screening out the background. And I'm going to be using Blender 2.66 here. This is important that you're using the most recent version of Blender because the tool that I'm going to be using in here is not available in earlier versions. I'm not sure exactly what version it came in. I know that I also have a copy of 2.63 and it's not in there. And there are chroma keying tools in older version of Blender, but this one I feel is a lot simpler and does a better job, although I might do another tutorial for older versions. I don't know. It may not be worth it since everyone will have this in a few months and you can get it right now at the website, Blender.org. Anyway, I'm using Blender 2.66. If what I'm showing you here is missing in yours, it's because you're using a different version. First thing to do anytime you're working with video in Blender is go to your rendering tab here and set your frame rate and your resolution, or at least your frame rate, because Blender doesn't go by seconds and minutes. Maybe there's a way to make it, but as far as I know, it only works with frames. So let's say you had a five minute video at 15 frames a second and you bring it in here and you have it set to 30 frames a second, that five minute video is actually going to turn into a two and a half minute video for you, or the other way around. So just make sure whatever your camera is set to set the frame rate here before you start importing videos and start doing work, it's going to save you a lot of headache later on. So now that we've got that figured out, let's go up here to our little settings tab and we're going to go down to compositing. If you've never worked with the compositor before, I recommend watching some basic videos on it, because it can get confusing if you've never worked with a compositor before with nodes and stuff like that. So I check nodes, I'm going to check background, I'm also going to check auto render, and I'm going to right click and delete that render layer because we're not working with 3D objects at all here, so we don't need that. I'm going to hit and make sure you have your cursor hovered over here, hitting keys in different areas, well you should know the basics of it before you start this tutorial, but hovering over this view, the compositor view up here, the node editor, hit shift A and say import and we're going to say movie clip. Now I'm going to say open and I'm going to go where my movie clip is. I'm going to click this little button up here to bring up the thumbnail view and I'm going to choose this video of me here in front of the green screen. I'm going to click open clip and there it is. Okay, so now at this point I can connect straight to our compositor there and if I hit F12 down here you'll see I can scroll out, that's the first shot of the video which is me pressing the record button. At this point I'm going to hit shift A and say output and bring in a viewer which is going to end up in the background because we've checked this backdrop checkbox here, so if we connect this to here, boom. I'm going to hit V on my keyboard to zoom out and you can also hit alt V to zoom in on that image. Okay, so now that we have our background view there, what I'm going to do is I'm going to hit shift A and go down to matte and once again I said there's lots of matting options in here for cutting out backgrounds and blender. Some of them have been around, some of them are new. What we're going to go to is keying, not keying screen, just keying and that brings up this big long node here. I'm going to drop it in there and it'll connect and right away you see that my eyes and my shirt disappear because by default it's screening meaning it's using black as its color it's going to remove. What I'm going to do is I'm going to click here on the color, the key color, choose the little dropper, I'm going to choose a green somewhere in the middle here because my lighting is not perfect. The better your lighting the easier this is going to be for you. I find even with little wrinkles, wrinkles are less of a problem than having even lighting but I just have one light in the shot shooting up from the side so it's brighter on the right side than the left. I'm going to click somewhere in the middle and you can see right away it does a pretty good job of masking out all of this area here. You can see a bluish color over here that's area it has not completely masked out yet. At this point what I'm going to do is I'm going to center click and drag that stuff out of the way but I still have the keying node clicked. You can see it's highlighted in red there and since that's highlighted the same tools that are in that node are over here on the right hand side so now I can see the image better while I'm messing with these options over here. What I'm going to do here is well let's throw a background image in the background because it's easier to see what you're doing because I have messed with it like this before getting it all looking nice then I throw an image in the background and realize it's not quite right. So let me shift A and choose another input and I'm just going to throw a still image in the background so I'll say image open I'll go to where I have images I'll do thumbnails and I will scroll down here I'm just going to choose a picture a still image that my wife took of a deer in our front yard I'll click on that open image and I'll just connect that straight to our renderer here for a second to show you something so the output image to the input on the compositor there now you'll notice if you look at the little thumbnail here we have a full shot of the deer but our render is only a headshot the reason for that is this image by default is a lot bigger than the 1080p that we have set in our resolution for our project here that's not a problem that's another reason we should set our default resolution initially what I'm gonna do here is I'm gonna hit shift A and I'm gonna go down to distort and I'm going to go scale I'm gonna drop that in there so that's connected through and instead of relative where we can adjust the size one being the full size I'm just gonna choose this drop down and choose render size and they'll automatically set that image as long as you grab in the output from here to our render size if you have a video that is different than the render size you want you would do the same thing to the video movie clip up here but both this and my project are 1080p so that is not an issue right now so now that we have that scaled option I'm gonna move this over here in fact I'm gonna minimize this and I am going to hit shift A again and I am going to bring in a color and I'm gonna say alpha over and here's our alpha over now this is one of the many situations where blender kind of does things backwards than what you would expect now if you're working with a traditional track editor this video of me would be the top track and this image of the deer would be the bottom track since the image of me should be on top but blender is backwards in that in this case what I'm going to do is I'm going to go the output of my video of me to the bottom and the image of the deer to the top and I'm going to connect the output of that to the view and to the compositor so we don't forget to do that later on and right away with the with the little the default settings there after choosing the green we got a pretty good background image there but if we we notice the deer is kind of bluish so what we're going to do let me maximize this for a second you can see we have three outputs here let me zoom in here three outputs here we have the image the mat and the edge we're going to take the mat and we're going to connect that to the fact input there and that will give us a nice crisp background there and what I'm going to do again is I'm going to minimize all this I'm going to move it out of the way and we still have since we have the keying node selected you can see orange there we still have the tools off to the right here and I'm going to use my arrow keys and I'm going to jump ahead in the video and actually I wanted to show you more but I had a pretty good results right there that not much for me to do after choosing the color there although there are a lot of options here so but if we do look I think my shirt is a little off oops that's not what I meant to click there yeah you can see some speckling in my shirt you can see through so let's let's do let's do adjust some coloring here I'm going to adjust basically the black clipping if I turn that up it's going to show more and more of the black through the shirt so I'm going to turn that down all the way in this case and turn the white clipping down a little bit and right there because I had a nice clean green background I am pretty much done with the configuration there in a minute I'm going to bring a video clip that isn't as well green screen in the background and I do a lot of moving so I'll get more into these tools here then but we're not completely done yet because one this video is much longer than 250 frames if you look at our frame range here frame 1 to 250 that's not long enough here I'll hit shift right arrow that brings us to our last frame in the project but if I keep hitting right arrow after that you see the video keeps going and that's because the video once again is longer than 250 frames so all they have to do is change this end frame here to be whatever the last frame in our video that we want but how long is this video there's lots of ways to figure that out but to do it within blender I'm going to show you one of many ways this is how I normally do it we still have our default cube selected in the 3d view here I'm going to go up here to textures it already has a default texture I'm going to click on type I'm going to choose image or movie open and I'm going to go and choose that same movie clip right here open image and I can see right here that is 366 sorry 3665 frames so I'm just going to set this for now to 3000 whatever it doesn't matter I can at least figure out where I want I can render out the whole thing and then cut it in another video editor on because I know the end of this video I'm going to walk up and turn off the camera so I'm just going to set that but that's how you find out how long the video is and if you just set that last frame to that or within a few frames of that you should be good and but we now currently have our project you know green screened the render length right but now we also have to set our output to be a video by default I've already changed my default settings to xfid but you have some presets here a lot of people like h264 I sometimes use that but mostly I use xfid and that's just me then I'm going to come down here to encoding and I'm going to choose the default for xfid and I'm probably going to turn the bitrate up to anywhere from 8000 to 12000 so that's great we got that but we don't have audio by default because the the compositor doesn't have any audio options so what we need to use is the video editor here so you can either render this out bring it into another video editor and drop the audio from the original video onto it or you can do it right here in blender using the video editor which used to be called the sequencer and still is in some places as you'll see in a minute but once I have that selected in there I'm going to click add I'm going to go movie and we're in the folder here already and this is the movie clip right there over here you have starting frame that's where it's going to place the video set that to one if you forget to that you can always drag and drop it after you import it will say add movie strip and here's our movie strip but we don't need the movie clip of it we only need the audio part and once again this is another place where blender kind of backwards from what you would think we got two tracks here one's a video track and one's an audio track most video editors the video track goes on top and the audio track on the bottom blender is backwards the bottom blue track here is actually video so I'm just gonna select that and delete it because we don't need it so now we just have our audio track here almost all set if we go back to our compositing view here we have our renderer settings by the way if you look under post processing you'll seek by default compositing and sequencer is checked so it will composite and then use the audio from the sequencer that should already be set but one more thing we need to do down here in our encoding is set the audio codec by default is none set it to whatever audio format you want I'm just gonna choose mp3 you can choose the bit rate here now you're set to go give it a video give your video name I'll call it test dot avi and I don't want to render out the whole thing right now but that's what you would do and then you just hit animate and it should create yourself an avi with the audio and the screen background and the background image there but once again that was a pretty easy job because I had a pretty good green background there to show you another one that has a decent background a few wrinkles in it but I'm moving around a lot so I have a lot of blurriness in my hand which will allow me to use a lot more of these tools but that's the basic concept of that I'm just gonna say file new so basically if you got lost there I'm gonna do everything again right now with a different video clip once again make sure your project is set to what your video is going is you're bringing in is I have it set to 30 I actually think my camera is recording at 29.97 so I'll set it to that if you're a little bit off like that's not a huge deal unless it's a really long video clip I'm going to then choose up here and go to compositing node I'm use backdrop I'm gonna auto render I am going to delete this render layer I'm gonna move this compositing over here shift a up here input movie clip open go to where your movie clip is I click this button up here to see the thumbnails and I'm gonna choose this clip of me put it there and I'll also say input at this time and once again you can put another video in the background if you want but I'm just gonna do a still image I'm going to open and I am going to choose an image I'll just choose another one of that dear whatever open once again the image here I know is larger than my project size so I'm going to say shift a go down to distort and I'm going to say scale connect this to here this to our render there once again if I hit F12 now you'll see that the image is cropped but if I change relative to render size it automatically makes that image our render size and I could do the same thing for this video if it was not already at 1080p so at this point I'm going to hit shift a I'm gonna say matte keying once again not keying screen but keying I'm gonna drag that up here I actually did not want to connect that there I want to connect this video to the image and disconnect that picture of the deer so at this point once again by default it's keying out the black in my shirt I'm gonna say key color so click on that white box there choose the dropper and I'm going to choose some middle green there this picture also after watching this video I realized I needed a haircut right back there I have like a little mullet going on which also made it a little bit harder to key out so I fixed my hair since then but we still need to adjust all this so once again the green over here was a better green because that's where my light was it was a little bit darker over here let's just go ahead and for right now we'll minimize that hit shift a and I'm gonna say color alpha over I'm going to choose the picture of the deer even though it's the background to the top box the image from our key to the bottom box and if I maximize this out the matte output MATTE to the fact input there and I'm also going to hit shift a choose an output of viewer which we already have check back down here backdrop if you don't check that you will not see what you connect to here but if I do right now boom there's our image I'll hit V a few times to shrink it down select the keying and minimize it and I'm just going to drag oh wait I did not mean to drag the image there I meant to drag the alpha over to there I'm also going to do the same thing to the compositor so I don't forget because I tend to do that and I'm gonna drag I'm gonna make sure I have the keying selected so I have the tools over here so once again you can do all this right in there but just to see the image better I'm going to select that drag it over I'm even gonna hit control up arrow to make this portion of the screen full screen so make sure you have your arrow over the portion you want to hit control up so now we can see pretty good right here what we got going on and right here once again out of the box we got some pretty decent effects here results here I'm gonna turn the white down a little bit because if you look right here you can see some speculating you can see the grass behind my shirt going to turn the white down a little bit and I'm gonna turn the black up a little bit and you'll see I'm right here at the hardest part of this particular image is if you look at my hair there once again I fixed my hair there but if I turn the black all the way up you can see that right there so I'm gonna try to get a good result right there because that's my worst part of this picture but once again if I go up a number of frames till I start moving my hands and you'll see what I'm talking about when I get there I'm not exactly sure where it is in the video it's near the end so so far we're looking at we're getting good results okay so right here is what I'm talking about my hands are moving so they're kind of blurry ways to fix this better lighting so you can use a quicker shutter speed maybe a higher frame rate camera might get better results there but you can still see kind of green there and actually what I have right now is actually looking pretty good it doesn't look that great in a still image but faster moving image it may be less noticeable it will be less noticeable but you also can see my hair is a little messed up right there so let's see if I turn black up you can see that's actually making things worse so black clipping let's put that back towards the middle there one thing I found I think with this particular image is post blur or I'm sorry pre blur I can turn that up and you can see if I put it let me put it back to zero here it's gonna like blur the edges before it starts processing it and that trims away some of it I can also change the screen balance if I turn that up it's getting larger there if I turn it down I think that yes so I think turning it down in this case it's a little bit better I don't want to do it too much because you don't want to stiff edge there basically play with these options if you got a good green background you won't have to do too much you got your feathering option which is something you don't want to use too much of but is I think an essential part of keying out the background that's something if you watched my preview of this tutorial I tried doing keying in Caden live and it has a green screen option but has no feather options it basically it cuts the color out and gives you a variance like the screen balance here doesn't give you any of these blur options feathering options black and white clipping at least not in that tool I don't know there's other tools you can use in conjunction with it but yeah that's pretty much it I'm gonna turn I'll turn this up to 20 the pre blur but once again it's going to depend on your image I'll go a few frames now it's still obvious that I'm super imposed here mainly due to the fact that the lighting is completely different really if you want a realistic merger of two images you don't even have to get similar similar lighting the one picture is outside and mid afternoon the other ones inside during the evening using really a cheap little light on the ground and just my living room lights that's why I kind of have an orange is changed so get lighting similar will help make sell the effect if you don't have that then you can do color corrections but I'm not great at that myself but I would definitely take some probably some red out of that this video of me if I wanted to make it look like I was really here and probably turn up the blue tones in my face a little bit would probably be the basics of what I would do but again once again you know the blurring hands you can still see the green screen a little bit because you're gonna get that with the blurring but it's really not that bad and you considering we're looking at this frame by frame right now and it's actually 30 frames a second it's it's actually gonna be pretty good results right there I think my hand actually got close to the screen and I got my shadow on there and that's why you can see that so again to get this ready I'm gonna control down arrow to get at a full screen mode there we're going to want to go into our video editor we're going to add movie we're going to choose the clip that we're using which is in this case this one I'm going to either set it to 1 here if you forget to set it to frame 1 there and you import it just hit G for grab and move it on down until you see that you're at frame 1 and you can delete this bottom track which is the video track because we're not using the video here we're using the video from the compositor so there's our audio set your your project frame rate I'm just going to say 700 this isn't a very long video but you would want to check to what part of the video you want to clip and then I'll go back to my compositing and I will make sure that I choose the encoding presets I want so I change this to whatever movie type I want if you're going to do a movie you can also do still images choose the preset you want in this case I'm choosing X fit I'm going to turn this up to 8000 and we're also going to make sure that we say that we want to encode the audio I'm just going to choose mp3 and then choose name of your file test 2 dot AVI in the case of the X vid and then I would click animate and it would start animating I also recommend saving before you click the animate button and that's it you can see it rendering out I get on my computer results of about two frames a second about at the 1080p which isn't horrible for for this sort of thing probably could be better I'm also you know there's a lot of rendering options you could probably change stuff in here to make things better I'm just going with the default settings here but that's it so I hope you enjoyed the tutorial I hope you check out my website it's films by chris.com that's chris with a K there should be a link in the description if you have any questions technical questions unless it's a very simple question please use the IRC channel if you go to my website click on the social networking tab and go down to IRC you'll be brought to the IRC channel most the guys in there probably aren't very just thinking about the guys I hang out in there most of them aren't blender guys I'm in there often not all the time but that's the best way to get your your questions answered is in there the YouTube comments is a horrible place to ask questions unless it's a very simple question I just want to make that clear also I don't always check all the comments if you're looking at this video month from now two months from now a year from now I'm probably not even realizing that you're commenting on it because I just get so many comments on many of my videos that I don't have time to check them all so IRC channels definitely where you want to ask your questions so this is kind of a long story but we did it twice I try to keep my tutorial short but I once again thank you for watching thank you for sticking with me through this tutorial I hope you found it useful and I hope that you have a great day