How to create Ogg videos in Linux

Ogg Theora is the codec most supported by modern HTML5-capable browsers, so how can you convert your videos to it? Pretty easily, it seems.

There’s a cross-platform command-line application called ffmpeg2theora which does a good job of converting videos to Ogg Theora. Usage couldn’t be simpler:

ffmpeg2theora input.mpeg

If the audio is out of sync with the video, either try adding the –sync option or convert it to MPEG format using ffmpeg first, and then use ffmpeg2theora.

For those all-important tags (except ‘comment’) you can use parameters like so:

ffmpeg2theora input.mpeg --title "My spiffing video" --artist "Daniel" --license "" --date "2010" --organization "Opera Software" --location "Tokyo, Japan" 

Or alternatively there’s oggz, available in the oggz-tools package in Ubuntu:

oggz-comment input.ogv TITLE="My spiffing video" ARTIST="Daniel" LICENSE="" DATE="2010" ORGANIZATION="Opera Software" LOCATION="Tokyo, Japan" COMMENT="Best viewed on a screen" -o output.ogv

To embed your converted video in an HTML5 page, use something like this:

<video src="video.ogv" autobuffer controls>
    <p>Your browser can't display the open Ogg Theora codec but you can download it from here: <a href="video.ogv">Video</a></p>

N.B. For Mac, there’s Exom which has ‘HTML5′ as one of its output options (thanks Bruce).

UPDATE: If you’d prefer to not use the command line, there’s a GUI alternative for easy Ogg conversion.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s