Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface VideoNode

Represents a video clip. The class itself supports indexing and slicing to perform trim, Reverse and SelectEvery operations.

Several operators are also defined for the VideoNode class: addition appends clips and multiplication repeats them.

Note that slicing and indexing always return a new VideoNode object and not a VideoFrame.

For TypeScript users: You will get a number from normal operators and will have to do as VideoNode to get typehinting back.

This is a limitation of the language as it doesn't support operator overloading and they can only be done on primitives.

Hierarchy

  • VideoNodeI
    • VideoNode

Index

Properties

[nodeOpaqueSymbol]: never
core: Core
flags: number

Special flags set for this clip. This attribute should normally be ignored.

format: VideoFormat

A VideoFormat object describing the frame data. If the format can change between frames (variable clip), this value is null.

fps: Fraction

The framerate represented as a Fraction. It is 0/1 when the clip has a variable framerate.

numerator: The numerator of the framerate. If the clip has variable framerate, the value will be 0.

denominator: The denominator of the framerate. If the clip has variable framerate, the value will be 1.

frameSize: number
height: number

The height of the video. This value will be 0 if the width and height can change between frames.

numFrames: number

The number of frames in the clip.

std: Plugin & { BlankClip: _getOverride<[width?: null | number, height?: null | number, format?: null | VideoFormat | PresetFormat, length?: null | number, fpsnum?: null | number, fpsden?: null | number, color?: null | number | number[], keep?: null | boolean], { color?: null | number | number[]; format?: null | VideoFormat | PresetFormat; fpsden?: null | number; fpsnum?: null | number; height?: null | number; keep?: null | boolean; length?: null | number; width?: null | number }> }
width: number

The width of the video. This value will be 0 if the width and height can change between frames.

Methods

  • getFrame(frame: number): Promise<Buffer>
  • getFrame(frame: number, buffer: Buffer): Promise<Buffer>
  • getFrame(frame: number, buffer: Buffer, callback: (err: Error, frame: number, buffer: Buffer) => void): null
  • Returns a promise of which the result will be a VideoFrame.

    throws

    {@link Error | Error} if there is an error during the frame request.

    Parameters

    • frame: number

    Returns Promise<Buffer>

  • Returns a VideoFrame from position n.

    throws

    {@link Error | Error} if there is an error during the frame request.

    Parameters

    • frame: number
    • buffer: Buffer

    Returns Promise<Buffer>

  • Returns a VideoFrame from position n.

    throws

    {@link Error | Error} if there is an error during the frame request.

    Parameters

    • frame: number
    • buffer: Buffer
    • callback: (err: Error, frame: number, buffer: Buffer) => void
        • (err: Error, frame: number, buffer: Buffer): void
        • Parameters

          • err: Error
          • frame: number
          • buffer: Buffer

          Returns void

    Returns null

  • output(fileStream: WriteStream, y4m?: boolean, progressUpdateCallback?: (current: number, total: number) => void, prefetch?: number, backlog?: number): void
  • Write the whole clip to the specified file handle. It is possible to pipe to stdout by specifying process.stdout as the file.

    Parameters

    • fileStream: WriteStream
    • Optional y4m: boolean

      YUV4MPEG2 headers will be added when true

    • Optional progressUpdateCallback: (current: number, total: number) => void

      will be reported the current progress to this callback function.

        • (current: number, total: number): void
        • Parameters

          • current: number
          • total: number

          Returns void

    • Optional prefetch: number

      is only for debugging purposes and should never need to be changed.

    • Optional backlog: number

      is only for debugging purposes and should never need to be changed.

    Returns void

  • setOutput(index: number, alpha: VideoNode, altOutput: number): Promise<Buffer>
  • Set the clip to be accessible for output. This is the standard way to specify which clip(s) to output.

    All VapourSynth tools (vsvfw, vsfs, vspipe) use the clip in index 0.

    It’s possible to specify an additional containing the alpha to output at the same time.

    Currently only vspipe takes alpha into consideration when outputting.

    The altOutput argument is for optional alternate output modes. Currently it controls the FOURCCs used for VFW-style output with certain formats.

    Parameters

    • index: number
    • alpha: VideoNode
    • altOutput: number

    Returns Promise<Buffer>

  • toFixed(): never
  • toPrecision(): never
  • toString(): string

Generated using TypeDoc