File: README.md

package info (click to toggle)
ocaml-metadata 0.3.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 624 kB
  • sloc: ml: 1,980; makefile: 33; sh: 5
file content (40 lines) | stat: -rw-r--r-- 907 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
The metadata library
====================

A pure OCaml library to read metadata from various formats. For now, are
supported:

- audio formats: ID3v1 and ID3v2 (for mp3), ogg/vorbis, ogg/opus, flac and wav
- image formats: jpeg and png
- video formats: mp4 and avi
- text formats: pdf

Usage
-----

Basic usage is

```ocaml
let () =
  let metadata = Metadata.parse_file "test.mp3" in
  List.iter (fun (k,v) -> Printf.printf "- %s: %s\n" k v) metadata
```

In the above example, the function `Metadata.parse_file` takes a file name as
argument and returns an association list describing its metadata. It consists of
pairs of strings being the name of the metadata and its value.

Installing
----------

The preferred way is via opam:

```bash
opam install metadata
```

Other libraries
---------------

- [ocaml-taglib](https://github.com/savonet/ocaml-taglib): for tags from audio
  files (mp3, ogg, etc.)