Difference between revisions of "Encode video"

From Second Life Wiki
Jump to navigation Jump to search
Line 65: Line 65:
== Common problems ==
== Common problems ==
=== "I have to wait for the whole movie to load in SL, why?" ===
=== "I have to wait for the whole movie to load in SL, why?" ===
It's likely because the movie isn't optimized for "Fast Start" within-seconds playback. The above guide includes that; re-encode earlier movies as necessary.
It's likely because the movie isn't optimized for "Fast Start" within-seconds playback. The above guide makes that moot; re-encode earlier movies as necessary.

Revision as of 10:17, 9 June 2009

This guide will help you learn how to encode video to be playable in Second Life. There are many ways to do this, but this is among the simplest.

This guide empowers you to make a single movie file that is:

  1. Playable in Second Life at a reasonable balance between filesize and quality.
  2. Playable on iPod and similar mobile devices.
  3. Playable cross-platform on just about any modern computer with most video players (including VLC and Windows Media Player).
  4. Perfectly uploadable to YouTube, Vimeo, and other web video services.
  5. AWESOME. (I hope.)

Initial setup

  1. Download Apple QuickTime and upgrade it to QuickTime Pro. (Unless you already have an app that encodes through QuickTime like Apple Final Cut Pro or Adobe Premiere Pro.)
  2. Open the movie file in QuickTime Player. (In other apps, usually found as an option in the File menu).
  3. In QuickTime Player, use File menu > Export.
  4. Change the "Export" dropdown to "Movie to MPEG-4".
  5. To the right of the dropdown, click Options. Unfortunately, QuickTime doesn't let you make a list of custom presets, but you can use Most Recent Settings. You can always refer back here if you get lost.

If your movie file doesn't open in QuickTime or your video editor, you'll need an intermediary transcoder. Alas, I don't yet know of a clear choice here — add if you do.

Settings

Here's the settings you'll want to use, and why. You can tweak any one of these if you know better, but it's a good baseline, one that's been used over 300 times and refined by Torley.

  • File Format: MP4
    • NOT "MP4 (ISMA)

Video tab

  • Video Format: H.264
    • A popular codec that offers high-quality at small filesizes.
  • Data Rate: 1152 kbits/sec
    • I chose "1152" because along with audio, it's a fine balance. Make this lower (like 200 kbits/sec) if your video is a mostly-static slideshow, or if there's lots of motion, make it higher (like 2000 kbits/sec). Don't go too high above this unless you know everyone watching the video is on a superfast broadband connection. Otherwise, they'll have to wait a long time for the video to buffer, and it'll repeatedly pause as it struggles to keep up — annoying! Remember that we suggest "768 kbps" (audio + video combined) as the minimum for playing audiovisuals in SL. While many broadband connections are faster, err on the side of an enjoyable experience.
  • Optimized for: Download
  • Image Size: 640x480 (or less)
    • Exceeding 640x480 means your video won't play on iPods.
  • Uncheck Preserve aspect ratio using: Letterbox.
  • Frame Rate: Current
    • Lower this if you want to sacrifice smooth motion for higher individual frame quality. For reference, I've used 20 or 24 FPS for my video tutorials, and don't suggest going below 15 — it looks like a slide show.
  • Key Frame: Automatic
  • Click Video Options to bring up a dialog.
    • Restrict profile(s) to: Baseline
      • Uncheck Main (and Extended if need be), otherwise it won't play on iPod.
    • Encoding Mode: Best quality (Multi-pass)

Audio tab

These settings will give near-CD-quality sound.

  • Audio Format: AAC-LC (Music)
  • Data Rate: 128 kbps
    • Lower this if sound isn't so important, 64 kbps @ stereo has swishy artifacts but is tolerably listenable.
  • Channels: Stereo
    • If the original source is mono, simply make it so.
  • Output Sample Rate: 44.100 kHz
    • Similarly, if the original is lower-fidelity, lower it. You actually shouldn't be able to increase this if the source is at, say, 22.050 kHz.
  • Encoding Quality: Best

Streaming tab

  • Simply leave "Enable streaming" unchecked. This is for server-side streaming, and doesn't apply to general SL purposes.

Your settings should look like this:

For advanced users

You can apply most of the above to other encoders that support QuickTime. A common problem with encoders is their usability are crap and they offer too many options without telling you what they do, and on top of that, their presets aren't optimized as they could be. And sometimes they're missing one or more of the essential options above, making it a chore to test and get good results.

That being said, if you know something more elegant, add it here! ________ :)

Common problems

"I have to wait for the whole movie to load in SL, why?"

It's likely because the movie isn't optimized for "Fast Start" within-seconds playback. The above guide makes that moot; re-encode earlier movies as necessary.