Ogg Vorbis Audio & Ogg Media Streams

Maybe you've heard of Ogg Vorbis, or Ogg before. First let's get the terms straight because there is quite a bit of confusion in that area and until the day I wrote this document I was confused about the terms myself. So here goes: Xiph.org is the home of a collection of open source Internet multimedia tools, among other things the Ogg Vorbis audio codec and Ogg Tarkin (a video compression codec, still in the planning phase). Ogg Vorbis is an open source patent free audio codec that can rival the quality of upcoming commercial codecs like AAC, MP3Pro and VQF and which can surpass MP3 and WMA audio.

The Ogg project also loosely defines a media stream that will incorporate Ogg Vorbis and Ogg Tarkin. Just recently a first implementation of that format has been released. It is now possible to have any kind of DivX or XviD video (in fact I used an XviD video to test this guide) and Ogg Vorbis audio tracks. It would also be possible to use MP3 tracks in an Ogg media stream. Ogg audio can achieve great quality at lower bitrates than MP3 which means you'll have more space for the video. Ogg Vorbis also supports multichannel tracks and channel coupling which can help to reduce the bitrates even further when using a multichannel soundtracks. Currently, channel coupling isn't implemented yet. Once implemented this feature could make multichannel Vorbis files even more interesting as it takes similarities between channels into account and only encodes what is absolutely necessary to reconstruct the channels during the decoding phase. When it comes to the media streams there are 2 main advantages over AVI: The first is seeking. Seeking will be instantaneous. No longer will you have to wait in front of a black screen until the video starts playing again, or experience the video speed up to warp speeds as it tries to catch up with the audio. And the 2nd one is the multiplexing overhead. I haven't tested this new format a lot but just to give you an example: For a 1:54 movie with a VBR MP3 audio track I had a muxing overhead of 6700KB. Using Ogg I had an overhead of 2392KB which basically means I have another 5MB to be used to increase the video bitrate. And interestingly, when I added a 2nd Ogg audio track, the additional muxing overhead was 0KB.

After that introduction let's get right to business: You'll need the following software to follow this guide:

Ogg Vorbis Direct Show Filters
Ogg subtitle filter (only needed if you want subs)
HeadAC3he or BeSweet and GUI
Ogg Cutter
OggMux

I'm assuming that you're using DVD2AVI in your encoding process, which is the smartest way anyway. Good guides to do the video are the GKnot guide for DivX3, the GKnot guide for DivX5 or the XviD guide. All these guides will give you the necessary AC3 file that you'll be processing according to the following guide. Of course, you will not have to do the audio encoding and multiplexing parts of the abovementioned guides.

Step 0: Basic Setup

Just double click on the Ogg filter executable and it will install all the filters you'll need. You don't even have to install the filters that are in the Graphedit package, they're not useful for this kind of application.

Step 1: Audio encoding

Here you have two options: HeadAC3he or BeSweet. Which one you take is really a matter of taste. HeadAC3he is supposed to be a little faster on RAID setups, on the other hand it writes large temp files to your HD in float mode. A unique feature is the creation of 4.0 channel Vorbis files. OggMachine is a frontent for the well-known BeSweet and offers all Vorbis related options of BeSweet and all of BeSweet's basic features.

Step 2: Subtitle extraction

In order to be able to multiplex subtitles to your Ogg media streams you have to extract them from the movie VOBs first. Note that the guide linked gives you many options, just follow what's written on the main page (using Subrip).

Step 3: Getting chapter data

If you use SmartRipper to rip then you most likely already have this data. SmartRipper writes an info text file to the directory where your VOBs will be stored. If you don't have that file or use another ripper you will need ChapterXtractor.

Start up ChapterXtractor, press the Open IFO button and load the IFO file that belongs to your movie. In case of an NTSC movie set the FPS rate from 29907 to 23976.

Then click on the Format tab and select OGG from the presets list.

This will convert the data into something that OggMux can digest. Then use the Save data button to save the chapter information to a text file.

Step 4: Multiplexing

Start up OggMux.

First you select your movie and give it a title (though I can't see this info displayed anywhere during playback).

Then you load your soundtrack(s), and associate a language to each stream using the options in the dropdown list.

Then you load your subtitle file(s) and also associate a language to each stream.

Then press the Import list button and select your SmartRipper info file / Chapterextractor data file. This will import the whole list of chapters.

Then select a name for the output and set a splitsize. Note that as it says in the program, this is not necessarily keyframe accurate but OggSplit has the same problem. Then press the Mux button and watch the progress bar move slowly to the right...

Parting words

Shile playback of 6ch ogg files is possible now, some more work has to be done to the Vorbis core until that option becomes really interesting for ripping purposes. Unfortunately the channel coupling feature is not very high on the developers todo list, so you may have to lobby a bit for that feature, as the Vorbis developers don't seem to fully acknowledge the use of their format for ripping purposes. As for the bitrate calculation, no exact numbers are known to me but here's the muxing overhead from my example: Movie length: 1:54:30, muxing overhead: 2392KB for a 700MB rip which corresponds to 0.3339% of the final size. Only experience will show if this value has to be modified so feel free to share your experiences in the forum.

And last but not least, since these tools are really new there's new discoveries about them on a daily basis. The best way to be really up-to-date is to follow the discussions in the New A/V formats forum and the Audio encoding forum.

This document was last updated on 07/25/02