module Mp4:sig..end
typedecoder =Faad.t
type t
An MP4 reader.
typetrack =int
A track number.
typesample =int
A sample number.
val is_mp4 : string -> boolDetect whether the file is an MP4 given at least 8 bytes of its header.
val openfile : ?write:(Stdlib.Bytes.t -> int) ->
?seek:(int -> int) ->
?trunc:(unit -> int) -> (int -> Stdlib.Bytes.t * int * int) -> tOpen an MP4 file.
val openfile_fd : Unix.file_descr -> t
val tracks : t -> intTotal number of tracks.
val find_aac_track : t -> trackFind the first AAC track.
val init : t -> decoder -> track -> int * intInitialize a decoder.
val seek : t -> track -> int -> int * intSeek 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