package faad

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type decoder = t
type t

An MP4 reader.

type track = int

A track number.

type sample = int

A sample number.

type read = bytes -> int -> int -> int

Data read. Same signature as Unix.read.

val is_mp4 : string -> bool

Detect whether the file is an MP4 given at least 8 bytes of its header.

val openfile : ?write:(Bytes.t -> int) -> ?seek:(int -> int) -> ?trunc:(unit -> int) -> read -> t

Open an MP4 file.

val openfile_fd : Unix.file_descr -> t
val tracks : t -> int

Total number of tracks.

val find_aac_track : t -> track

Find the first AAC track.

val init : t -> decoder -> track -> int * int

Initialize a decoder.

val seek : t -> track -> int -> int * int

Seek to the given offset, in audio samples. * returns a pair sample,toskip where * sample is the new current (mp4) sample * and toskip is an amount of audio sample * that should be skipped.

val samples : t -> track -> int
val read_sample : t -> track -> sample -> string
val decode : t -> track -> sample -> decoder -> float array array
val metadata : t -> (string * string) array
OCaml

Innovation. Community. Security.