Chroma Keying Greenscreen Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
there's plenty of training out there on pulling green screens in post some of it great some of it truly awful but the vast majority of it only gets you through the basic process of using the keyer well in this set of videos we'll take you through the whole ugly truth of King and it is ugly so that when you need to do green screen work in the real world you'll know exactly what to do as usual we'll keep the training relatively platform agnostic however the green screen keyer is on the market all behaves so differently that you'll need to figure out the specifics for York here here we'll be demonstrating the process with Blackmagic fusions Delta keyer we're also going to be working with nodes why because quite frankly it's the only way to keep your sanity while doing keying work time to get started first step you'll often want to do when pulling a key is to remove any video noise or film grain the grain will often mess with the edges of your shot you can always use the D grained version just for pulling the key while using the original grainy version for the final composite some nonlinear editors now include high-quality degrading tools or you can purchase third-party plugins to do the job we'll kick off the keying process by adding fusions Delta keyer to a green screen clip the first step in most keys is to sample the screen color this tells the key of whether it's a blue red or green screen you're keying and will usually help it dial in a few other optimizations behind the scenes looking at the Alpha Channel we can see that for this shot the green screen has fairly uneven lighting preventing a constant key unfortunately this is a common occurrence especially on larger site shoots like this one Kier's can often use a clean plate of the green screen to cancel out the unevenness of the shot the deltaCare is such a cure a clean plate is a reference frame where the actors and props are removed and only the green screen is visible unfortunately with a moving camera shot like this one a clean plate is almost impossible to create without a motion control camera rig so we're left without one but the good news is fusion includes an automatic clean plate creation tool we'll add the clean plate tool and again select the background color this time the tool removes everything except the green screen what we want to do is grow the green border around our foreground subjects inward to simulate what the green screen would have looked like behind them had they not been in the shop as we grow the edges inward we can see that we've been left with some residual edge pixels from the foreground objects and so the green screen isn't accurately being repeated inward so before we grow the edges let's trim away a few pixels by eroding the edge now when we grow the edges it's repeating pure green screen pixels without any trace of the original foreground finally we'll fill the remaining sections we now have our synthesized clean plate and what's the dramatic difference is we add the clean plate to our Delta keyer you may notice the ground starts to look a mess and becomes heavily transparent don't worry we'll fix that later you for a keyed map to work correctly the transparent areas need to be pure black a code value of zero and the solid areas need to be pure white a code value of one a contrast threshold n'kantu achieve this however if we zoom in on some edge detail you'll see that adjusting contrast heavy handedly well hide in the edge detail if we lose edge softness the composite will look like the images are glued together like some crazy ransom note instead of seamlessly integrated so this kind of threshold increasing pure blacks and pure White's needs to be dealt with let's take a better look at the situation by making a temporary gamma adjustment to the viewer we can see that there are in fact non-white regions hiding throughout the foreground mat area if we were using the mat as is regions like the boulder at center screen would appear transparent showing the composited background through them in the case of this shot there are no issues with semi transparent areas hiding in the blacks thanks to the work of the clean plate operation we performed earlier but in other shots and let's remove the clean plate input to simulate that here you'll also have to deal with non black pixels that need to be brought down to black a better way to adjust the contrast of a mat is to do so selectively in different bands of pixel intensity this shot has a low exposure range looking at the brightest spot in our image we can see that it's green value is around 0.6 so we'll first adjust the crossover controls so that the effect of the three range sliders is spread more evenly between the variation and pixel intensity in our image you'll now see that we can perform a more localized adjustment to the contrast in the image without damaging the soft edge of the mat as easily notice that even without the clean plate input we've managed to get a reasonable contrast this way without significantly hardening the edge detail at this point in the process the focus should be to get the background to a solid black while preserving the soft edge detail don't worry too much about non white pixels appearing in the foreground area we'll deal with them in the next step making sure the background pixels are pure black should be your focus of course we don't want to give ourselves more work than we need so we've reconnected that clean plate tool to get a much cleaner background you on nearly every key you pull you'll actually need to pull two keys one for the nice soft edge and one to get the center or core of the mat a solid white this is often called the edge mat coir mat technique let's take a look at how it works first up let's stop and perform some crucial organization here in fusion we'll alt drag a connecting line to create an elbow a simple pass-through node that allows us to organize our input connections one of the most critical things in node based compositing is to keep things organized as you work so we'll then select the nodes we've used to pull the key and add an underlay from the tool picker menu we can then rename the underlay group to edge mat since this key is about to become the edge mat of our edge mat core matte pair rather than starting the key from scratch we'll copy and paste the entire group of nodes and rename the second one to Corman switching to the Mac controls of our core mats deltaCare will clip the whites of the mat using the threshold control adjusting the viewer gamma down we can confirm that the whites are now completely solid throughout in fact we'll back off the threshold so that we're only clipping the whites as far as necessary to get the solid whites and no father will push the viewer gamma to the right and then adjust the low threshold to clip out any non black pixels around the outside edge of our foreground subject this gives us a solid black and white mat with really nasty hard edges well to be fair we still have the viewer gamma up but even so the edges are much harder than we want them to be for a convincing composite but now we have two keys the edge mat key which has the nice graduated edges but some non-white pixels where we should have a solid foreground and the core mat that has solid blacks and whites but a nasty edge how do we combine them well if we use in a road operation we can shrink the core mat so that it tucks neatly inside the edge mat filling in any holes in the mat without overriding the nice soft edge let's set the viewer gamma back to its default so we can see the edge accurately in the case of the Delta keyer it actually has a solid mat input so we can just connect the output of the Cormack here into the solid mat input of the edge keyer you'll sometimes add a blur directly after the erode operation just to make sure the transition between the two mattes is smooth you okay now we come to the reason why pulling green screens with nodes is so much easier than a layer list style compositor take a look at the ground it's a mess the keyer settings that work for the rest of the shot fell miserably on the sandy ground that acts as a reflector for all the green bounce light in the scene in a timeline compositing system combining multiple Kear's is a hassle so people end up trying to do everything in one keyer which is often impossible but thanks to nodes the problem becomes much easier to solve we'll start by adding yet another deltaCare specifically for the ground key we'll choose a green-screen color that works best for the ground and then adjusting the viewer gamma to better see what's going on we'll adjust the low threshold to remove background noise setting the viewer gamma back to default we can see that while the edge looks good the center has holes in the mat so as before we'll duplicate the keyer and turn this second keyer into our core mat by pulling the high threshold down we'll add the erode node the core Matt then feed it into the solid mat input of the edge Matt keyer zooming into the edge of the mat we can clearly see where the core matte finishes and the edge matte starts so we'll add that blur to the core mat to smooth the transition time to keep things organized again so we'll add an underlay for this ground key group now we need to combine the previous key and this new key for the ground if we simply merge them the ground key will just add it's hard edges to the original key ruining the shot we need a way to choose the original key for the top portion of the shot and the ground key air just for well the ground we perform this little piece of magic using an ISO mat short for isolation mat it's a simple map that isolates a portion of the image infusion we use the polygon tool to create the ISO mat we'll drag out a soft transition edge at the top of the shape now we can feed this into the mask input of the merge and the mat isolates that section of the ground key that we want to use now if you find the exact opposite happens just flip the inputs to the merge in the case of fusion ctrl or command T we'll do that trick and yet again we'll clean up after ourselves you if you look at the mat you'll see we still have a hole in the foreground area and an unwanted section of wall at screen right where the green screen ended on the set sometimes you just won't be able to key out everything so it's time to add some digital duct tape we'll draw another shape that fully encompasses the hole and merge it over the current man this is typically called a holdout mat for the section of wallet screen right beyond the edge of the green screen will create yet another mat called a garbage matte with the garbage Matt will invert the mat so that the portion of the screen we want to keep is white and then we'll use a multiply operation found in the channel bullion snowed infusion to keep everything except the problem sliver of wall at screen right now a quick note about these holdout and garbage matte shapes they need to be animated right now they'll only work for the framework currently on so we'll need to keyframe or track their position through the rest of the shot but for the sake of brevity we'll skip that step here but you've been warned taking a look at the comp so far you should hopefully see how our organization is saving the day along with an additional judicious splash of color the groups of nodes make what might have been a confusing rat's nest reasonably easy to break down and understand one of the disadvantages of building a mat out of multiple keys is that you'll often create unwanted artifacts and the color channels as you go in fact as you're about to see this isn't really a problem at all since it allows us to treat the color channels as an independent process to King what we'll do is take a copy of the original green screen image and simply add the map we've created to its alpha channel in fusion you do this using a map control node you which will set to combine alpha mode will also enable the multiply checkbox to create a pre multiplied image zooming into the edge we can see a significant spill problem along with a slightly overextended edge let's tackle the spill first there are many ways to deal with spill but probably the most reliable and flexible is to use a curves tool here we'll add fusions hue curves tool notice that we can add it to the copy of the original green screen we're feeding into the Mac ctrl without worrying about affecting the version of the green screen feeding into the keyer that's because we have a completely separate copy of the green screen being used for all the keying work we'll select the green suppression curve and then sample the edge pixels with spill on them fusion places a keyframe on the curve in that region of spill a hue based suppression curve allows us to suppress spill in very specific areas of the color spectrum reducing discoloration in areas not suffering from spill will adjust neighboring keyframes to give a more gentle fall-off to the suppression this avoids potential banding in the image you can see how significant the changes when we toggle the hue curves node on and off now in some cases spill suppression can produce a noticeable reduction in the brightness of the image in those cases you can counteract the effect by slightly raising the luminance curve in the same region not really necessary in this shot but something to be mindful of you don't want to go too far without viewing a key in the context of the final background here we have a star field which we can add with a simple merge since we've already pre multiplied the green screen with the key inside the Matt control node with a background added we can see that we still have an unwanted haloing around the screen right edge of our actor this can be caused by a number of factors including sharpening filters applied during the bearing or simply the contrast ratio of color channels used when performing the key so we need to shrink the matte edge to fit the shot fusions deltaCare has a built in a road slider the problem with shrinking the matte here is that it's applied to everything in the shot so the bolder to screen left of the actor for example is being shaved as well even though it doesn't need it so instead we'll add an additional erode node directly after the keyer will shrink the edge enough to remove the haloing but this time we'll add another ISO matte to the mask input of the erode node in order to isolate the erosion to just the screen right edge of the actor now it's important as usual to add a soft transition edge on the ISO map toggling the bypass on the erode node we can see that we've nicely tamed the problem edge without damaging any of our other key edges the next problem we need to tackle is motion blur or lack of it the keying process especially on unevenly lit green screens will usually clamp a lot of motion blur making the resulting key look blocky instead of fluid comparing the hand in the original green screen footage at left to the final composite you can see how the motion blur is being compromised well modern compositors have a secret weapon optical flow adding an optical flow node fusion calculates motion vectors for the frame to frame movement of the pixels in the shot we can temporarily visualize them in the viewer horizontal movement is indicated by red intensity vertical movement by green intensity now viewing them separately you'll notice black areas this doesn't mean that part of the image isn't moving rather it means that it's moving in the opposite direction for example left instead of right the opposite movement is represented by negative float values from the vector channels and these negative values will always clip to black in the viewer alright we'll take this vector data and feed it into the vector input of a vector motion blur node which will generate a variable blur based on the intensity of the vector data increasing the scale will exaggerate the effect so that it's clearly visible but look at the metal studs on the side of the astronaut suit they've been motion blurred as well even though they already exhibit the in-camera motion blur so we want to avoid adding additional motion blur to anything other than the hand that the King process is affected the solution you guessed it another ISO met you fed into the mosque input of the vector motion blur note when we're done we have a pleasing motion blur for the hand but the rest of the shot remains untouched as a reminder all of these customizer mats need to be tracked into position across the entire range of the shot so here we'll move to a later frame reposition the ISO shape and then check the intermediate frames to make sure fusion is correctly interpolating the position of the shape throughout and once again we need to stop and clean up our work well add a group for the spill suppression and Matt combined and another for the motion blur fix you a useful and often horribly overdone effect is light rap or background rap the idea is to add a simulated spill light from the composited background to the edge of a keyed element the concept is to simulate the backlighting that would have illuminated our green-screen subjects had they really been filmed in front of the new background we use a sufficiently gaudy sunrise background image here as an extreme example now you can use a light rap plug-in for the job but you'll get a lot more flexibility with the technique if you build your own let's see how it's done to start we need to take our existing keyed mat and build an edge mat out of it we can use a special blend mode for this cold X or short for exclusive or infusion we use the channel boolean snowed take a copy of the existing mat as one input and then at a slightly blurred version of the same mat as a second input the XOR blend mode creates a mat wherever the pixels are knotted the same no the opposites of the two input images the effect of this is a nice edge mat whose fall-off can be adjusted by the blur strength and don't worry if you don't understand what the XOR is doing just enjoy the gag it produces in the case of the light rap we only want to add light to the inside edge of the composite so to restrict the edge mat to the inside we can use another channel boolean's node to multiply our edge mat against the original mat this cuts away all of the outside edge leaving us with exactly the mat we're after and we'll pause for a moment and tidy things up to simulate the lighting source from the background image we simply apply an extreme blur this removes any localized detail but preserves the general shading color and intensity we take this and add the edge map we just created to the Alpha Channel pre multiplying it against the alpha to complete the effect we'll merge it back over the current final comp using a lighten blend mode and then adjust the blend strength to keep things subtle now there are other light rap techniques like using the spill suppression as a spill mat but this simple edge mat can serve you well when applied sparingly and of course we had an undulating x' all right now occasionally no matter what you do you end up with a harsh edge between foreground and background that stands out ruining the illusion of the composite there was a last resort you can take the edge map we created with the X or the one before we trimmed it to only include the inside edge and use it to apply a selective blur just to the edges of the comp well apply blur to the entire image and then use this edge mat as a mask to limit where the blur is applied this effectively smears the edge pixels together hopefully creating a more natural blend now this is completely unnecessary for this shot but we're demonstrating the technique so that you'll have another tool in your box of tricks if you were to use this effect you'd probably want to actually create a unique XOR edge mat since the one being used for the light wrap has a wider fall-off than an edge blurring really warrants you when color correcting the foreground to match the background you can pretty much add the color correction anywhere from the source green-screen node right up to the final merge with the background just be sure to enable unpromoted location and re pre-multiplication if you place the color correction after you pre multiplied the green against the keyed map as is the case here in a final step in any composite is to match the video sensor noise or film grain if you're working with film between all the elements whether it's grain or noise it's the same basic workflow so we'll just call it grain from here on in what kind of old school like that if both elements have grain you'll typically add grain to the least noisy element in the case of this shot the background is a grain las' CG still so we need to add moving grain to it in order to match the grain in the green screen element the first step is to generate a synthetic grain that matches the source in our case the source is the green screen footage we'll start by focusing on an untextured portion of the image that way we won't be confused by any fine detail that's actually part of the scene and not grain artifact the area is a little dark so we'll temporarily adjust the viewer gamma and gain to help us make out the grain more clearly we'll add a blur to the source footage blurring just enough to average out the grain effectively removing it now this is obviously no way 2d grain footage you'd actually want to use in a comp but it will serve our purposes as we build our own synthetic variety apply a grain generator to the blurred footage here in fusion that simply called the grain node we'll dial back the power to a more decent value now different applications will have very different controls for the grain match node but the basic approach in actually matching the grain is the same we load the blurred and re grained image in one viewer buffer and then load the original image in a second buffer we'll activate this viewer buffers gamma and gain to make sure it matches the other then we use the split screen compare mode to create a side-by-side evaluation of the original grain here on the right and our fake grain we can now adjust the strength softness and size some grain simulators allow you to also adjust black points which is great for noisy blue channels once you've got a general match switch the viewer buffers to the red Channel and Dahlin the look specifically for red then green and then blue you when you're finished switch back to the full color and confirm that your synthesized grain is a decent match with the match completed we can now delete that blur node it was just there to remove the original grain then we can rename our grain node and use ctrl or command X to cut it into the paste buffer and paste it directly after our background a last step for images like this that lack an alpha channel is to deselect the alpha multiply option and that's it we now have moving grain applied to the background matching the grain in the foreground green screen image looking back over the entire composite you'll see that we've actually done quite a bit of work but because of the underlay groups we created on the way through it's very easy to later adjust and maintain the composition if we need to make changes to say the edge Matt we can go directly to the two nodes in that group without having to decipher what's going on with all the other nodes in the composite wood that we wrap but you should now have a solid grasp of not only the core concepts of keying a green-screen but also how to use modular node based compositing to troubleshoot just about any keying shot that comes your way
Info
Channel: Moviola
Views: 8,219
Rating: undefined out of 5
Keywords: Chroma, Keying, Greenscreen, Tutorial, Davinci, Resolve, Moviola, Green, Screen, chroma key
Id: qd10FksttIE
Channel Id: undefined
Length: 30min 31sec (1831 seconds)
Published: Wed Feb 26 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.