Tag/tag.png

Content Cleanup Required
This article should be cleaned-up to follow the content standards in the Wiki Guide. More info...

The following article is an attempt to precisely and accurately describe an easy method for encoding multimedia into the open and patent free ogg format.

What is an "ogg"?

Quite simply, an "ogg" is a wrapper for some form of multimedia content. It has been developed by xiph.org ( http://www.xiph.org ) to wrap their wonderful codecs. Unto itself, it does nothing, although many have come to understand the term "ogg" to refer to an audio file -- which isn't quite entirely correct. It can be used to wrap lossless audio, compressed video, and a plethora of other things.

What is "vorbis"?

From http://www.vorbis.org site:

Vorbis is the name of a specific audio compression scheme that's designed to be contained in Ogg. Note that other formats are capable of being embedded in Ogg such as FLAC and Speex.

For the average user, vorbis is simply an alternate patent free version of mp3. It offers better quality at comparable file size.

What is "theora"?

From the http://www.theora.org site:

Theora is an open video codec being developed by the Xiph.org Foundation as part of their Ogg project (It is a project that aims to integrate On2's VP3 video codec, Ogg Vorbis audio codec and Ogg multimedia container formats into a multimedia solution that can compete with MPEG-4 format).
Theora is derived directly from On2's VP3 codec; currently the two are nearly identical, varying only in framing headers, but Theora will diverge and improve from the main VP3 development lineage as time progresses.

For the purposes of this document, you will need to familiarize yourself with the terms above.

How do I encode a DVD from my library into an ogg wrapper?

As of now there aren't too many documents out there to describe this process. Phase one of this document will attempt to describe a very easy technique to accomplish this. It is hoped that others will contribute to this in the future.

Encoding a DVD the easy way!

First thing we must understand is exactly what we are trying to accomplish. In simple terms, we are attempting to take a DVD and re-encode it into a combination of the above codecs and stick it into an ogg wrapper.

While there exist a few command line tools to achieve this, in various combinations of other tools, there exists a very simple way to encode all of your media into theora video and vorbis audio.

Introducing VLC

For those who don't know, VLC is a media player (VLC stems from the project's original name "VideoLAN Client".) While there exist many media players out there to choose from, VLC is probably one of the best tools out there in terms of ogg support. Further, if you wish to set up a streaming server for your house to stream music or videos, it can do this as well. As well as these utilities, VLC offers many more items too numerous to mention here. The user is encouraged to examine all of VLC's features by browsing the web page at http://www.videolan.org/

For our purposes, we will assume a few things:

  • The user is unfamiliar with VLC.
  • The user has only a passing knowledge of Theora and Vorbis.
  • The user is using Ubuntu.

For starters, let's understand that as a media player, VLC supports a variety of formats which will ultimately aid you in your conversion of various media. For a listing, please visit http://www.videolan.org/vlc/features.html

Getting Started

First thing on our agenda will be to add VLC to our currently running system. Thankfully, the apt-get command is easy to do this with. If you are more comfortable using Synaptic as your package manager, please do. In the end, all that is important is that you install VLC onto your local machine. Here is the command line syntax for one such approach:

sudo apt-get install vlc

The above line assumes that you have exposed your repositories to the "universe" area. If you are unfamiliar on how to do this, visit the forums or search this Wiki for additional instructions.

Using VLC

For our example here, we are going to encode one of our legally purchased DVDs from our library for streaming or viewing on our home computer. We can start VLC from the command line or attempt to locate it via the menus ( "Applications -> Sound and Video" as of this writing.) To launch VLC from the command line issue the following command:

vlc&

First you will notice how minimalist VLC appears. It is a simple play bar, with common icons on it. You can "skin" VLC to look whatever way you want it to, but again, that is off topic.

At this point it is worthy to note that all of VLC's features can be accessed from the command line, as as you get more comfortable with its toolset, you might want to use this technique in the future. Read the manual for more details.

Load a DVD

If you put a DVD into your drive, it will probably attempt to autoload it via the standard GNOME approach. We do not need whatever app you have set to launch, so simply shut it down.

From the VLC menu, select "File -> Open Disc...". This will bring up a tabbed property sheet. Select "DVD" from the radio box selections as, at the time of writing, DVDs with menus require additional components. Under device name, specify the path to your device. On the test system, the DVD reader / writer is located at "/dev/dvd", and it is quite likely to be similar on your system.

The following few boxes are important details. If you are unsure as to what title or audio track you wish to encode, you will need to browse the DVD and pay attention to the details listed.

In our example here, we will select title 1 and audio track 0. Hopefully you will be able to tinker with your settings to get the desired output.

Stream Output

The "Stream Output" option is where the bulk of the work is accomplished in VLC regarding encoding. We will select this, and adjust the "Settings" by clicking the appropriate button.

Although the settings dialog box appears complicated at first, it is quite easy to utilize for a beginner.

First thing we must do is select "File" and browse to a desired destination file location. Name it as you wish, although "test.ogg" might do for this application.

Second, select an "Encapsulation Method" of "Ogg".

Third, we are going to specify a video and audio codec for our example. Select "Video Codec" and pull the selection box down to "theo". This specifies the "Theora" codec discussed at the beginning of this document. Select "Audio Codec" and select "vorb" from the respective selection box. For now, the defaults will probably suffice regarding bitrates and other details. Needless to say, the higher the bitrate, the larger your file. If you want better quality, up the values for bitrate. If you want smaller file size, shrink them down.

Finally, we click the "OK" button.

Assuming you have followed the steps above, you should now have begun the encoding process off of the DVD. You can view the file as it is encoded by browsing to the destination location you selected and launching VLC or another player.

Theora and Vorbis encoding are CPU intensive, and, as the current libraries stand, take a long time to encode. That said, the resulting quality is quite amazing for the size of file.

The Next Step: VLC and the Command Line

Soon after your trial of VLC you will probably want to start maximizing the power and features of this amazing program. To fully utilize all of VLC's features, you will have to get comfortable with the command line interface.

For anyone who has done any work in a Unix environment, the command line is a valuable tool. In Ubuntu, you can open up a command line by clicking the "Applications->Accessories->Terminal" menu item.

This should open up a window with something close to the following text:

username@computername: ~$

This simply is a command line representation of your current location -- in this case the '~' location -- which is shorthand for your "home" directory. Invoking VLC via the command line is as simple as typing "vlc" at the prompt and hitting enter. Obviously, to begin wielding the power of VLC, you will need to learn some command line options. Unfortunately, to the unfamiliar user, VLC's command line will appear arcane to downright cryptic.

The first thing you might want to do is examine the standard HTML or PDF documents available from the VideoLAN website home -- http://www.videolan.org/ . The most important two documents to begin with are the "Play" and "Streaming" Howtos. These guides are fairly well explained details on utilizing the two different "modes" of VLC -- the play component and the streaming component.

VLC Under The Hood

Wrapping Up

Hopefully this document has proved helpful to you. Support the open codecs and enjoy the quality that comes along with their use.

You may have wondered why VLC was chosen as a tool for this. First, it is simple for the average user. Second, for the more advanced user, you will quickly see that it supports multiple channel encoding for DVD audio -- something that isn't entirely established yet for Vorbis. Third, it is a great application with many features that extend well beyond simple media player. Fourth and finally, it has many options to tweak the encoding process for the more advanced user.

Some Useful Links

As with any conversion, you can encounter a plethora of issues ranging from quality control to audio / video sync issues. The following is a brief list of helpful sites in the progressing field of Theora / Vorbis encoding.

http://www.dogphilosophy.net/SECTION-Technical_Stuff/ogg-theora-microhowto.html http://axljab.homelinux.org/Mencoder_DVD_to_OGM http://www.parrishtech.com/content/view/16/1/


HowTo:_Theora_and_Vorbis_in_an_Ogg_wrapper (last edited 2009-07-13 13:02:40 by kmitch87)