- Prev
- AppStream
- Next

## 2.4. Codecs

### 2.4.1. Introduction

Software centers might want to special-case codec handling. Therefore, we provide a component type for them.
Codecs can ship one or more files in `/usr/share/appdata/%{id}.metainfo.xml`.
Codec metadata files can - just likle all other metainfo files - be translated. See the section about translation for more information about that.

### 2.4.2. Example file

A codec meta-info file should look like this:

    <?xml version="1.0" encoding="UTF-8"?>
    <component type="codec">
      <id>gstreamer-good</id>
      <metadata_license>CC0</metadata_license>
      <name>GStreamer Multimedia Codecs - Extra</name>
      <description>
        <p>
          This addon includes several additional codecs that are missing
          something - perhaps a good code review, some documentation, a set of
          tests, a real live maintainer, or some actual wide use.
          However, they might be good enough to play your media files.
        </p>
        <p>
          These codecs can be used to encode and decode media files where the
          format is not patent encumbered.
        </p>
        <p>
          A codec decodes audio and video for for playback or editing and is also
          used for transmission or storage.
          Different codecs are used in video-conferencing, streaming media and
          video editing applications.
        </p>
      </description>
      <provides>
        <codec>encoder-audio/mpeg</codec>
        <codec>mpegversion=(int){ 4, 2 }</codec>
        <codec>stream-format=(string){ adts, raw }</codec>
        <codec>encoder-video/mpeg</codec>
        <codec>systemstream=(boolean)false</codec>
        <codec>mpegversion=(int){ 1, 2, 4 }</codec>
        <codec>encoder-video/mpeg</codec>
        <codec>systemstream=(boolean)true</codec>
        <codec>encoder-video/x-xvid</codec>
        <codec>element-faac</codec>
        <codec>element-mpeg2enc</codec>
        <codec>element-mplex</codec>
        <codec>element-xviddec</codec>
        <codec>element-xvidenc</codec>
      </provides>
    </component>

### 2.4.3. File specification

Note that the XML root must have the `type` property set to `codec`. This clearly identified this metainfo document as describing a codec.

<id/>
  For codecs, there are no special requirements for what their `%{id}` should be. But, as for any other component, you should pick a reasonable and unique name.
<metadata_license/>
  The `<metadata_license/>` tag is required. See Section 2.1, “Generic Component” for a description of this tag.
<provides/>
  This tag is described for generic components at Section 2.1, “Generic Component” in detail.
  You must add one or more children of type `<codec/>` to make it known to the system that your software is able to provide the mentioned codecs. Adding this data is required for all components of `type=codec`.

- Prev2.3. Addons
- Up
- Home
- Next2.5. Input Methods