< Return to Video

How to a Add 3D Object into your Footage in Blender

  • 0:00 - 0:02
    >> I'm going to show you how to put a 3D object
  • 0:02 - 0:05
    into your video using the camera
    tracking features in Blender.
  • 0:05 - 0:08
    And if you want to follow along with me
    in this tutorial, click the link below
  • 0:08 - 0:10
    to download this exact video clip.
  • 0:10 - 0:14
    So open up Blender and go into the
    motion tracking tab by clicking here.
  • 0:14 - 0:15
    Then here.
  • 0:15 - 0:18
    You can either drag your footage in here,
  • 0:18 - 0:21
    but I'm going to click open
    and select our video clip.
  • 0:21 - 0:24
    The first thing I'm going to do is
    click on set scene frames so that in
  • 0:24 - 0:27
    and out points matches the
    length of the video clip.
  • 0:27 - 0:30
    Then click on prefetch to
    load the clip into memory.
  • 0:30 - 0:32
    Then under tracking settings,
    I'm going to set the motion model
  • 0:32 - 0:35
    to affine and the match to previous frame.
  • 0:35 - 0:38
    Affine takes into account the
    perspective changes in the shot.
  • 0:38 - 0:42
    And previous frame basically just tracks the
    pattern from the current frame to the next one.
  • 0:42 - 0:44
    Then I'm going to tick normalize.
  • 0:44 - 0:46
    This makes sure that if there's
    any changes in light
  • 0:46 - 0:49
    in the video clip, the track
    is not affected by it.
  • 0:49 - 0:53
    Now that's done, I'm going to go to the
    first frame by pressing shift arrow,
  • 0:53 - 0:56
    and then click on detect features.
  • 0:56 - 0:58
    Now these boxes on the scene
    are tracking markers.
  • 0:58 - 1:01
    They track points of contrast within the clip.
  • 1:01 - 1:05
    Now I want more tracking markers, so I'm going
    to click on this little tab on the bottom left.
  • 1:05 - 1:08
    I'm going to change the threshold to 0.1.
  • 1:08 - 1:11
    I'm going to change the distance to, say, 50.
  • 1:11 - 1:14
    And I'm going to set the margin
    from the edge of the frame,
  • 1:14 - 1:17
    or the borders of the frame, to about 50 pixels.
  • 1:17 - 1:21
    Now if you go into our tracking setting
    over here, we need to set the value
  • 1:21 - 1:24
    of this margin lower than the
    value of the other margin.
  • 1:24 - 1:26
    So I'm going to set this to about 40.
  • 1:26 - 1:30
    Now, with all the markers selected, I
    want to press control T to track forwards.
  • 1:31 - 1:32
    Yeah, brilliant.
  • 1:32 - 1:35
    Once you've finished tracking forwards,
    making sure all the markers are highlighted.
  • 1:35 - 1:37
    And if you want to highlight all the
    markers, just hover your mouse over here
  • 1:37 - 1:40
    and press A. Now I'm going
    to press H to hide them all.
  • 1:40 - 1:44
    And while still being on the last frame, I'm
    going to once again click on detect features
  • 1:44 - 1:46
    to bring up all the tracking points.
  • 1:46 - 1:49
    And I'm fully happy with these tracking
    markers so I'm going to track backwards
  • 1:49 - 1:53
    by pressing shift control
    T, or control shift T. Nice.
  • 1:54 - 1:56
    Next, I want to reveal all the trackers,
  • 1:56 - 1:58
    so I'm going to press alt H
    to bring up all the trackers.
  • 1:58 - 2:01
    Now we have a couple of trackers
    that are problematic.
  • 2:01 - 2:03
    For instance, maybe these ones
    here that follow the cars.
  • 2:03 - 2:06
    So what I'm going to do, you
    can either delete them manually
  • 2:06 - 2:08
    by selecting them and pressing X to delete.
  • 2:08 - 2:12
    Or you can also click on solve right here.
  • 2:12 - 2:18
    Then select cleanup to get rid of any glitchy
    tracks or tracks that have high error value.
  • 2:18 - 2:20
    I'm going to click on filter tracks.
  • 2:20 - 2:22
    And, as you can see, it's selected
    all the markers that are glitchy.
  • 2:22 - 2:27
    So all I have to do is hold my mouse
    over the footage, press X and delete.
  • 2:27 - 2:30
    I'm going to go halfway throughout
    the clip and select filter tracks.
  • 2:30 - 2:31
    And there's none.
  • 2:31 - 2:34
    And just to make sure, I'm going to go to
    the last frame and select filter tracks.
  • 2:34 - 2:36
    And there's none showing up, so that's good.
  • 2:36 - 2:42
    Okay, so next, while still on the solve tab, I'm
    going to select focal length and optical center.
  • 2:42 - 2:47
    Then for keyframe A and B, so you want to pick
    a frame range where the camera is moving a lot
  • 2:47 - 2:49
    so Blender can actually track the shot.
  • 2:49 - 2:53
    So I'm going to pick a frame range
    between 100 to, say, frame 180.
  • 2:53 - 2:57
    I've just seen some tracks that are
    wild, so I'm going to delete them now.
  • 2:57 - 2:58
    Like so. Get rid of this.
  • 3:01 - 3:03
    Get rid of that one.
  • 3:03 - 3:04
    Yeah, that's cool.
  • 3:04 - 3:04
    That's fine.
  • 3:04 - 3:07
    Now I'm going to click on solve camera motion.
  • 3:07 - 3:12
    And we have a solve error
    of 0.35 which is fantastic.
  • 3:12 - 3:14
    Any solve error below a pixel is good.
  • 3:14 - 3:17
    And anything below 0.5 is great.
  • 3:17 - 3:21
    Any solve error above one pixel is
    not a good track, I wouldn't use it.
  • 3:21 - 3:24
    Now in the scene setup, on the
    left, click on set as background.
  • 3:24 - 3:26
    And, as you can see, it puts the
    video in the background of the camera.
  • 3:26 - 3:29
    Then I'm going to select setup tracking scene.
  • 3:31 - 3:35
    Next, I'm going to hold shift
    and select these three tracks,
  • 3:35 - 3:38
    and click on floor to set the floor plane.
  • 3:38 - 3:42
    Now I'm going to set the origin of my scene by
    clicking this track and selecting set origin.
  • 3:42 - 3:47
    Just to make sure that's the middle of
    my scene, I'm going to delete this cube
  • 3:47 - 3:49
    and I'm going to go into the layout view.
  • 3:49 - 3:51
    So I'm going to click this tab.
  • 3:52 - 3:56
    Then I'm going to press zero on my
    numpad to look through the camera.
  • 3:56 - 4:02
    And I'm going to click this little scroll down
    button here and I'm going to select 3D cursor.
  • 4:02 - 4:05
    Once I've selected 3D cursor, I'm going
    to make sure my camera is highlighted.
  • 4:05 - 4:10
    And I'm going to place R for rotation and I'm
    just going to line up the camera's perspective
  • 4:11 - 4:15
    so that the Y direction is going
    along the road and the X is going
  • 4:15 - 4:18
    across the road, just like that, in this field.
  • 4:18 - 4:19
    Just so it lines up like that.
  • 4:19 - 4:19
    That's perfect.
  • 4:19 - 4:23
    I'm going to select the scroll down button
    again and select bounding box center.
  • 4:23 - 4:26
    Next, I'm going to change the scale.
  • 4:26 - 4:31
    And I'm going to move the plane about here.
  • 4:31 - 4:32
    Yeah, that's nice.
  • 4:32 - 4:32
    That's perfect.
  • 4:32 - 4:33
    I'm happy with that.
  • 4:33 - 4:37
    Now I'm going to press space bar just to make
    sure that the plane is sticking to the ground.
  • 4:37 - 4:38
    Yeah, that looks good.
  • 4:38 - 4:40
    Now we can easily put a 3D
    object into the scene.
  • 4:40 - 4:43
    I'm going to press shift A,
    mesh, and select the monkey.
  • 4:43 - 4:45
    I'm going to place the monkey so
    that it's kind of facing the camera.
  • 4:45 - 4:47
    Also so that it's just sitting above the plane.
  • 4:47 - 4:48
    Yeah, that's good.
  • 4:48 - 4:51
    I'm going to decrease the scale a bit.
  • 4:52 - 4:52
    Yeah, perfect.
  • 4:52 - 4:56
    Now I'm going to go into render view by
    either pressing Z then clicking render.
  • 4:56 - 4:58
    Now, as you can see, we can't
    really see the video footage.
  • 4:59 - 5:02
    But to show the video clip, click
    on the render properties tab,
  • 5:02 - 5:04
    go to film, then select transparent.
  • 5:04 - 5:06
    And we can now view the clip through the camera.
  • 5:06 - 5:08
    Now, as you can see, we don't
    have any shadows cast.
  • 5:08 - 5:10
    That's because we need to bring the ground plane
  • 5:10 - 5:12
    from the ground collection
    into the foreground collection.
  • 5:12 - 5:13
    So I'm going to do that.
  • 5:14 - 5:18
    I'm going to change the light to a
    sunlight by clicking on this light.
  • 5:18 - 5:21
    And clicking on the light
    properties and selecting sun.
  • 5:21 - 5:24
    I'm going to decrease the
    power to about three or five.
  • 5:24 - 5:28
    And I'm going to change the angle to match
    where the sun is coming from in our clip.
  • 5:31 - 5:35
    And I'm going to change the angle
    so that the shadows aren't so harsh.
  • 5:35 - 5:36
    Nice. Perfect.
  • 5:36 - 5:40
    Now there's a lot of other things you can do
    to increase the realism of this object fitting
  • 5:40 - 5:44
    in this clip, like adding realistic reflections,
    lighting with a HDRI, adding blur and glare.
  • 5:44 - 5:46
    But I'll cover that in another tutorial.
  • 5:46 - 5:49
    There's also several other ways you
    can track a more difficult shot,
  • 5:49 - 5:51
    and I'll also cover that in another tutorial.
  • 5:51 - 5:54
    But, for now, I hope you learned something
    new and any questions let me know.
  • 5:54 - 5:55
    And I'll see you in the next one.
  • 5:55 - 5:55
    Take care.
  • 5:55 - 5:56
    Cheers.
  • 5:57 - 6:14
    [ Music ]
Title:
How to a Add 3D Object into your Footage in Blender
Description:

more » « less
Video Language:
English (United States)
Duration:
06:15

English (United States) subtitles

Revisions