Skip to content

node-av / lib / avTs2TimeStr

Function: avTs2TimeStr()

avTs2TimeStr(ts, timeBase): string

Defined in: src/lib/utilities.ts:522

Convert timestamp to time string.

Converts a timestamp to a time string using the specified time base.

Direct mapping to av_ts2timestr().

Parameters

ts

Timestamp value

null | number | bigint

timeBase

Time base for conversion

null | IRational

Returns

string

Time string representation

Example

typescript
const timeStr = avTs2TimeStr(90000n, { num: 1, den: 90000 }); // Returns "1.000000"
const nopts = avTs2TimeStr(null, { num: 1, den: 1000 });      // Returns "NOPTS"

See

av_ts2timestr - FFmpeg Doxygen