Skip to content

Commit 2687a28

Browse files
committed
README.md: add installation and building sections
1 parent f00ed31 commit 2687a28

1 file changed

Lines changed: 39 additions & 39 deletions

File tree

README.md

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
Plugin akarin
2-
=============
1+
# Plugin akarin
32

4-
CAMBI
5-
-----
3+
## CAMBI
64
`akarin.Cambi(clip clip[, int window_size = 63, float topk = 0.6, float tvi_threshold = 0.019, bint scores = False, float scaling = 1.0/window_size])`
75

86
Computes the CAMBI banding score as `CAMBI` frame property. Unlike [VapourSynth-VMAF](https://github.com/HomeOfVapourSynthEvolution/VapourSynth-VMAF), this filter is online (no need to batch process the whole video) and provides raw cambi scores (when `scores == True`).
@@ -14,8 +12,7 @@ Computes the CAMBI banding score as `CAMBI` frame property. Unlike [VapourSynth-
1412
- `scores` (default: False): if True, for scale i (0 <= i < 5), the GRAYS c-score frame will be stored as frame property `"CAMBI_SCALE%d" % i`.
1513
- `scaling`: scaling factor used to normalize the c-scores for each scale returned when `scores=True`.
1614

17-
DLVFX
18-
-----
15+
## DLVFX
1916
`akarin.DLVFX(clip clip, int op[, float scale=1, float strength=0, int output_depth=clip.format.bits_per_sample, int num_streams=1])`
2017

2118
There are three operation modes ([official docs](https://docs.nvidia.com/deeplearning/maxine/pdf/vfx-sdk-programming-guide.pdf)):
@@ -34,9 +31,7 @@ Usage Notes:
3431
This filter requires appropriate [Video Effects library (v0.6 beta)](https://www.nvidia.com/en-us/geforce/broadcasting/broadcast-sdk/resources/) to be installed. (This library is too large to be bundled with the plugin.)
3532
This filter also requires RTX-capable NVidia GPU to run.
3633

37-
DLISR
38-
-----
39-
34+
## DLISR
4035
`akarin.DLISR(clip clip, [, int scale=2])`
4136

4237
This filter will use Nvidia [NGX Technology](https://developer.nvidia.com/rtx/ngx) DLISR DNN to scale up an input clip.
@@ -49,9 +44,7 @@ This filter requires RTX-capable NVidia GPU to run.
4944
Warning: <br>
5045
Due to peculiar nature of its implementation, this filter only works if it is the *only* CUDA filter in your script and it will always automatically choose the GPU to use. Please make sure to use CPU versions of other filters if you plan to use `DLISR` in the script (note that it's fairly computation extensive, so using other GPU filters will likely only slow things down anyway.)
5146

52-
Expr
53-
----
54-
47+
## Expr
5548
`akarin.Expr(clip[] clips, string[] expr[, int format, int opt=0, int boundary=0])`
5649

5750
This works just like [`std.Expr`](http://www.vapoursynth.com/doc/functions/expr.html) (esp. with the same SIMD JIT support on x86 hosts), with the following additions:
@@ -85,9 +78,7 @@ This works just like [`std.Expr`](http://www.vapoursynth.com/doc/functions/expr.
8578
- octals: 023 (however, invalid octal numbers will be parsed as floating points, so "09" will be parsed the same as "9.0")
8679
- (\*) Support **arbitrary** number of input clips. Use `srcN` to access the `N`-th input clip (i.e. `src0` is equivalent to `x`, `src25` is equivalent to `w`, etc.) There is no hardcoded limit on the number of input clips, however VS might not be able to handle too many. Up to `255` input clips have been tested.
8780

88-
Select
89-
----
90-
81+
## Select
9182
`akarin.Select(clip[] clip_src, clip[] prop_src, string[] expr)`
9283

9384
For each frame evaluate the expression `expr` where clip variables (`a-z`) references the corresponding frame from `prop_src`.
@@ -108,9 +99,7 @@ x = core.akarin.Select([src, flt], prop_clip, 'x._Combed 1 0 ?') # when x._Combe
10899
```
109100

110101

111-
PropExpr
112-
----
113-
102+
## PropExpr
114103
`akarin.PropExpr(clip[] clips, dict=lambda: dict(key=val))`
115104

116105
`PropExpr` is a filter to programmatically compute numeric frame properties. Given a list of clips, it will return the first clip after modifying its frame properties as specified by the dict argument. The expressions have access to the frame property of all the clips.
@@ -134,9 +123,7 @@ Some examples:
134123
Note: this peculiar form of specifying the properties is to workaround a limitation of the VS API.
135124

136125

137-
Text
138-
----
139-
126+
## Text
140127
Text is an enhanced `text.Text`:
141128
- It takes Python format string so that the text for each frame can be based on frame properties. No need to resort to `std.FrameEval` and dynamic `text.Text` filter creation. But note this filter by itself does not support any computation on the frame properties, so if you want to display, say, `x.Prop1 * 10 + y.Prop2`, you will have to use `PropExpr` before hand to compute the value (e.g. `c.akarin.PropExpr(lambda: dict(PropToShow="x.Prop1 10 * y.Prop2 +")).akarin.Text("{PropToShow}")`).
142129
- It also support saving the formated string as a frame property (via `prop` argument), so that you can pass the formatted string to other filters (e.g. assrender).
@@ -162,9 +149,7 @@ The filter supports formatting int/float scalar or arrays, data (shown as string
162149
`vspipe` will determine whether to overlay the OSD when the script is run under vspipe. The default `False` means the OSD will only be visible when the script is run in previewers, not when encoding with vspipe. The check is done by checking the executable name of the current process for "vspipe" (Unix) or "vspipe.exe" (Windows). This setting does not affect `prop`.
163150

164151

165-
Version
166-
----
167-
152+
## Version
168153
`akarin.Version()`
169154

170155
Use this function to query the version and features of the plugin. It will return a Python dict with the following keys:
@@ -201,21 +186,36 @@ When reporting issues, please also try limiting the ISA to a lower level (at lea
201186
If the `opt` argument is set to 1 (default 0), then it will activate an integer optimization mode, where intermediate values are computed with 32-bit integer for as long as possible. You have to make sure the intermediate value is always representable with int32 to use this optimization (as arithmetics will warp around in this mode.)
202187

203188

204-
Building
205-
--------
206-
To build the plugin, you will need LLVM 19-20 installed (on Windows, you need to build your own) and have llvm-config executable in your PATH, then run:
207-
```
208-
meson build
209-
ninja -C build install
210-
```
189+
## Installation
211190

212-
Example LLVM build procedure on windows:
191+
```bash
192+
pip install vapoursynth-akarin
213193
```
214-
git clone --depth 1 https://github.com/llvm/llvm-project.git --branch release/20.x
215-
cd llvm-project
216-
mkdir build
217-
cd build
218-
cmake -A x64 -Thost=x64 -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="" -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_USE_CRT_RELEASE=MT ../llvm
219-
cmake --build --config Release
220-
cmake --install ../install
194+
195+
## Building
196+
197+
### Windows
198+
199+
**Requirements:**
200+
201+
- [MSYS2](https://www.msys2.org/)
202+
203+
1. Open the **MSYS2 CLANG64** terminal.
204+
2. Install the necessary build tools and dependencies:
205+
```bash
206+
pacman -S mingw-w64-clang-x86_64-{toolchain,meson,ninja,pkgconf,libxml2,uv}
207+
```
208+
3. Build the wheel:
209+
```bash
210+
uv build --wheel
211+
```
212+
213+
> [!NOTE]
214+
> When building with LLVM 17 or newer, the plugin will depend on `libzstd.dll`.
215+
> You may need to manually copy this DLL from your MSYS2 installation (`/clang64/bin/libzstd.dll`) to the plugin directory if it is not already in your PATH.
216+
217+
### Linux & macOS
218+
219+
```bash
220+
nix build -L .#llvm_22.dist
221221
```

0 commit comments

Comments
 (0)