Blender for Video Editing: Privacy Blur Using Masking

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone and welcome to another video today i want to continue our series of tutorials showing how to use blender as a video editor and discuss creating a privacy blur using masking now i actually struggled for a while trying to come up with a concise descriptive title for this video but since a picture is worth a thousand words i think i'll just show you what i'm talking about so a privacy blur is where you'd like to take an image such as the one shown here and then blur out certain portions of the image to hide or anonymize something so for example this is actually a picture of me riding down the street on a onewheel and suppose i wanted to make it anonymous and maybe blur out my face and perhaps also the logo on my t-shirt so the goal is to end up with an image similar to the one shown on the right where you can no longer identify the individual or logo in the picture now you might hear this referred to as pixelization face blur or other names now this is a pretty easy thing to do with a single image as shown here now the trick though is how to do this if the object of interest is moving or changing shape during the video all right so let me show you first the raw video that we're going to be working with today so again this is just me riding down the street on the one wheel and you can see as i get closer to the camera i get bigger and i'm moving around in the frame and most importantly you can clearly see my face and the logo on my shirt and now let's apply the moving privacy blur to that same video so as you can see the blur effect it moves and it grows as the object of interest moves around the screen so this is what we want to work on and build today so if that sounds like more fun than a crate full of hostess ding dongs let's go ahead and get started all right so here we are in blender i've already got it set up for video editing as you can kind of see over here if you're unfamiliar with what these settings are or how i got to this stage please check out our getting started with blender for video editing tutorial you can get to it by clicking on the card that has appeared in the upper right of your screen or i'll leave a link to the url in the description of this video below so anyway let's go and get started so the first thing i'm going to do is let's go ahead and add that movie the raw movie that we saw earlier so here we go one wheel i'll go ahead and add this to the movie strip and here's the video let's go ahead and also um build a proxy for this so i'll build a 25 proxy okay and uh let's change again so instead of viewing the whole screen i'm going to click up here and click on n and then instead of seeing the original size let's view the proxy instead just so we can get a little bit faster scrubbing okay so here's the video of driving flying around on the one wheel okay oh and maybe what we should do is let's set the uh the length here let me see 330 frames so let's go and set that right over here to 3 30. okay okay so we're all set so now what i want to do we can now start thinking about adding what's called a mask so to do that i need to add a masking tap so this is a little bit new so i'm going to come up here to the um this button up here on the top i'm going to click on this and we're going to say add and i want to come down here to vfx and masking okay so there now what we end up with is we have this new masking tap so the first thing i'm going to now do is come here to this open button in the middle of the screen i'm going to click on open and i'm going to now select the exact same movie that we did earlier so that's this onewheel.mp4 again so i'll go ahead and select this and open this clip so it opens up down here in this uh window now what's interesting is if we come back to our video editing or the rendering tab so for example the video editing here if i scroll this scrubber forward and now if i come back to the masking tab notice it's in the same location so these two things are synced up at this point so if i play the video down here in the mapping tab pause it right oops that was too far let me uh let me get this back a little bit oops sorry i'm clicking on too many buttons let me hit pause right here okay so here we are in the masking tap um and then you come back to the video editing tab it's in the same location so these two things are synced up at this point so let's go ahead and get back to the beginning maybe uh i don't know frame yeah frame two is fine we can start somewhere near near the beginning okay so let's go back to the masking tap and what we want to do now is we want to now go ahead and click on the new button over here okay we're going to create a new mask on this masking tap so uh you click on this okay and now what it's going to do is it makes this button down here where it says new mask right now you want to give this thing a name so i'm going to click on this and i'm going to give this a name let's call this thing how about privacy blur okay hit enter okay all right so now what i can do is we need to draw a mask on this image so what i'm going to do is let's zoom in a little bit so i'll scroll up on my mouse wheel and then i'll press and hold the middle mouse wheel and then drag it just so i can see what i'm working with okay so what we want to do is we want to start blurring out the face and the logo on the t-shirt so we have to draw this mask so the way we're going to draw the mask is i'm going to hold the ctrl key down and then i'm just going to click on this image here and you can see it's going to drop a dot so i'm going to draw something around the area of interest and this doesn't have to be perfect by any means okay so i'm just going to draw something a little bit bigger you could close this off and make it a completely closed mask by pressing alt c but i you don't actually have to i can leave it like this okay now you can sit here you can manipulate these points if you want to move this a little bit or you want to make it a little bit more precise however you like it you can you can shape this mask to whatever you'd like okay let's say i'm happy with this what i want to do now is we're going to have to go ahead and draw this mask or at least tell blender how we want this mask to move at every frame in the process now that is super duper tedious if you think about it right you don't want to stop at every single frame and have to redraw this so we're going to use this idea of keyframes so again um we had another video describing keyframes so i'll leave a link to that in the description of this video or again click on the card that just appeared in the upper right hand side of your screen if you want to review how key frames work i would highly recommend you do that before continuing on just so you understand what's going uh what we're going to do now assuming you have done this what we can do now is i want to show you another cool feature feature so what we're going to do is we're going to turn on what's called auto keyframing which is this little button down here this circle so what this is going to do when i click on this it's going to start auto keyframing in the sense of when i make a change to this mask it's going to drop in a new keyframe point okay so um yeah that's uh that's our game plan so let's go ahead and uh and do this so we've got one point here so again let me let me adjust this mask a little bit okay and you may have to do this one time at the very beginning right you may need to just slightly adjust all these points after you turned on auto keyframing or maybe it would have been smarter to turn on auto keyframing before drawing this because now as you can see we get a keyframe up here by this little dot okay so now what i'm gonna do is let's advance the movie a little bit oh okay and let's pause here now look at that the subject moved away from where the mask was okay so i need to now move the mask to now cover the the new location of the subject so what i can do is you could either grab all these points individually and move them but that's kind of a big pain i would like to select all of these points and move the entire mask one as one big unit so what i'm gonna do is i'm gonna click down here in the area okay i'm gonna press the a key to select all of them and then i'm gonna press the g key to grab all of those points and now when i move my mouse look at this all of them move and now when i click on the um when i when i click on my mouse button go ahead and watch oops sorry oh oh shoot i lost it uh oh what did i do with the the mask uh-oh oh no i moved it way up here sorry i moved it too far i was trying to draw your attention to the fact of when i hit the key button it's going to drop a new keyframe in here so um as long as i don't move off this frame i'm still okay again let me click down here click a to select them all click g to grab them and move it back down over the person's face and let me let me zoom in a little bit g to grab them okay there we go okay that should that oh sorry that that fixed my little goof up where i move the mouse way too far off the screen okay so now we've got this set so now if i zoom backwards right see look at this isn't this cool the mask is moving now with the subject okay so again let's just move forward a little bit and again it doesn't have to be precise maybe you know like okay here we go here we go okay so the subject has moved a little bit so i'm going to stop okay and now again since i have auto key framing on all i have to do is make sure i'm down here i'm going to whoops uh click on the image i'm going to press a to select all of the points press g to grab all of those mask points move it to the location and as soon as i click on the left mouse button watch the keyframe get dropped up there in the upper uh keyframe screen so i'm going to click see and then a new keyframe gets generated so now um you can also move grow the mask so for example let's let's make this thing grow because the subject is getting closer to the to the camera so maybe we want this mask to sort of start expanding with them and now again because it's doing this auto keyframing if i scroll backwards let's we can watch this mask grow with the subjects isn't this cool see all right so now it's just the process of going ahead and basically doing this iteratively um over and over uh at appropriate keyframes and then blender will interpolate between the those keyframes to get the mask to move with the person so um again let me let's do it one more time just for completeness so okay so the guys moved a little bit so i'm going to click down here in the masking screen i'm going to press a to select all of them press g to grab the mask move it around click left mouse button to drop the mask there here you get a a keyframe and i can start manipulating these if i want so i don't think you want to watch me do this for the entire video so i'm going to speed the video up quite a bit just so you can see me doing this moving the the mask and manipulating it and using the auto keyframes to fill in the blanks as we go along [Music] [Applause] [Music] all right so i think we're finished i mean it's not perfect but now as you can see as we kind of scrub through the video uh here in this masking tab you can see the mask moving with the subject and in fact it's not just translating but it's also kind of uh growing uh you can make it grow or shrink however you like so again um this is looking pretty good again it's not perfect you can kind of spend as much time as you would like on this process but i think this is the general gist we basically have now a mask that is moving with the subject uh throughout the frame or throughout the movie so let's go ahead and save this this looks good okay so uh the next let's go back to the uh the video editor so i'm gonna come over here and click on the video editor tab okay and now what we need to think about doing is applying that mask to this video all right so to do that the first thing we need to do is add an adjustment layer to the video clip so i'm going to clip on click on the video clip here right this is the video track on a channel 2 and i'm going to then come up here and say add adjustment layer okay and what i want to do is i want to make this adjustment layer the same length as this video clip so i'm going to go ahead and uh click on the right uh sorry the left side grab the left side let's bring it back here to one and also let's make this the same length so 329 there we go okay uh all right now what we need to do is on this adjustment layer let's come over here to modifiers add strip modifier and then come down here to mask okay and now if you come down here and click on this button the mask input type i want to change this to mask and here i'm going to have a drop down of possible masks so if i click on this aha look at this this is the privacy blur mask that we just created so um click on that all right i've i've seen sometimes you may need to change this mask time from relative to absolute here but in this case uh relative should work for us so again let's go ahead and save this this sounds pretty good so far okay now what we need to do is on this adjustment layer we are going to add what's called a gaussian blur because right now if you notice the picture is not blurred at all and in fact i i mean it might look a little blurry but this is due to the fact that we're actually staring here at a 25 pr uh size proxy so at this point this might be a good time to switch this back to the actual scene rendered size like a full hundred percent okay so i'm going to do that so we get a sharper image here great so we can see it and you can say wait a second this is not working right now you don't see the blur happening okay that's because what we need to do is we need to actually add like i said that gaussian blur to this adjustment layer so i'm going to click on the adjustment layer here okay then i'm going to go add effect strip gaussian blur okay so now let's do that and now what we can do is let's start uh let me let me do a point where the person is very close where i'm very close okay so there you can see what's going on now it's still not blurred the reason why is we need to come here on this gaussian blur layer and come up here to strip and then this size right here it's zero in the x and zero in the y so we need to start cranking this up until the picture starts getting blurry so let's crank this thing up and uh you might have to go quite a bit uh i think it's okay it's starting to blur let's start let's keep going hi you see how it's getting a little bit more blurry tell you this taking too long let's just put in numbers how about 15 enter look at that it's getting blurry right good let's do uh i don't know how about 30 ah that's looking pretty good let's do the same thing in the y direction 30 enter look at that there you go this thing is now getting pretty darn blurry now um let's let's go a little higher see if this this works if you go too high though you'll notice that sometimes this might not work so here 40 this is looking even better but you know if you if you go crazy and i think if you put something like 200 uh you see how it doesn't quite work it almost gets it's too big we've overshot it right if i do look at this now it becomes visible again so we better stay somewhere in that middle ground uh what did we say that was maybe 40 looked pretty good okay 40 and 40. okay yeah that looks pretty darn good now uh here's another interesting thing um if we scroll backwards let's go back to the beginning of the video okay so so look at this the blur is being applied right it's working now now look at this though back here where the person is a little bit further away let's zoom in uh to the strip okay so i'll click up here scroll up look at this so again it's actually it's almost like this blur size is too big relative to the size of the image so back here when the person is far away and the image is small we might need this blur number to be smaller and then as it gets closer we might need that to be bigger right so again this is another great location for keyframing so let's go ahead and let's let's come back to somewhere near the start of the video something like this okay so here right now you can see the blur does not seem to be taking much effect okay so now what we can do is let's make this a little bit smaller i don't know five there that looks okay let's let's do five in both directions okay that looks pretty good let's start with the five and a five here so again what we want to do is we want to keyframe uh this value right we want to keyframe the the value of five in the gaussian blur so i'm going to hover over this and i'm going to press i there we go that keyframe the size x i'm going to hover over the size y and press i again i for india right there we go so now here at this time step at 47 uh frames in it'll be a size 5 and then we know as we come here to the end of the image whoops let's see where where was that coming back up i think i went too far come on let me zoom out a little bit there we go okay so here near the end of the image you can see that this size 5 blur is way too small right it's not going to work we needed this back up to something like 40 and 40 right and now what's actually interesting is that what as i typed that in whoops come on is it going to go is it going to take did i did i hit 440 oh there four zero enter okay because i had auto keyframing on notice look at this it actually already keyframed this for me at 40. so now as i start going backwards look at this you can see that number going smaller and smaller so look at that this is perfect so now we've keyframed we've got the mask that's moving and we've also keyframed the size of the gaussian blur so this should work quite well so again let's go ahead and save this and let's go ahead and render the scene now so i'll go ctrl f12 to render it okay and this might take a little while but as you can see here well it's probably a little bit hard to see right now um but it is blurring the picture tell you what let's give this a couple minutes to to run and then we'll take a look at the final output alright so it looked like it finished rendering let's go and take a look at the output all right so it wasn't perfect and as you can see you can probably spend as much time as you want getting that mask to move exactly perfectly correct but i think you get the idea um just to summarize i wanted to add a quick cheat sheet of how to do this in case you wanted to quickly refer to this in the future so we saw the process for adding this privacy blur is to basically first go ahead and add uh the movie to the video sequence uh the video editing sequencer right once you've done that you then need to add a masking tap and we do that by clicking at the plus sign at the top of the screen then choosing vfx and then masking okay once you're on that masking screen uh tab what you can then do is you need to click on the open button which was near the middle of the screen and then you select the same movie that you did in step one once you've done that you go ahead and click on the new button which was kind of in that odd location near the bottom left of the screen and then you just give the mask some kind of name once you've done that it's just a matter of going ahead and drawing your mask using the control click technique and then turning on auto keyframing and again steps three and four you may it might be better if you do the auto keyframing first and then draw the mask but anyway uh long story short what that should allow you to do then is now be able to move or advance forward by several frames and then update the mask so again remember when you're updating the mask you press the a key to select all the points and then the g key to grab and move all of those points once you're done moving that mask and auto keyframing it through the entire sequence you then just need to go back to the video editing sequencer and then we add an adjustment layer to the video clip and you have to make it the same length as the clip right and you do that again once you've done that we need to then go ahead and add a modifier to that adjustment layer so you click on modifiers add strip modifiers mask and then choose the mask that we had created and then lastly you need to then select the adjustment layer that you just created in step 6a and then you go up and you say add effect strip gaussian blur and then make the size x and the size y a non-zero value and after that you basically render the movie and you should be done so with that being said i i think this is a great spot to leave it i hope you enjoyed the video and if so i also hope you consider subscribing to the channel surprisingly if you just scroll down a little way and click on that subscribe button it really does help me continue making these videos also please leave a comment and let me know if the video was helpful or if there are topics you'd like me to cover in the future now remember also the new videos come out every monday so i hope to catch you at one of these future discussions where we can all learn something new together so until we talk again i think i'll sign off for now bye
Info
Channel: Christopher Lum
Views: 9,519
Rating: undefined out of 5
Keywords: Blender video editing, privacy blur, face blur, pixelate face, hide identify video editing
Id: NF_Q282V_uo
Channel Id: undefined
Length: 21min 22sec (1282 seconds)
Published: Mon Aug 10 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.