Analysing Ogg Files

There are a number of tools available to analyse ogg files from the packages Vorbis tools, oggz tools and Ogg Video Tools. As with editing, the tools may overlapping in functionality, however here we will focus on the usual usage of the available tools and the fields where they could be used.

The tools that are discussed here are :

From Vorbis tools:

ogginfo

From oggz tools:

oggz-info

oggz-comment

oggz-validate

oggz-sort

oggz-dump

oggz-sort

From Ogg Video Tools:

oggDump

oggLength

Information about an Ogg file

If you want to get some information about what streams are available within a file and what nature these streams have, you use ogginfo or oggz-info.

The printed output here is about which streams are available within the Ogg file and the parameters the streams have (e.g. for theora the video frame size and the frame rate and for vorbis the sample rate and the channel number).

ogginfo even prints out more detailed information, e.g. version information and all information available from the video and audio header packets, e.g. aspect ratio or colour spaces.

oggz-info can tell you more about an Ogg file. In particular, the -a option will tell you even more detailed information on your file. However, these information are mostly from the statistical area.

To read or edit the comments fields, that are delivered with every stream within the Ogg file. To do so, the oggz tools provide the oggz-comment command line tool.

A rather common problem that oggz-validate might report, is badly sorted Ogg files. These will usually play, but may cause issues such as intermittent stuttering, or increased memory usage. The oggz-sort tool may be used to correct these sorting issues:

$ oggz-sort -o output.ogv input.ogv

A more detailed view can be given by the tools oggz-dump and oggDump. Both of these tools write detailed output data to the console.

oggz-dump can output the packets of all or some specific streams within a given Ogg file.

With oggDump you can decide if you like to see the pages or the packet information of an Ogg file by setting the -p (packet) or -g (page) option. Further more you can specify the detail level of the stream information output by using -l (detail). The detail can be set from 1 (not detailed) to 5 (most details):

Tips and tricks

This subsection lists some useful ways to use several of the tools described above.

Getting the Duration of a Stream

To figure out the duration of a video file you can use oggz-info or ogginfo, but here you need to extract the information via script from the output. oggLength gives you another way to receive the length directly, so you can use it more easily.

Create an Ogg Vorbis file filled with silence that fits exactly to a video

$ oggSilence -l`oggLength videoFile.ogv` -o audioSilence.oga

Creating a sound byte from a portion of a video

These two commands save a short 5 second audio clip from 40 seconds into a video: