This week, I think I’ll hold off on audio, and focus on video. Namely, the Blender Video Sequence Editor. I am using the latest version, 2.60, but 2.5x should work just as well. Unfortunately, those using version 2.4x or earlier will have a vastly different interface, and may not find this article useful. I apologize.
There are a number of reasons I decided that Blender is for me, but the biggest is that it is one of the few Linux-compatible video editors that supports the Jack transport. This way, when I’m done with assembling the video, I can use Ardour to mix the audio, and blender will keep the current frame synchronized with the audio position in Ardour (or any other Jack-enabled audio application).
For this quick tutorial, we will focus on importing two video clips into Blender, including sound, and splicing them together into a single clip; if you want to try, I recommend downloading one of the many multi-part clips available on YouTube; make sure you have permission from the original authors before trying to redistribute your work, though.
Note: It will help if you are familiar with Blender’s interface. It is extremely flexible, to the point that you can rearrange every single part of the window to your exact desires, but the interface, particularly the keyboard and mouse controls, can be counter-intuitive. I have found an online course for Blender, using videos, that give a good rundown of the interface and the controls, as well as how to use the 3D modeler. Check it out, if you’re interested!
Selecting appropriate material is a bit tricky. Now, if you have a camera, and can make clips at your own leisure, then there is no problem. I lack the camera to make my own, however, so I am left with trolling the web for something that is non-controversial (no religion or politics), is licensed using a permissive license (CC-BY) without containing copyrighted material itself (no game walkthroughs/longplays), and has multiple parts (to splice together).
Tutorials tend to be good for these purposes, and interestingly enough, the video I will be using is from someone who has made a number of tutorials for the Blender software, so this can double as a link to more information on this excellent program. The videos come from Kris Occhipinti, and this specific set of videos are instructions on how to make the image of a tabletop with moving photos (a technique that can be a very interesting transition for anthologies or documentaries). The clips in question are for part 1 and part 2. Since these are two separate clips, and not two parts of one clip, we’ll cover the process of merging them into one clip. These clips are covered by the Creative Commons Attribution License 3.0, so they’re legally safe to mess around with, as long as you attribute their correct creator if you decide to distribute them.
Before we can do anything, we need to make sure that the Blender video editor is capable of handling the project correctly, so there are some tasks that need to be performed before the first clips are inserted into the timeline.
Blender and Importing Clips
Before we start up Blender, however, we need to find out about the clips, specifically their frame rate. You see, one of the flaws with current versions of Blender is that, for some reason, if the sample rate in the Blender project doesn’t match the video’s original sample rate, then the audio and video strips won’t be the same size.
In the above illustration, I’ve imported the same video clip twice; you can see the four strips, two for video (blue) and two for audio (aqua). Notice that the top two strips are the same size, while the bottom two are different. This is because the top two strips were imported when Blender’s frame rate matched the source, at 30 frames per second, while the bottom two were imported with Blender’s frame rate at the default 24 fps.
The end effect is that the top pair will allow the audio to keep synchronized with the video, while in the bottom clip, the audio will end while the video will still have a good fifth left, even though in both cases, sound and video started at the exact same time.
Hopefully, Blender will improve their resampling features to always match video and audio from the same source (or I’ll learn how it’s set), but for now, we’ll need to reset Blender’s framerate each time we import video… provided we wish to use its included audio. As you can see above, once the video and audio are imported, they won’t change, so you can mix different clips without a problem, as long as you adjust Blender’s framerate each time. Before we do so, however, we need to know what to change it to.
Most desktop environments and media players will have a way of showing the video information regarding a clip, so you should have no trouble getting a fps measurement. In my case, I just use Nautilus to bring up the properties window; there should be an Audio/Video tab that gives the file details.
The things to keep note of are the video size and the video frame rate; these will be used in Blender to handle importing and scaling. One thing to note, however, is that the VLC program seems to give a wrong value (I checked a 44.9 fps video, and VLC claimed it was 15 fps), so it’s not a good idea to use VLC to determine the framerate of the video. When in doubt, double check using at least two other methods, and use what gives the correct value once you have a workable system.
One tool I do make pretty heavy use of for video is Avidemux. If worse comes to worst (such as completely off-the-wall non-standard framerates), I can use this tool to convert the video into something a little more useful for my needs. It’s not an actual nonlinear editor, however, so Blender is still useful.
Getting Blender Into the Mood
Once I have the correct frame rate value, I can prepare Blender to make the import. However, there are some things we need to do to get Blender in a state where it is useful.
When you start Blender for the first time, it is in the default 3D scene mode. This is what you would use if you intended to make a still or animation of something rendered in this scene, and while we aren’t going to use it at this time, learning this mode can give you incredible magical editing superpowers that just would not be available in a single-purpose nonlinear video editor, such as the animated-photo-on-a-desktop trick mentioned in our example clips.
The first step is to change the program into the “Video Editing” mode. At the top of the window, you’ll see a box that says “Default,” like this:
Now, this almost meets our needs, but there is one very important thing missing: The project properties box, which happens to contain the project settings, such as the framerate box we will need to set.
Now, Blender is extremely flexible; you can have the window sectioned in just about any way you can possibly imagine, just by splitting and merging the sections accordingly. All you need to to is click and drag down or to the left on the upper-right corner of one of the sections of the window (marked by the three lines like you see at the beginning of this paragraph), and it will become a split location. Drag it up or to the right, and the window will merge with the one to the one to the right or above it.
In this case, I tend to drag the upper-right corner of the preview window (currently black) to the left. At this point, the preview window should now become two split windows:
Next, at the bottom of both, you should see several buttons that can be manipulated. The leftmost button on the right box is the next item we want. This selects the mode of the section. Both of these show the filmstrip that indicates this is a preview window. So, now we want the right box to change from being a preview window to a project properties window.
Simply change the filmstrip icon…
So, what are these sections? On the top row, going from left to right are the graph editor (the blank space on the left are for graph properties), preview box (where the video displays), and the project properties section that we just finished adding. The next row is dedicated to the video sequence timeline, where the clips and effect timelines are placed (an example of which was shown earlier in the article). Underneath the sequence timeline is the project timeline; it is in here where keyframes are marked, synchronization is handled, and the playback controls are found.
I don’t plan to mess with the graph editor or the project timeline (beyond using it to handle playback) at this time, partially because they are mainly associated with the animation of the 3D environment, and partially because I don’t really know how to use them effectively. With time and practice, that may change, but they’re beyond the scope of this article. I do leave them there for those who do understand and want to mess around with them.
Okay, we now have Blender prepared for work, let’s get to it. In order to make a video, we do need to have recorded clips. By now, hopefully you’ve downloaded the two YouTube clips and are ready to insert them into the program.
Before inserting them, we mentioned needing to change the framerate (in this case to 30 frames per second), so we need to access the “dimensions” properties of the project properties.
Also, you’ll notice that the resolution is set to 1920×1080, which is a standard HDTV setting, but underneath you’ll see 50%. This is a scaling command; if you want the video to be a fraction of its original size, this can allow you to reduce the video without having to go though the process of calculating the end resolution.
We’ll just set the resolution to 25%; rendering a full HDTV clip will take a long time, and this is just an example, anyways.
So, in the end, we have the following:
Now, to import clips. At the bottom of the video sequencing timeline, you’ll see the following menus:
The default directory will always be the root directory; the C: drive if you’re using Windows. On the left, however, you’ll see bookmarks, which includes your home profile and desktop directories, which should allow you to speed up the search for your clips. When you are in the directory with your desired clips, you can add a new “bookmark” to allow you to jump to that directory while working on this project.
Clicking once on a folder will immediately enter that directory, so save the double-clicking for opening a single clip. Unlike most programs, however, the control key is not the key to use to select multiple files; the shift key is (for some weird reason I’m not privy to).
So, go ahead to the location where your clips are stored, hold down the Shift key and click once on each clip we want to use. Each entry will be highlighted as it’s selected. In this case, I selected the two clips downloaded from Yahoo as mentioned above.
At this point, you should have one video strip and one audio strip for each clip. If the project settings were correct, then the audio and video should be equal in size, and there should be no spaces in between the first and second clips in either video or audio.
In this case, you can see absolutely no spaces between the two audio clips, and likewise between the two video clips. Now that the clips are in the timeline, let’s get to editing and arranging them, shall we?
Now, the clips are probably not in the desired places. If we need to do any kinds of fade or transitions, it helps to have the video clips above the audio clips. Of course that’s easy to fix, so let’s get started.
Sometimes, it helps to ensure the timeline shows all clips. However, it is a chore to manually zoom out and adjust the scrollbar to make them visible. Thankfully, there is a keyboard shortcut that can quickly zoom out and adjust the scrolling to show all clips: The “Home” key.
Now, to move the video clips (we can leave the audio clips alone for now), right-click and drag the video clips above the audio clips. Now, note that I said “right-click.” Left-clicking in Blender will reposition the play point on the timeline, and will not select or move anything by default; that is the right-button’s job. Once the clip is locked to the mouse (it will move left and right), you can let go of the right mouse button, at which point, you can then move the clip between tracks.
In this way, the clip will follow the mouse, even if you let go of the mouse button. Now, for the next part of the weirdness… in order to unlock the clip from the mouse, you need to either left-click to place it on the current position, or right-click again to cancel the process entirely.
So, right-click on a clip and drag it a little bit to pick it up, and then left click on the desired location to place it where you want it to be.
Now, you’ll notice that at this zoom level, the clip can be VERY hard to place at 0, especially since the clip can be moved so the start can be placed in the negative regions (guaranteeing that those frames before 0 will not be played).
You don’t need to adjust the zoom, though, as there’s a way to fine-tune placement of a clip while in move or resize mode. If you hold the shift button down while moving a clip, the motion will then go into single-frames mode, moving the clip frame by frame until it is at the frame desired. If it’s any easier, the same effect can be achieved by pressing the right and left arrow buttons on your keyboard to move the clip one frame right or left.
You can tell which frame the begin and end frames of the clip are, because their frame numbers will appear around that edge of the clip, like this:
In the above image, you might have also noticed the red outline. This outline happens when one clip overlaps another on the same track while being moved. If you attempt to place a clip where it would overlap, Blender will automatically move the clip to a position where the last frame of one is up against the first frame of the next. Failing that, say, if the moved clip is being inserted where there’s no room, it will jump to the next location on the track where the room between clips is sufficient for the clip.
Repeat the process for the first audio clip to move it to 0. Then, use the above process (placing a track to slightly overlay its prior clip) to automatically place the clip just after the last frame of the first clip.
Setting the Project Size
By default, Blender will play a total of 250 frames and then loop back to the beginning for another runthrough. Now, unless you intend to make a video approximately 10 seconds long (depending on the frame rate), you might want to adjust this.
The easiest way is to right-click on the last clip, and calculate the last frame. Now, on the full display, do you remember that gray box to the right of the timeline? That is the clip properties box. In there will be information on the clip, including some adjustments you might want such as color and size adjustments.
Also in the clip properties box are the information on the clip’s start frame and the length (in frames):
In here, you can see the “Start Frame” value, which is 20159, and the “Length” value, which is 17331. Add the two, and you end up with the last frame altogether, which means that the last frame is frame 37490.
To adjust this, we need to make changes to the “End” value at the bottom of the window:
You could try using the left and right arrows to step through this, but doing so would take a while. Instead, it is recommended that you click the middle, and you will be allowed to enter a value instead.
Showing the Audio Waveform
Before we go further, we need to have a way to visualize everything; even if the screen blanks, there may still be something being said. is there a way to check for sound even when the playback is paused?
Video clips aren’t the only clips with clip properties; the audio clip also has properties to adjust, and one of the properties is a way to show the audio waveform in the timeline.
Moving Through the Timeline
At this point, the project should have the correct size, audio waveforms should be visible, all the clips should be up against one another, and the first clip will be at the very first frame of the video, like so:
Now, what we want to do is eliminate the closing sequence of the first clip, and the opening sequence of the second clip, so that the final video looks like it’s all one video. To do that, we need to locate the end of the first clip’s content, and the beginning of the second clip’s content.
To begin with, we can use the standard transport controls to move the current point through the timeline as we watch the video, waiting to pause it once the first clip’s content is completed.
On the left is the current frame and stepping controls; you can select a specific frame by clicking and typing the desired frame number in the oval. Or, you can use the left and right arrows in the oval to step through each frame until you’re where you want to be.
On the right are the transport controls. The far left and right controls skip to the beginning and end of the project (which is why we took a moment to set it; the program uses the “Start” and “End” values to determine where these buttons sends the current frame point. Next to them are the previous and next keyframe controls. Unless you’re also using the animation controls in the 3D display, these are not important. Finally, you have the play forward (with sound) and play backward (without sound).
If you’re in a hurry, what you can also do is left-click anywhere in the timeline, and the green line will jump to that location, showing that frame in the preview window. This will allow you to then use the stepping controls to determine the exact spot needed. Preferably, at this point, the audio waveform goes flat, as the speaker has stopped talking.
To save you time, the spot where the first clip ends seems to be at frame 18751. So, what we now want to do is resize the clip so that its last frame is 18751.
At the beginning and end of each clip is a triangular box. By right-clicking and dragging that box, you will adjust that end of the clip, rather than move the whole clip.
The second clip follows a similar set of rules, except that instead of dragging the end box back, you’ll be dragging the beginning box forward. Simply look for where the actual content begins, determine the frame, and move the begin box to that frame. In my case, I chose frame 21225.
Once again, make sure you adjust both the video and audio to that specific frame you’ve chosen, so they will remain in sync.
Once you’ve finished resizing all four clips, use the movement to drag the second clips overtop the first clips, which will then be automatically moved by Blender to the first available frame.
At this point, the video has been edited. Now all that’s left is rendering.
Rendering the Final Video
At this point, the clips have been imported, moved, edited, moved again, and are now one single video, rather than two separate videos. There is the fade at the center where the second video begins, but then again, there’s a limit to what can be done without the original recorded clips.
Now it’s time to turn all this into one single video file for your personal enjoyment (or distribution, if permitted)
Most of the work at this point will be performed in the “output” section in the project properties.
The first entry is the file location and name field. If you want to assign a different folder, then click the folder on the right, browse to the correct directory, give it the desired name, and click “Accept.”
The box should now have the correct path and filename for your video.
Since we don’t have any overlay effects, RGB will be fine for this video. However, if you were to use transitions, overlays, fades, or any number of other items requiring blending of two clips, you will need to choose the RGBA option, as the “Alpha” channel is used for degrees of transparency.
Also, we will once again want to adjust the size of the project; since setting it previously, we adjusted the size of the clips to make the project smaller. Now, we will need to select the end frame of the final project.
This gets a little tricky, however, as the above trick only works in non-resized clips. The “Start Frame” and “Length” values still apply to the original clip. So, in this case, we’ll have to use the same process we previously used in the task of finding the end of the content; using the playback controls and the current playback point.
Upon doing so, the project as I have it is at 35016, so that will be the project end.
Once the “Xvid” setting was set, you may have noticed a new box in the project properties, called “Encoding.” While the output style identified “Xvid,” it does not mean you’re limited to that format; the “Encoding” box allows you to specify the actual container format (such as AVI, MPEG-4, or Flash), the video and audio codecs, and their associated options.
If I need a master copy, in fact, I will choose the “Matroska” container, FFMpeg Video Codec #1, and FLAC (the latter two are lossless codecs, excellent for re-editing later). However, at this point, I’ll go with AVI, H.264, and MP3, since those are good, compatible standards.
If you wish to adjust any of the codec or container specific settings, feel free. However, the defaults are usually pretty good.
At this point, the final project details should be ready. Check your dimensions panel in the project settings to make sure the final resolution and frame rate are as desired. Make sure the file settings are correct, and ensure all the encoding options are as you wish. Then, click “Animation” in the render box, at the top of the project properties, and relax.
For reference, the splice in the video below is at 10:24.
At this point, you have something good! Enjoy!