@vestra-player/sdk - v1.11.3
    Preparing search index...

    Type Alias VideoNode

    VideoNode:
        | {
            kind: "eq";
            brightness: number;
            contrast: number;
            saturation: number;
            gamma: number;
        }
        | { kind: "gblur"; sigma: number; steps: 3 }
        | { kind: "hue"; degrees: number }
        | { kind: "sharpen"; amount: number; size: "small" | "large" }
        | {
            kind: "denoise";
            lumaSpatial: number;
            chromaSpatial: number;
            lumaTemporal: number;
            chromaTemporal: number;
        }
        | { kind: "deblock"; strength: "weak"
        | "strong" }
        | { kind: "deband"; threshold: number; range: number }
        | {
            kind: "transform";
            rotate: 0 | 90 | 180 | 270;
            flipH: boolean;
            flipV: boolean;
        }
        | {
            kind: "deinterlace";
            when: "interlaced"
            | "all"
            | "auto";
            output: "frame" | "field";
        }
        | {
            kind: "reframe";
            mode: "crop"
            | "pad";
            aspect: number;
            x: number;
            y: number;
        }
        | { kind: "frameBlend"; fps: number }
        | { kind: "convolution"; planes: (ConvolutionPlane | null)[] }
        | {
            kind: "lut3d";
            file: string;
            interpolation:
                | "nearest"
                | "trilinear"
                | "tetrahedral"
                | "pyramid"
                | "prism";
        }

    One node of a VideoFilter chain, by kind. Values outside the ranges below fail with invalid. Fields marked "live" change in place while playing; changing any other field rebuilds the stage (the picture may stall for one frame), so drive sliders with live fields.

    Nodes act after the player's own orientation handling (container rotation): a portrait video is upright before transform runs. At most 64 nodes across all plugins.

    Type Declaration

    • {
          kind: "eq";
          brightness: number;
          contrast: number;
          saturation: number;
          gamma: number;
      }

      FFmpeg eq; every field is live.

      • kind: "eq"

        The node type.

      • brightness: number

        −1–1, 0 = unchanged.

      • contrast: number

        0–2, 1 = unchanged.

      • saturation: number

        0–2, 1 = unchanged.

      • gamma: number

        0.5–2, 1 = unchanged.

    • { kind: "gblur"; sigma: number; steps: 3 }

      Gaussian blur (FFmpeg gblur).

      • kind: "gblur"

        The node type.

      • sigma: number

        0–10 (live).

      • steps: 3

        Always 3.

    • { kind: "hue"; degrees: number }

      Hue rotation; changes in place while playing.

      • kind: "hue"

        The node type.

      • degrees: number

        −180–180 (live).

    • { kind: "sharpen"; amount: number; size: "small" | "large" }

      unsharp: 3×3 (small) or 7×7 (large) luma matrix.

      • kind: "sharpen"

        The node type.

      • amount: number

        0–2.

      • size: "small" | "large"

        Matrix size.

    • {
          kind: "denoise";
          lumaSpatial: number;
          chromaSpatial: number;
          lumaTemporal: number;
          chromaTemporal: number;
      }

      hqdn3d strengths.

      • kind: "denoise"

        The node type.

      • lumaSpatial: number

        0–20 (0 = off).

      • chromaSpatial: number

        0–20 (0 = off).

      • lumaTemporal: number

        0–20 (0 = off).

      • chromaTemporal: number

        0–20 (0 = off).

    • { kind: "deblock"; strength: "weak" | "strong" }

      FFmpeg deblock.

      • kind: "deblock"

        The node type.

      • strength: "weak" | "strong"

        Filter strength.

    • { kind: "deband"; threshold: number; range: number }

      FFmpeg deband.

      • kind: "deband"

        The node type.

      • threshold: number

        0.003–0.5, the same for all four planes.

      • range: number

        Integer 1–64.

    • {
          kind: "transform";
          rotate: 0 | 90 | 180 | 270;
          flipH: boolean;
          flipV: boolean;
      }

      Applied after the player's own source orientation.

      • kind: "transform"

        The node type.

      • rotate: 0 | 90 | 180 | 270

        Clockwise degrees; applied before the flips.

      • flipH: boolean

        Mirror horizontally.

      • flipV: boolean

        Mirror vertically.

    • {
          kind: "deinterlace";
          when: "interlaced" | "all" | "auto";
          output: "frame" | "field";
      }

      Deinterlacing. interlaced and all are FFmpeg BWDIF in the chain; field doubles the frame rate.

      when: "auto" is the player's own deinterlacer instead: decided per frame from the decoder's interlaced flag, with the decoder's hardware deinterlacer where frames stay on the GPU; progressive frames pass untouched. It needs no frames in memory, so a chain with only this node keeps zero-copy hardware decoding (any other node still needs a copy back to memory). It always outputs one frame per field, so it takes output: "field" only ("frame" fails with invalid). It runs before every plugin's chain wherever it is written, and is shared: on while any plugin's chain has one. A chain with it has no other deinterlace node. Snapshots and exports deinterlace the same frames with BWDIF at field rate.

      • kind: "deinterlace"

        The node type.

      • when: "interlaced" | "all" | "auto"

        interlaced: only frames flagged interlaced; all: every frame; auto: the player's deinterlacer, on frames flagged interlaced.

      • output: "frame" | "field"

        One frame per frame, or one per field (double rate); when: "auto" takes field only.

    • { kind: "reframe"; mode: "crop" | "pad"; aspect: number; x: number; y: number }

      Crop to / pad to a display aspect; x, y place it (−1 left/top … 1 right/bottom).

      • kind: "reframe"

        The node type.

      • mode: "crop" | "pad"

        Crop the picture, or pad it with black bars.

      • aspect: number

        Target display aspect 0.25–4.

      • x: number

        −1 (left) … 0 (centre) … 1 (right).

      • y: number

        −1 (top) … 0 (centre) … 1 (bottom).

    • { kind: "frameBlend"; fps: number }

      Blended frame-rate conversion (FFmpeg framerate), an integer 24–120. At most one across all plugins; the player runs it after every chain.

      • kind: "frameBlend"

        The node type.

      • fps: number

        Output frame rate, integer 24–120.

    • { kind: "convolution"; planes: (ConvolutionPlane | null)[] }

      A convolution matrix of your own per plane (FFmpeg convolution): sharpen, blur, emboss or detect edges with a 3×3, 5×5 or 7×7 kernel, or a row or column kernel. planes[i] is plane i of the decoded picture: for the usual YUV video 0 is luma (brightness), 1 and 2 are the colour planes, 3 is alpha. A missing entry or null leaves that plane as it is; at least one entry has a matrix.

      • kind: "convolution"

        The node type.

      • planes: (ConvolutionPlane | null)[]

        1–4 entries, by plane; null passes the plane through.

    • {
          kind: "lut3d";
          file: string;
          interpolation:
              | "nearest"
              | "trilinear"
              | "tetrahedral"
              | "pyramid"
              | "prism";
      }

      Recolour the picture with a 3D look-up table (FFmpeg lut3d): a .cube file the plugin ships in its package or wrote to its Plugin.dataDirectory. The player reads the file when the chain is set (and again for each new source, snapshot or export), so it must stay there while the chain uses it. The table is applied to RGB; the player converts the picture to RGB and back.

      • kind: "lut3d"

        The node type.

      • file: string

        Absolute path of a .cube file (LUT_3D_SIZE 2–65, at most 16 MiB) inside the plugin's package directory or data directory after following links; a path with [ or ] is refused. Outside those: invalid; a file that does not exist: missing.

        The player checks only that header; the table itself is read by FFmpeg's .cube reader (parse_cube in FFmpeg's libavfilter/vf_lut3d.c), which takes a subset of the Adobe/Resolve format:

        • Every line before LUT_3D_SIZE N is skipped (a TITLE, comments, and also a DOMAIN_MIN or DOMAIN_MAX there, which then has no effect).
        • After it, optional TITLE, DOMAIN_MIN r g b and DOMAIN_MAX r g b lines (default 0 0 0 and 1 1 1), blank lines and # comments, then N³ data lines of three numbers r g b, red changing fastest, then green, then blue.
        • Any other keyword after LUT_3D_SIZE, such as MIN or MAX, is read as a data line, and FFmpeg refuses the file, as it does one with fewer than N³ data lines. The chain then fails and the player reports mpv's "error running command (-12)".
        TITLE "Identity"
        LUT_3D_SIZE 2
        DOMAIN_MIN 0 0 0
        DOMAIN_MAX 1 1 1
        0 0 0
        1 0 0
        0 1 0
        1 1 0
        0 0 1
        1 0 1
        0 1 1
        1 1 1
        
      • interpolation: "nearest" | "trilinear" | "tetrahedral" | "pyramid" | "prism"

        How colours between the table's points are computed; tetrahedral is FFmpeg's default.

    The video plays a little brighter and more saturated, slightly sharper and turned a quarter clockwise. The nodes run in array order; set sends the whole chain as this plugin's desired value (last write wins), and the player applies it to every source until it changes (the chain follows the source by itself while it is set).

    const chain: VideoNode[] = [
    // Live fields: moving them later changes the picture in place.
    { kind: "eq", brightness: 0.05, contrast: 1.1, saturation: 1.2, gamma: 1 },
    // Not live: changing `amount` later rebuilds the stage (a one-frame stall).
    { kind: "sharpen", amount: 0.5, size: "small" },
    { kind: "transform", rotate: 90, flipH: false, flipV: false },
    ];
    plugin.video.filter("picture").set(chain);

    1.0.0