Track / Track processing
track.audio.defer
Defer an audio track by a given amount of time. Track will be available when the given delay has been fully buffered. Use this operator instead of buffer when buffering large amount of data as initial delay.
Type:
(?id : string?, delay : float, ?overhead : float?, pcm_s16('a)) ->
pcm_s16('a)
Arguments:
id(of typestring?, which defaults tonull): Force the value of the track ID.delay(of typefloat): Duration of the delay, in seconds.overhead(of typefloat?, which defaults tonull): Duration of the delay overhead, in seconds. Defaults to frame size.(unlabeled)(of typepcm_s16('a)): Track to delay.
track.metadata
Return the metadata associated with the given track
Type:
(?id : string?, 'a) -> metadata where 'a is a track
Arguments:
id(of typestring?, which defaults tonull): Force the value of the track ID.(unlabeled)(of typeanything that is a track)
track.metadata.map
Rewrite metadata on the fly using a function.
Type:
(?id : string?, (([string * string]) -> [string * string]), ?update : bool,
?strip : bool?, ?insert_missing : bool?, metadata) -> metadata
Arguments:
id(of typestring?, which defaults tonull): Force the value of the track ID.(unlabeled)(of type([string * string]) -> [string * string]): A function that returns new metadata.update(of typebool, which defaults totrue): Update metadata. If false, existing metadata are cleared and only returned values are set as new metadata.strip(of typebool?, which defaults tonull): Completely remove empty metadata. Operates on both empty values and empty metadata chunk. Defaults tosettings.metadata.map.stripwhennull.insert_missing(of typebool?, which defaults tonull): Treat track beginnings without metadata as having empty ones. The operational order is: create empty if needed, map and strip if enabled. Defaults tosettings.metadata.map.insert_missingwhennull.(unlabeled)(of typemetadata)
track.metadata.merge
Merge metadata from all given tracks. If two sources have metadata with the same label at the same time, the one from the last source in the list takes precedence.
Type:
(?id : string?, [metadata]) -> metadata
Arguments:
id(of typestring?, which defaults tonull): Force the value of the track ID.(unlabeled)(of type[metadata])
track.on_subtitle
Call a callback on each subtitle in the track.
Type:
(?id : string?,
((
{
absolute_end_time : float,
absolute_start_time : float,
end_time : int,
forced : bool,
format : string,
position : int,
start_time : int,
text : string
}) -> unit),
subtitles) -> subtitles
Arguments:
id(of typestring?, which defaults tonull): Force the value of the track ID.(unlabeled)(of type( { absolute_end_time : float, absolute_start_time : float, end_time : int, forced : bool, format : string, position : int, start_time : int, text : string }) -> unit): Callback function called on each subtitle.(unlabeled)(of typesubtitles)
track.subtitles.insert
Allow inserting subtitles into the track. Returns the track with an insert_subtitle method.
Type:
(?id : string?, ?subtitles?) -> subtitles
Arguments:
id(of typestring?, which defaults tonull): Force the value of the track ID.(unlabeled)(of typesubtitles?, which defaults tonull)
Methods:
insert_subtitle(of type({duration : float, forced : bool, format : string, text : string}) -> unit): Insert a subtitle at the current position.
track.subtitles.map
Map a function over each subtitle in the track.
Type:
(?id : string?,
((
{
absolute_end_time : float,
absolute_start_time : float,
end_time : int,
forced : bool,
format : string,
position : int,
start_time : int,
text : string
}) -> {forced? : bool, format? : string, text? : string}?),
subtitles) -> subtitles
Arguments:
id(of typestring?, which defaults tonull): Force the value of the track ID.(unlabeled)(of type( { absolute_end_time : float, absolute_start_time : float, end_time : int, forced : bool, format : string, position : int, start_time : int, text : string }) -> {forced? : bool, format? : string, text? : string}?): Callback function called on each subtitle. Returns a record with optional fields to update (text, format, forced), or null to remove the subtitle.(unlabeled)(of typesubtitles)
track.track_marks
Return the track marks associated with the given track
Type:
(?id : string?, 'a) -> track_marks where 'a is a track
Arguments:
id(of typestring?, which defaults tonull): Force the value of the track ID.(unlabeled)(of typeanything that is a track)