Skip to content

node-av / lib / avRescaleQ

Function: avRescaleQ()

avRescaleQ(a, bq, cq): bigint

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

Rescale timestamp.

Rescales a timestamp from one time base to another.

Direct mapping to av_rescale_q().

Parameters

a

Timestamp to rescale

null | number | bigint

bq

IRational

Source time base

cq

IRational

Destination time base

Returns

bigint

Rescaled timestamp

Example

typescript
// Convert 1 second from 1000Hz to 90kHz
const rescaled = avRescaleQ(
  1000n,
  { num: 1, den: 1000 },   // 1000 Hz
  { num: 1, den: 90000 }   // 90 kHz
);
// Returns 90000n

See

av_rescale_q - FFmpeg Doxygen