Supported File Formats

This page lists all the formats we maintain in the Tracker code tree.

The extractors below are chosen in order of Specific before Generic. If there are multiple extractors for the same mime type, the first one found in the directory is used.

Most extractors are automatically configured, meaning, if the dependency libraries exist on the system, support is built automatically. To ensure extractors are enabled or disabled for particular formats, use the --enable-* or --disable-* switch indicated in the table below!

Last updated for 0.17.4.

Specific Extractors

Formats

MIME Types

Details & Open Issues

Build Specific

Requires

MSOffice

application/msword

GB#630244 GB#632876 GB#632880

--enable-gsf

libgsf >= 1.14.24

application/vnd.ms-powerpoint

application/vnd.ms-excel

application/vnd.openxmlformats-officedocument.presentationml.presentation

application/vnd.openxmlformats-officedocument.presentationml.slideshow

application/vnd.openxmlformats-officedocument.spreadsheetml.sheet

application/vnd.openxmlformats-officedocument.wordprocessingml.document

ABW

application/x-abiword

GB#633105

--enable-abiword

-

PS

application/x-gzpostscript

GB#633106

--enable-unzip-ps-gz-files

-

application/postscript

PDF

application/pdf

-

--enable-poppler

poppler >= 0.16.0

Playlist

audio/x-mpegurl

-

--enable-playlist

totem-plparser

audio/x-scpls

audio/x-pn-realaudio

application/ram

application/vnd.ms-wpl

application/smil

audio/x-ms-asx

ISO

application/x-cd-image

-

--enable-libiso

libisoinfo-1.0 >= 0.2.9

DVI

application/x-dvi

-

--enable-dvi

-

EPUB

application/epub+zip

-

--enable-libgsf

libgsf >= 1.14.24

CUE

-

-

--enable-libcue

libcue >= ANY VERSION

XPS

application/oxps

-

--enable-libgxps

libgxps >= ANY VERSION

application/vnd.ms-xpsdocument

HTML

text/html

-

--enable-xml2

libxml >= 2.6.0

application/xhtml+xml

OGG

audio/x-vorbis+ogg

-

--enable-libvorbis

libvorbis >= 0.22.0

application/ogg

MP3

audio/mpeg

-

--enable-mp3

-

audio/x-mp3

FLAC

audio/x-flac

-

--enable-libflac

libflac >= 1.2.1

PNG

image/png

-

--enable-libpng

libpng >= 1.2.0

sketch/png

SVG

image/svg+xml

-

--enable-generic-media-extracter=gstreamer

gstreamer-0.10 >= 0.10.31, gstreamer-tag-0.10 >= 0.10.31

JPEG

image/jpeg

-

--enable-libjpeg

libjpeg >= ANY VERSION

TIFF

image/tiff

-

--enable-libtiff

libtiff >= ANY VERSION

GIF

image/gif

-

--enable-libgif

libgif >= ANY VERSION

XMP

application/rdf+xml

-

--enable-exempi

libexempi >= 2.1.0

IPTC

-

-

--enable-libiptc

libiptcdata >= ANY VERSION

EXIF

-

-

--enable-exif

libexif >= 0.6.0

ICO

image/vnd.microsoft.icon

-

--enable-icon

-

GStreamer (Normal)

video/3gpp

-

-

gstreamer-0.10 >= 0.10.31, gstreamer-tag-0.10 >= 0.10.31

video/mp4

video/x-ms-asf

application/vnd.rn-realmedia

Generic Extractors

Formats

MIME Types

Details & Open Issues

Build Specific

Requires

Plain Text

text/*

-

--enable-text

-

MSOffice

application/vnd.ms-*

-

--enable-libgsf

libgsf >= 1.14.24

Oasis

application/vnd.oasis.opendocument.*

-

--enable-libgsf

libgsf >= 1.14.24

GStreamer (Normal)

audio/*

GB#613254

-

gstreamer-0.10 >= 0.10.31, gstreamer-tag-0.10 >= 0.10.31

video/*

image/*

GStreamer (GUPNP-DLNA)

audio/*

-

--with-gstreamer-backend=gupnp-dlna

gupnp-dlna-2.0 >= 0.9.4, gupnp-dlna-gst-2.0 >= 0.9.4

video/*

image/*

dlna/*

GStreamer (Dicoverer)

audio/*

-

--with-gstreamer-backend=discoverer

gstreamer-pbutils-1.0 >= 0.10.31

video/*

image/*

GStreamer (Decodebin2)

audio/*

-

--with-gstreamer-backend=decodebin2

-

video/*

image/*

GStreamer (Tagreadbin)

audio/*

-

--with-gstreamer-backend=tagreadbin

-

video/*

image/*

AV

audio/*

-

--enable-generic-media-extractor=libav

libavformat >= 0.8.4, libavcodec >= 0.8.4, libavutil >= 0.8.4

video/*

MPlayer

audio/*

(uses spawn, not efficient)

-

-

video/*

Totem

audio/*

(uses spawn, not efficient)

-

-

video/*

Xine

audio/*

(uses spawn, not efficient)

-

libxine >= 1.0

video/*

RFE / Planned Extractors

Formats

MIME Types

Details & Open Issues

Build Specific

Requires

RTF

text/rtf

mailing list thread NB#163469

-

-

My format is not listed here?

The list of extractors requested can be found here.

Contact us on the Tracker mailing list or on IRC!

How do I add support for a new MIME type?

Overview

Packages and tools used:

  • The shared-mime-info package contains tools for building and maintaining MIME type cache, it follows the shared-mime-info specification. Fundamentally, shared-mime-info's update-mime-database tool creates files under $XDG_DATA_DIRS/mime/ (e.g. /usr/share/mime) from files found in $XDG_DATA_DIRS/mime/packages (e.g. /usr/share/mime/packages).

  • The xdg-utils package contains tools for querying the MIME type cache such as xdg-mime to test formats are supported as you would expect. The package also contains tools like xdg-open which open URLs or files based on the MIME cache and configuration.

Adding MIME types

There is a tutorial provided by the shared-mime-info specification.

So here is an example:

Let's say that you're packaging support for foo images with your project, the GIMP project.

  • You would create a gimp.xml and install it into $XDG_DATA_DIRS/mime/packages/.

  • Your final /usr/share/mime/packages/gimp.xml file would look like this:

    <?xml version="1.0" encoding="UTF-8"?>
    <mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
      <mime-type type="image/foo">
             <comment xml:lang="en">FOO image</comment>
             <comment xml:lang="sv">FOO bild</comment>
             ...
             <magic priority="50">
                    <match type="string" value="THIS IS A FOO FILE" offset="0"/>
             </magic>
             <glob pattern="*.foo"/>
      </mime-type>
    </mime-info>
  • You would then run update-mime-database to update the cache. This checks the syntax and correctness of the files you've installed too.

  • See the XML specification for more details.

Removing MIME types

Let's use the example of reversing what we've done above:

  • You have your /usr/share/mime/packages/gimp.xml.

  • Simply remove this file and run update-mime-database.

What does 'update-mime-database' do?

Below <MIME> refers to $XDG_DATA_DIRS/mime, which in most cases is /usr/share/mime (unless a different prefix is used).

Files affected by running this command include (for more detail on this, refer to the specification mentioned above):

  • <MIME>/globs (contains a mapping from names to MIME types) [deprecated for globs2]

  • <MIME>/globs2 (contains a mapping from names to MIME types and glob weight)

  • <MIME>/magic (contains a mapping from file contents to MIME types)

  • <MIME>/subclasses (contains a mapping from MIME types to types they inherit from)

  • <MIME>/aliases (contains a mapping from aliases to MIME types)

  • <MIME>/icons (contains a mapping from MIME types to icons)

  • <MIME>/generic-icons (contains a mapping from MIME types to generic icons)

  • <MIME>/XMLnamespaces (contains a mapping from XML (namespaceURI, localName) pairs to MIME types)

  • <MIME>/MEDIA/SUBTYPE.xml (one file for each MIME type, giving details about the type, including comment, icon and generic-icon)

  • <MIME>/mime.cache (contains the same information as the globs2, magic, subclasses, aliases, icons, generic-icons and XMLnamespaces files, in a binary, mmappable format)

How can I test my new MIME type?

Using the tools mentioned above, specifically xdg-mime and xdg-open, you can easily test your new file format.

Let's see some examples:

  • What MIME type does a file have (you can use this to test your new MIME type is correct installed and set up.

    $ xdg-mime query filetype /tmp/myfile.foo
    image/foo
  • What is the default application for my new MIME type (in the above example, it should be GIMP, though it can be empty):

    $ xdg-mime query default image/foo
    gimp.desktop
  • Let's open my new file format

    $ xdg-open /tmp/myfile.foo

How does all this relate to Tracker?

Well, essentially, Tracker uses this same system of MIME type caches and desktop files through GLib and various other libraries. When Tracker comes to extract specific metadata for a file (by specific, we mean non-file based data, e.g. image orientation or something related to that type of file only), we marry up the extractors to MIME types. You can see the MIME types we support by looking at the *.rule files which are installed into '$XDG_DATA_DIRS/tracker/extract-rules' (usually '/usr/share/tracker/extract-rules'). These are also in the source code repository and installed as part of the Tracker package.

We use globbing techniques to match MIME types to extractors. That's how we can have generic extractors to match all images (using 'image/*' for example).

So once you have your MIME type set up, you just need to add the MIME type to the rule file OR if it is recognised under an existing glob pattern, such as 'image/*', you just need to add support to the relevant extractors already in place.

That's it :)

Attic/Tracker/SupportedFormats (last edited 2023-08-14 12:50:23 by CarlosGarnacho)