Overview

format.conf defines format settings. These settings define how to encode, decode and tag each file format supported by the server.

Section format

Each section in the file defines a single format. The name of the section is the label you wish to give the format. This label is used in class.conf amongst other places.

For each type there is a base format which files are encoded from and decoded to. Often to get from a-to-b the process is a-to-base-to-b. The base type for the 'audio' type (currently the only one) is wav.

Required fields

Key Example value Description
decode lame --decode %IN% %OUT% The program used to decode a file into the base format for this type.
encode lame %QUALITY% %IN% %OUT% The program used to encode from the base format. %QUALITY% should only be included if you have quality settings.
extension mp3 The extension files of this format have.
type audio The type of the format. Currently always audio.

Quality

If a format has variable quality settings you can place the %QUALITY% variable in the encode command and define the available quality settings.

Each quality setting is a key in the form of quality-name with the value being the flags to set for this setting, e.g.: quality-high=--preset extreme.

Until version 0.3 if you had a quality option you must also set the default-quality field with the value of the default quality to use. This field is no longer used for anything.

Tag

Some formats allow meta-data to be embedded in the file storing information such as title or artist. To add meta-data to a file after encoding you need to define a 'tag' field for each piece of meta-data.

The format of a tag field is tag-metadata_field with the value being the command to run. metadata_field can be any piece of data submitted in the job description file (all lower-case). Common values here would be 'title', 'artist', 'year'.

For the command part, %DATA% is the value of the meta-data (surround with double quotes as necessary) and %FILE is the name of the file.

Example tag line: tag-artist=id3tag -a "%DATA%" %FILE%

Since the job description data is available in the form of variables it is possible to tag as part of the encode line, e.g.:

encode=oggenc %IN% %QUALITY% -a "%ARTIST%" -t "%TITLE%" -l "%DISC-TITLE%" -G "%GENRE-LONG%" -o %OUT%

The advantage of the tag- method is that the commands are only run if the metadata field specified exists. If you use the approach above then if, for example, a year was not supplied as part of the job description but %YEAR% was included in the encode line then "[unknown]" would be used as the value which might cause the encoder to fail.

The complete set of job description variables are also made available to the commands on the tag- lines, but I'm not sure how useful that actually is...