hachoir-metadata

hachoir-metadata is tool to extract metadata from multimedia files (sound, video, archives, etc.): see output examples!

hachoir-metadata library is used by Plone4artist, django-massmedia (Washington Post open source library), amplee (implementation of the Atom Publishing Protocol, APP) and pyrenamer.

Features

  • Gtk interface
  • Plugins for Nautilus (Gnome) and Konqueror (KDE)
  • Support invalid / truncated files
  • Unicode compliant (charset ISO-8859-XX, UTF-8, UTF-16), convert string to your terminal charset
  • Remove duplicate values (and if a string is a substring of another, just keep the longest one)
  • Set priority to value, so it's possible to filter metadata (option --level)
  • Only depends on hachoir-parser (and not on libmatroska, libmpeg2, libvorbis, etc.)

Download

Code example

See hachoir-metadata code example.

Supported file formats

Total: 33 file formats.

Archive

  • bzip2: bzip2 archive
  • cab: Microsoft Cabinet archive
  • gzip: gzip archive
  • mar: Microsoft Archive
  • tar: TAR archive
  • zip: ZIP archive

Audio

  • aiff: Audio Interchange File Format (AIFF)
  • mpeg_audio: MPEG audio version 1, 2, 2.5
  • real_audio: Real audio (.ra)
  • sun_next_snd: Sun/NeXT audio

Container

  • matroska: Matroska multimedia container
  • ogg: Ogg multimedia container
  • real_media: !RealMedia (rm) Container File
  • riff: Microsoft RIFF container

Image

  • bmp: Microsoft bitmap (BMP) picture
  • gif: GIF picture
  • ico: Microsoft Windows icon or cursor
  • jpeg: JPEG picture
  • pcx: PC Paintbrush (PCX) picture
  • png: Portable Network Graphics (PNG) picture
  • psd: Photoshop (PSD) picture
  • targa: Truevision Targa Graphic (TGA)
  • tiff: TIFF picture
  • wmf: Microsoft Windows Metafile (WMF)
  • xcf: Gimp (XCF) picture

Misc

  • ole2: Microsoft Office document
  • pcf: X11 Portable Compiled Font (pcf)
  • torrent: Torrent metainfo file
  • ttf: !TrueType font

Program

  • exe: Microsoft Windows Portable Executable

Video

  • asf: Advanced Streaming Format (ASF), used for WMV (video) and WMA (audio)
  • flv: Macromedia Flash video
  • mov: Apple !QuickTime movie

Options

Modes --mime and --type

Option --mime ask to just display file MIME type:

$ hachoir-metadata --mime logo-Kubuntu.png sheep_on_drugs.mp3 wormux_32x32_16c.ico
logo-Kubuntu.png: image/png
sheep_on_drugs.mp3: audio/mpeg
wormux_32x32_16c.ico: image/x-ico

(it works like UNIX "file --mime" program)

Option --file display short description of file type:

$ hachoir-metadata --type logo-Kubuntu.png sheep_on_drugs.mp3 wormux_32x32_16c.ico
logo-Kubuntu.png: PNG picture: 331x90x8 (alpha layer)
sheep_on_drugs.mp3: MPEG v1 layer III, 128.0 Kbit/sec, 44.1 KHz, Joint stereo
wormux_32x32_16c.ico: Microsoft Windows icon: 16x16x32

(it works like UNIX "file" program)

Filter metadatas with --level

hachoir-metadata is a too much verbose by default:

$ hachoir-metadata logo-Kubuntu.png
Image:
- Image width: 331
- Image height: 90
- Bits/pixel: 8
- Image format: Color index
- Creation date: 2006-05-26 09:41:46
- Compression: deflate
- MIME type: image/png
- Endian: Big endian

You can skip useless information (here, only until level 7):

$ hachoir-metadata --level=7 logo-Kubuntu.png
Image:
- Image width: 331
- Image height: 90
- Bits/pixel: 8
- Image format: Color index
- Creation date: 2006-05-26 09:41:46
- Compression: deflate

Example to get most importation informations:

$ hachoir-metadata --level=3 logo-Kubuntu.png
Image:
- Image width: 331
- Image height: 90
- Bits/pixel: 8
- Image format: Color index

Getting help: --help

Use --help option to get full option list.

See also

See also: file format resources.

Informations

Libraries

Programs

  • jpeginfo
  • ogginfo
  • mkvinfo
  • mp3info

Programs using metadata

Updated

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.