Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vf_vapoursynth: upgrade to VapourSynth API v4 #14326

Merged
merged 1 commit into from
Jun 13, 2024

Commits on Jun 13, 2024

  1. vf_vapoursynth: upgrade to VapourSynth API v4

    VapourSynth introduced their version 4 API in R55, 3 years ago. mpv is
    still using the deprecated version 3. I think it is good to migrate
    before VapourSynth completely removes it.
    
    The most impacted area is the video format. Previously we have a fixed
    table of supported formats, each represented by an integer. In v4, the
    integer is replaced by pointer to the full struct of the format.
    
    Second, the way to create video filter is changed. Previously caller
    needs to supply a "initialization" callback to `createFilter()`, which
    sets up video info etc. In v4, video info is prepared first, passed to
    the `createVideoFilter2()` and we get back the node.
    
    Also, previously mpv was using the `fmSerial` filter mode, which means
    VapourSynth 1) can only request one frame from mpv at a time, and 2) the
    order of frames requested must be sequential. I propose to change it to
    the parallel request mode, which requests multiple frames at a time in
    semi random order. The reasons are, for 1), the get frame function,
    `infiltGetFrame()`, unlocks the mutex during output image generation,
    thus can benefit from parallel requests. For 2) thanks to the frame
    buffer, unordered frame requests are acceptable. Just make sure the
    buffer is large enough.
    
    Third, the way VapourSynth scripting environment works change. In v4,
    the scripting API is operated through struct pointer, much like the
    exist `vsapi` pointer. The "finalize" function is also no longer needed.
    CrendKing committed Jun 13, 2024
    Configuration menu
    Copy the full SHA
    ba652cd View commit details
    Browse the repository at this point in the history