Filter Quickly by Topic

Monday, September 6, 2010

Second Life Machinima with Fraps and Vegas - How To Guide

Well isn't this fun ... yet another way to express my creativity, if The Chamber and Quantum Matrix weren't enough, there is now Machinima.  This is my "How To" guide on how to use Second Life, Fraps and Vegas to produce high quality second life videos.

It's more about my experience doing it for others to learn from my experience.  This can be a bit of a technical blog on the subject, but it should give you insight into maximizing the capability of your computer's hardware to produce the best results for Second Life.

Software

The software that I use is Fraps, an alternate SL Viewer (Emerald/Phoenix) and Vegas Pro, though I have been playing with a recent version of the cheaper Movie Studio HD and it seems to have most of the features of the Pro version I use, so you don't have to spend a lot for a good editing platform.

Saitek Cyborg Evo Force

Hardware

Hardware is a different issue.  Until recently bought a new machine.  So I have Windows 7 with an Intel quad core I5 and ATI 5850 graphics which puts me in the top 15% for quality.

The other hardware I use is 4 axis joystick, specifically a Saitek Cyborg Evo Force. This device is nice because it has a rest for your hand.  This is describe more in the Joystick setup section below.



Hard Drive Considerations

Technically a 7200rpm hard-drive can write out about 70Mb/second.    If you decide to use an external hard-drive on a USB 2.0 device, the USB controller can write out at about 33Mb/second.  Most hard-drives are of the 5400rpm variety and write out at around 50Mb/second.

On a 5400rpm drive, which gives about 50Mb/second, expect to get only about 35Mb/second because this the average write speed of the hard-drive.  It comes from the time it takes to transfer data in the CPU and other stuff, the older the computer the more delay is introduced, because the CPU and member cannot keep up with the demand.  Depending on your computer it can range from 25-50Mb/second on a 5400rpm drive.  In my environment, the video capture writes to a 7200rpm drive, which means I can probably get close to 30 frames/second assuming the graphics card can render a scene that fast.  But it rarely does.  Usually 8 frames/second in highly complex scenes, so to compensate, I move slowly through scenes then speed up the video in Vegas to compensate.

Hardware Thrashing

Before you can begin recording your videos, you need to think about thrashing.  This where you overload the CPU, disk drives, GPU and network when recording videos because recording the screen is very intensive, and may tax your computer beyond the capabilities the hardware.

CPU trashing occurs because the CPU is dedicated to the task which is recording the screen.  Every application you have takes away from the CPU.  Most software on the PC is services and cannot be shut down but your major software like Word processors and even the video editing software will slow down the video capture.  For the best results, close everything you don't need.  Just run the basic set of programs so that you don't interrupt the CPU with non-essential requests.  This also includes things in SL, such as shutting down AO's, HUDs, setting your avatar to busy to prevent a bunch of messages from appearing, and other things on your avatar that might require CPU.  Even small numbers of non-essential interrupts, are really subtle, but a lot of them will introduce slight pauses to the video.

Hard Drive with the Platters Exposed
Drive thrashing is a little bit more difficult to understand.  A hard-drive is named because the media it reads and writes from is on a hard platter.  Hard-drives have many platters and Second Life and Fraps will read and write from different parts of the hard-disk.  Disk Thrashing occurs when the computer has to go to one area to read Second Life data and a different area to write out video.  Like CPU interrupts with non-essential software, the time it takes for the hard drive to physically move the head to another track leads to delays.  It's only 1/100th of second to move the head to the other track, but the delay is cumulative.  The trashing bit is the fact that the head has to move back and forth several times per second.  Doing it 10 times a second adds 1/10th of a second delay, and when you want to record video 30 times a second, 1/10th of a second is actually a long time.  Disk caching can take care of this for you normally, but when you are writing a lot of data, no amount of caching will prevent this.

In my environment I have two disk drives.  My "C:" contains second life cache data and my "M:" drive is where I write my videos.  I completely eliminate this track to track seeking because there isn't any.

GPU (Graphics Processing Unit) is the thing that actually displays your graphics. In the past, it used to be the responsibility of the CPU to figure out what you are looking at, and now, the CPU's job is to describe to the GPU the contents of the scene, there is a box here, a sphere there, and so on.  The GPU then breaks the scene down into polygons and that's how it figures out that the box is in front of the sphere, to show it correctly.  In Second Life, all those primitives, sculpty and textures are described in a scene in front of your camera, up to 512 meters away.  This means the viewer has to gather up all the objects and their textures from the second life server and put them on your hard-drive.

If you are on a full simulator with 15000 primitives, that is a lot of information to transfer.  But if you are now moving through that scene, your GPU must first get scene components and render them.  When you add moving primitives, the server is telling you where the new object is, so your network in involved, and if it's slows the entire process down.

In Second Life, when I arrive at a new sim, I usually set the render distance to 512 meters to gather up all the objects the viewer can see, then set it lower when a scene is being rendered, this way there is no need for the viewer to go to the server to load objects which will result in a significantly slower result.  My networking speed is 15 Mbs or about 1.5 MB/second.  It's the slowest of the components.  I can get 100Mbs but, if I could afford it, I'd rather buy tier on a sim than pay for Internet.


Viewer Setup - Joystick Controls

I've seen my joystick new recently for $30.  Other people use a Space Navigator.  It's a little harder to get and can be a bit pricey.  $99 to $250 depending on the model.  While I haven't use that device, I have used ones similar to it, and I think a joystick will work better because your entire arm is controlling the device rather than just your wrist and hand.  As well, you can use your other hand to control the throttle.  Translation, you will have better smoother control over subtle movements in your video.

My joystick has a forward, backward, twist, and rocker control on the back, which I use for pitch, roll, yaw and throttle respectively, which in SL terms is Pitch, Roll, Yaw and Z-Axis Mapping.  You will need to play with your controls for what works best for you, but in SL's Joystick setup these are my settings.  You reach these settings in the preferences, by click Joystick Setup in the Input & Camera tab:



You'll probably wonder why the roll is negative.  It's to handle the fact that pulling the joystick to the left will cause the view to roll right instead of left as you might expect.

When mapping the joystick, you'll need to look at the Joystick Monitor on the right of the window to know which axis to use for what.  I don't use zoom mapping, so I set the axis to -1.  If you use the same axis for more than one control, you might get weird results, but it could also be useful too.  For example, in an aircraft in real life, if you bank to the left, the plane with cut the air and turn the aircraft left.  You could use this ability to implement a small about of X Axis mapping as you roll.  Without it, the camera simply rolls without giving this turning effect and that might not look realistic.

You'll notice that Auto-Level is checked off.   It's useful to turn this off if you are flying, but when you are moving around on flat ground, turning vertical is very disconcerting.


Viewer Setup - Graphics Quality

Graphics Quality settings affects the overall result.  While I can run in Ultra with water reflections turned on and all my quality settings set to the max, it's not necessary to maximize the quality.  If you are moving through a scene, you only need as much quality to display the object at an acceptable quality.  In many cases, you don't need to set anything but texture quality to good or high.  It's an area to experiment in if you get choppy video.

Viewer Setup - Windlight Settings

I use the Phoenix Viewer because it gives me access to a lot of Windlight light settings.  For those of you who don't know, Windlight is a 3D photo-realistic graphics colouring library.  It allows the viewer to apply additional colours and textures to the 3D graphics information before it is displayed on the viewer.  I use a setting called "Fine Day" that increases saturation and contrast of the graphics.  This makes the images appear crisper.

Viewer Setup - a clean HUD and Interface

Other setup includes removing the objects on your heads-up-display (HUD).  On Phoenix, the Ctrl+Shift+H is used to toggle the HUD objects on/off.  Ctrl+Alt+F1 toggles the interface on and off.  On Imprudence it is Ctrl+Shift+F1.  Turning the interface on and off requires the advanced menu to be turned on, and that's reached with Ctrl+Alt+D.

Now you should have a completely empty view free of distracting elements.


Viewer Setup - Disable Camera Constraints

Disabling Camera Constraints is an absolute must to do any kind of video.  In most viewers, it is in the Advanced Menu near the bottom of the menu.

Viewer Setup - Screen Resolution

The next consideration is the screen resolution.  That drives how many frames you can write out.  My large monitor supports 1680 x 1050, but I record videos at 1280 x 768 and SL runs in a window.  Therefore my output is 1280 x 716 pixels, slightly smaller than YouTube's 720 lower HD amount, which in Vegas puts two almost unnoticeable lines above and below your video.  If you are publishing to the lower HD resolution use the lowest resolution possible.  Recording at 1680 x 1050 but publishing 1280 x 720 pixel videos means you are writing out a bunch of pixels you are going to throw away later.  This makes your frames per second to be much slower, and in my case, by a factor of 2.

To understand what this really means, Fraps does full frame capture using the DirectX libraries that are associated with your computer.  That means that every frame it can write out it uses all the bytes on the frame without any kind of compression.  So one frame at 1680 x 1050 x 3 (colours) uses 5.2Mb/frame, and 1280x716 it is 2.8Mb/frame.  Most videos run at 30 frames/second (fps), so 5.2Mb/frame burns up over 150Mb of disk space per second.


If your computer and hard-drive can write out 35Mb/second, then running at full resolution means your computer can write out about 6.7 frames per second.  But at the lower resolution, you can write out 12.5 frames per second, assuming the graphics card and computer viewer can also show the scene that fast as well.  Since you are ultimately going to throw away some of the pixels, why not do it as you record rather than having fewer overall frames.

Story and Choreography

Before you can shoot your first video segment, you need to figure out what a segment actually is.  This truly means going back to basics and thinking about the story you want to show.  What exactly do you want to show?  In my "Expressions of Imagination" video I simply wanted to have a fly through of the natural areas/sims of Second Life. 

The next task is to pick the music.  Sometimes the music drives the story, so the order you do this isn't important.  When you decided on the music, make sure it is something you can listen to over and over, perhaps 100 times by the time your done.  What music works?  Well, all music works, it's just a matter of how the music works with the scenes and who your audience is that makes a difference.

While some people just use the music as a background to the scenes, choreography is a subtle and often overlooked ability that everybody can use.  Whatever music you use, you need to listen to it at least 3-4 times minimum to pick up where all the transitions are.  In the video example below, listen to where the scenes change to give you an idea of how powerful this can be.  But then watch it again listening to your favourite music.  It doesn't lake long before you realize just how much difference the music and the choreography makes to how you feel about the result.

In Vegas, I use the "M" key as I am listening to the music to put in a marker.  If the music is stopped, you can use the "M" key to add a point and give it a text label, like, "music transition".  When listening, it puts in a marker without a label.  If you click the number at the top of the bar, you can right click it and select "Rename" to add your own label later.  When you put in your your video scenes, the video snaps to the marker lines, making it easier to position your segments and set your music or scene fades.  In general, I rarely name the markers.

Vegas with the music marked up (using the "M" key)


Second Life Mouse and the Initial Camera Setup Position

At this point, it is time to learn the Second Life Mouse Keyboard short cuts, as you will need this ability to set up your initial camera setup position.  There are three keyboard short-cuts you'll need to learn and become an expert in.  To use the controls, position your mouse, press the keys, then click the mouse.  The short-cuts do the following:
  • ALT - Zoom & Left/Right Rotate
    • Mouse Up/Down - Zooms
      • You can also use the mouse wheel to zoom in and out, but with the ALT key, the zoom is smoother, and makes positioning more precise.
    • Mouse Left/Right - Rotates left to right.
  • CTRL+ALT - Rotate
    • Mouse Up/Down - Rotates up and down
    • Mouse Left/Right - Rotates left to right.
  • SHIFT+CTRL+ALT - Pan
    • Mouse Up/Down - Pans top to bottom.
    • Mouse Left/Right - Pans left to right.
You use these controls to position your initial camera position some place in Second Life.  Now with your joystick enabled, click the fire button.  In the lower part of the SL window, you will see "Flycam", to indicate the joystick has control.

Move your joystick in all directions to calibrate it with Second life.  You should only need to do this calibration once at the beginning.  Don't worry about what your view is doing, then click the fire button again to take you out of Flycam mode, and tap the CTRL button once, this resets your camera view back to your mouse view.

IMPORTANT.  At this point, don't move your avatar using the movement keys, because this will reset your camera view, and you'll have to position it again.


Practise, Practise, Practise then GO!

To setup a scene, run through the scene several times before recording.  In the video below, each scene is practised at least 4-5 times before being recorded, and in some cases many more times.  Part of the reason is to make sure all of the scenes parts have been fully rendered.  If they are partially rendered, you'll notice a jitteriness in the video as it tries to download or render what is missing.

Once you are ready to go, click the record button on your computer and record your segment.  Don't worry about any preliminary video or stuff at the end you might capture because we'll be able to chop it out in Vegas.

If you make a mistake, delete the video you just made right away otherwise it's a bunch of wasted space and be confused which video segments to include in your show.

Final Video Assembly

Now you are ready to assemble your video.  First drag your music selection(s) to Vegas and leave about 10 seconds at the start before the music begins.  This allows you to put in some blank space before the video starts instead of starting immediately.  I preface my videos with an appropriate quote, just to set the mood.  When you render you specify how much black appears before the video starts.  I recommend at least 1-2 seconds.

I recommend that you add 3 video tracks.  The top video track is what I call the titling track, and it contains just your titles.  The middle track is your working track (described below) and the bottom track is main track containing the key video segments.

Music with fade-in to first marker
Start playing the music and mark up your music.  In my case, the music I'm using a piece of music that is 10 minutes long but only want to use the middle 5 minutes.  In Vegas, I can chop off the beginning by expanding the track and about 1/2 way down the track, the crop tool appears (I couldn't get a screen shot of it but it is a box with a left/right arrow in it.)  Click the left edge then drag to the right to cut the music.  Alternatively you can select the music and click "S" to split the music at that point.  Next, fade the music so it starts with no volume then increases to full volume where you want it to.

Video Fade-In with Music
Now add your video segment to a new track, and using the same cutting tool, click the left edge and begin dragging it to the right.  When you do, you will see exactly the frame where you are cropping the video.  I mentioned before that it didn't matter that there was crap at the beginning of your video segments, this cropping ability works on video to, and this is how you get rid of it.

Next, use the same marker you use to fade-in the music to fade in the video.  In the image to the left it is a little hard to see, but there is a fade-in line show the video.  This will cause the result to start back, then fade to the full brightness of the scene.  In subsequent video, overlaying the video will automatically fade from one to the other.

After you have faded in the video, you'll want to make sure you show enough of what you are working on to show in the video.  In my video below, I use a velocity curve because I want to run quickly through a scene.  Right click the segment and select "Insert/Remove Envelope", then select "Velocity".  Next place the cursor approximately between the fade points of the next video, then adjust the velocity so that the ending frame is where the cursor is.  Half way through the fade is roughly when you'll see the last of your segment.  In the image to the left, you'll see a green line running through the frame.  Practice will tell you the real location because it depends on the actual length of the fade.

Once you have the velocity set, crop the left edge of the video frame to align with the far right mark representing the end of a fade point.  In my case, I do this on the working track above the main track to facilitate this:
Editing in Vegas, Showing the Working Track above the Main Track
It's simply easier to crop and set the velocity on this track.



Now you drag your segment down on to the working track and Vegas will automatically put in the appropriate fades from one segment to the other:

A video segment overlaying two others and seeing the
fade automatically added between the segments

The rest is just hard work, tweaking and playing with the options to produce the effect you want.

Rendering your Video

Finally it is time to render your video.  I render to Windows native Media Video format (wma), and these are the settings I use:
  • Audio: 192 Kbps, 48,000 Hz, 16 Bit, Stereo, WMA9.
  • Video: 29.97 fps, 1280x720, WMV V9 CBR Compression, Smoothness 90

Testing the Video

Testing your video is where you make sure there are no glitches introduced.  Like not setting the right region, etc.


Uploading the Video and Showing it to the World

Finally it is time to upload the video, and all of your hard work will have paid off when you show it:
"Expressions of Imagination" (High Def Link)

Followers