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

    Interface VideoMotion

    plugin.video.motion(engine): motion smoothing, the video's frame rate doubled by a GPU vendor's frame-rate converter (AMD AMF's or NVIDIA's fruc_vulkan, on Windows). Read whether it works here and why not; choose a mode for this plugin.

    The converter makes real in-between frames (motion estimation, not blending). While some plugin asks for a mode that can work, the player puts the converter last in the video filter chain, decodes with copy-back (the converter needs the frames in memory) and, for display, has the GPU renderer interpolate the doubled frames to the display. The strongest mode any plugin asked for applies; a stopped plugin's request is revoked.

    The player watches the converter while the video plays: when its output falls behind the doubled rate or many frames are dropped, it first switches to a faster motion search on downscaled frames, then turns the converter off for this video with an overload reason. The next video starts afresh.

    Motion smoothing and AI upscaling exclude each other (the upscaler needs the frames on the GPU, the converter in memory): while upscaling is on, every mode waits with upscaling. Doubling makes film look like video (the "soap-opera effect"): offer it off by default.

    Windows: amd: an AMD Radeon GPU with the AMD driver (AMF); nvidia: an NVIDIA GeForce RTX 30 or newer GPU with driver 573.38 or newer (the converter gets a Vulkan device of its own while it runs, the renderer is not involved; it starts on slow optical flow on a 4-pixel grid, fast above 1440p). On a laptop with two GPUs the converter runs on the engine's GPU, whichever GPU renders. One engine's converter at a time: the other's modes wait with other-engine. macOS, Linux: every mode reports platform.

    Each command chooses one mode; one the player cannot run here is refused with unsupported, and the state is read again for its reason.

    let state: MotionState | null = null; // unknown until first picked
    for (const mode of ["off", "double", "display"] as const)
    plugin.commands.add({
    id: `motion.${mode}`,
    title: mode,
    radio: true,
    checked: () => (state?.mode ?? "off") === mode,
    run: async () => {
    try {
    state = await plugin.video.motion("amd").set(mode);
    } catch (error) {
    // Cannot work in this run (no AMD GPU, Match Display in software…).
    if ((error as PluginError).code !== "unsupported") throw error;
    state = await plugin.video.motion("amd").state();
    }
    },
    });

    0.8.1

    1.7.19

    interface VideoMotion {
        state(): Promise<MotionState>;
        set(mode: MotionMode): Promise<MotionState>;
        onChange(listener: (state: MotionState) => void): Disposable;
    }
    Index
    • Read this plugin's mode, what the player does now and why each mode cannot work.

      Returns Promise<MotionState>

      The state. The first call of any plugin looks for the GPU (no device is created, so no GPU is woken).

      The plugin reads the state when its panel shows; a reason greys the mode out with the player's message.

      const { display } = await plugin.video.motion("amd").state();
      if (display) console.log(display.message);

      disabled (rejects) The plugin is stopping.

      1.7.19

    • Choose this plugin's motion smoothing mode.

      Parameters

      Returns Promise<MotionState>

      The new state.

      The mode stays this plugin's request until it changes it or stops; the player applies it whenever it can work (a rate, size, format, doubling, other-engine, upscaling, failed or overload reason can pass with the next video). off takes the converter out at once unless another plugin asks for it. The mode is a request of the whole plugin, not of a Scope.

      invalid (rejects) mode is not one of the three.

      unsupported (rejects) A mode that cannot work in this run: platform, no-gpu, runtime, filter, and rendering for display once GPU rendering is not just starting; message is the reason. Nothing changes. off is always accepted.

      The plugin asks for Match Display and tells the user when it waits (the video's rate, AI upscaling) or cannot work in this run.

      try {
      const state = await plugin.video.motion("amd").set("display");
      // Kept, but waiting for a reason that can pass.
      if (state.active === "off" && state.display)
      await plugin.osd.show("Motion smoothing waits: {}", [state.display.message]);
      } catch (error) {
      // Cannot work in this run: nothing changed.
      if ((error as PluginError).code !== "unsupported") throw error;
      await plugin.osd.show("Motion smoothing: {}", [(error as PluginError).message]);
      }

      1.7.19

    • Call listener with the new state whenever it changes while some plugin asks for motion smoothing: what is active, the reasons, the search mode, the rates.

      Parameters

      • listener: (state: MotionState) => void

        Receives the new state.

      Returns Disposable

      Stops listening; also when the scope that added it is disposed.

      The player looks twice a second while a mode is asked for and sends a change only when something differs (the measured output rate in tenths); after the last plugin turns it off one more change says so. Nothing is sent before the first state() or set() of any plugin. mode is this plugin's own request, as in state().

      A listener keeps the plugin running, as VideoUpscaling.onChange's does: listen only while a window or panel shows the state.

      The plugin listens only while its panel shows, since the listener keeps the plugin running.

      const watch = plugin.video.motion("amd").onChange((state) => {
      console.log(`${state.sourceFps ?? "?"} → ${state.outputFps ?? "off"} fps on ${state.gpu ?? "no GPU"}`);
      });
      // When the panel hides:
      await watch.dispose();

      1.7.19