Skip to main content

vs-fgs

A VapourSynth plugin for applying Film Grain Synthesis' table (FGS) using the dav1d decoder.

Since dav1d is widely regarded as the best and fastest AV1 decoder available, its FGS engine is fully spec-compliant with AFGS1 (AOMedia Film Grain Synthesis 1), guaranteeing highly accurate, performant, and standardized grain generation.

vsfgs parses standard FGS text files and applies film grain to the input clip natively in 8-bit, 10-bit, or 12-bit YUV. It also handles automatic dithering if the input bit depth is higher.

Installation

pip install vsfgs

Usage

import vapoursynth as vs
import vsfgs

core = vs.core

# 1. Load your video
clip = your_video_loader("source.mkv")

# 2. Apply Film Grain
# - ignore_chroma: If True, grain is only applied to Luma (Chroma is copied).
# - static: If True, uses the seed from the FGS table for all frames (if dynamic FGS, per event). If False, rotates the seed for each frame.
# - simd: Hardware SIMD architecture ('auto', 'avx512', 'avx2', 'sse41', 'sse3', 'sse2', or 'none'/'c' for plain C). Defaults to 'auto'.
clip = vsfgs.apply_fgs(clip, "grain_table.txt", ignore_chroma=False, static=False, simd="auto")

clip.set_output()

Frame Properties

For each processed frame, vsfgs outputs the exact seed integer used during synthesis into the VapourSynth frame properties map: FGS_Seed

Advanced Customization

vsfgs allows for extreme and advanced customization of the film grain pattern. The logic for synthesizing grain relies on a detailed parameter table. For an advanced visual editor to fine-tune these parameters and for more details on the grain configuration, please refer to the FGSEditor wiki: https://github.com/PingWer/FGSEditor

Performance & Compatibility

vsfgs uses dav1d's hand-written Assembly instructions (AVX-512, AVX2, SSE3 ...), resulting in extremely high throughput with almost zero overhead.

Platform Support:

OS Architecture Supported Tested
Windows x86_64, ARM64 ✅ ✅
Linux x86_64, aarch64 ✅ ❌
macOS x86_64, Apple Silicon ✅ ❌

Benchmark Comparison (2,000 frames of real 1080p source via BestSource): Tests compared vsfgs against Grainer.GAUSS (from vsjetpack). It also demonstrates the speedup of dav1d's hardware SIMD Assembly optimizations over unvectorized reference C code (simd='none').

Format Baseline (BestSource + 16bit conversion) vsfgs (SIMD: Auto / AVX-512) vsfgs (SIMD: None / Plain C) Grainer.GAUSS (vsjetpack)
YUV420P16 ~1128 FPS ~557 FPS ~514 FPS ~347 FPS
YUV422P16 ~866 FPS ~434 FPS ~425 FPS ~322 FPS
YUV444P16 ~649 FPS ~305 FPS ~299 FPS ~279 FPS

Building from Source

To compile the plugin manually, you must have a working C++ toolchain and Meson setup. The plugin depends on dav1d, which will be built automatically as a Meson subproject.

Prerequisites

  • Python 3.13+ (or newer)
  • C++ Compiler: GCC/Clang (Linux/macOS) or MSVC (Windows)
  • Meson & Ninja: Build system (pip install meson ninja)
  • nasm: Highly recommended for x86/x64 systems to enable dav1d assembly optimizations (drastically improves grain synthesis performance).
    • Windows: choco install nasm
    • Linux: sudo apt-get install nasm or sudo dnf install nasm
    • macOS: brew install nasm

Build Steps

  1. Clone the repository recursively to fetch the dav1d submodule:

    git clone --recursive https://github.com/PingWer/vs-fgs.git
    cd vs-fgs
    
  2. Build and install the plugin directly into your active Python environment:

    pip install .
    

Standalone Build (Without Python Installation)

If you only want to compile the VapourSynth plugin binary (DLL/SO/DYLIB) without installing it via pip, you can use Meson directly:

meson setup build --buildtype=release
meson compile -C build

License

This project is licensed under the MIT License.

Metadata

Release files for vsfgs 0.5.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vsfgs 0.5.1
File Size Uploaded
vsfgs-0.5.1.tar.gz 1.7 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for vsfgs 0.5.1
File
vsfgs-0.5.1-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details
vsfgs-0.5.1-cp314-cp314-musllinux_1_2_x86_64.whl CPython 3.14 CPython 3.14 Linux musl 1.2+ x86-64 Details
vsfgs-0.5.1-cp314-cp314-musllinux_1_2_aarch64.whl CPython 3.14 CPython 3.14 Linux musl 1.2+ ARM64 Details
vsfgs-0.5.1-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.24+ x86-64, Linux glibc 2.28+ x86-64 Details
vsfgs-0.5.1-cp314-cp314-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl CPython 3.14 CPython 3.14 Linux glibc 2.24+ ARM64, Linux glibc 2.28+ ARM64 Details
vsfgs-0.5.1-cp314-cp314-macosx_11_0_arm64.whl CPython 3.14 CPython 3.14 macOS 11.0+ ARM64 Details
vsfgs-0.5.1-cp314-cp314-macosx_10_15_x86_64.whl CPython 3.14 CPython 3.14 macOS 10.15+ x86-64 Details
vsfgs-0.5.1-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details
vsfgs-0.5.1-cp313-cp313-musllinux_1_2_x86_64.whl CPython 3.13 CPython 3.13 Linux musl 1.2+ x86-64 Details
vsfgs-0.5.1-cp313-cp313-musllinux_1_2_aarch64.whl CPython 3.13 CPython 3.13 Linux musl 1.2+ ARM64 Details
vsfgs-0.5.1-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.28+ x86-64, Linux glibc 2.24+ x86-64 Details
vsfgs-0.5.1-cp313-cp313-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl CPython 3.13 CPython 3.13 Linux glibc 2.28+ ARM64, Linux glibc 2.24+ ARM64 Details
vsfgs-0.5.1-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details
vsfgs-0.5.1-cp313-cp313-macosx_10_13_x86_64.whl CPython 3.13 CPython 3.13 macOS 10.13+ x86-64 Details

Total release size: 6.8 MB

Release files / vsfgs-0.5.1.tar.gz

Download URL vsfgs-0.5.1.tar.gz
Size 1.7 MB
Tags Source
SHA-256 checksum
How to use checksums
15bae9c2c1c3c87c0eaa850fbee92e2fe3d8c9e31666d30c5695fc4d91fb1e2b
BLAKE2b-256 checksum
How to use checksums
8fc13f0c627a48859dc0472c8a5fc0e681cd78572c2b25e50b755bd714e1c01b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 26, 2026.

Transparency log

Release files / vsfgs-0.5.1-cp314-cp314-win_amd64.whl

Download URL vsfgs-0.5.1-cp314-cp314-win_amd64.whl
Size 77.8 kB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
261124585e4a0b6be563811581f3d8e028f628c81a1a865579f2147315521f12
BLAKE2b-256 checksum
How to use checksums
e0f9e73347aa388e5edeab1cd7a17ef8d66c4434d7dd47b97ff7138535bcc54e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 26, 2026.

Transparency log

Release files / vsfgs-0.5.1-cp314-cp314-musllinux_1_2_x86_64.whl

Download URL vsfgs-0.5.1-cp314-cp314-musllinux_1_2_x86_64.whl
Size 1.1 MB
Tags CPython 3.14 Linux musl 1.2+ x86-64
SHA-256 checksum
How to use checksums
1edc743e7858bda9950abae9323bb3f983b4ba92c058c70307c18abbccd66403
BLAKE2b-256 checksum
How to use checksums
bb9885f4e7834a282ef6bdca7c477d1c51de2ad9ac1e66d0947269d876aaa2fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 26, 2026.

Transparency log

Release files / vsfgs-0.5.1-cp314-cp314-musllinux_1_2_aarch64.whl

Download URL vsfgs-0.5.1-cp314-cp314-musllinux_1_2_aarch64.whl
Size 1.0 MB
Tags CPython 3.14 Linux musl 1.2+ ARM64
SHA-256 checksum
How to use checksums
d8caa5c14e1df9ef541857f625dd1277c6ebc058dbfc92dbfa3edbacee02cdbf
BLAKE2b-256 checksum
How to use checksums
2da97008c650257ebec1faeb4383fb35d4e41cdbd55424c40f4ee87a18458eb0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 26, 2026.

Transparency log

Release files / vsfgs-0.5.1-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl

Download URL vsfgs-0.5.1-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Size 94.6 kB
Tags CPython 3.14 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
3a9a9a859efef4fabc4a4aec7ef734c3e1a6016943c40fd067e1501fa09f3335
BLAKE2b-256 checksum
How to use checksums
58963430dfdc06920019e4068cde38cdfd7125ab36ae86878a8a7036932ebb8a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 26, 2026.

Transparency log

Release files / vsfgs-0.5.1-cp314-cp314-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl

Download URL vsfgs-0.5.1-cp314-cp314-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Size 55.1 kB
Tags CPython 3.14 Linux glibc 2.24+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
9913370ae0d2eb98d3ce522ddc2a5e13b84df98e7079cd041f4b92bd3eab9b17
BLAKE2b-256 checksum
How to use checksums
73a2e4373a2dab50ae34e03fb3a095479b870fb536475d35779f470051f6f2df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 26, 2026.

Transparency log

Release files / vsfgs-0.5.1-cp314-cp314-macosx_11_0_arm64.whl

Download URL vsfgs-0.5.1-cp314-cp314-macosx_11_0_arm64.whl
Size 52.0 kB
Tags CPython 3.14 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
fea288c7db93270196bcad4d100dd73375f84fded020d8f9274f0f5724923bd4
BLAKE2b-256 checksum
How to use checksums
a3d64f769cf9c92e2bebad9f8c29886e80c9fe31de50d3b18d9eb88cb406620b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 26, 2026.

Transparency log

Release files / vsfgs-0.5.1-cp314-cp314-macosx_10_15_x86_64.whl

Download URL vsfgs-0.5.1-cp314-cp314-macosx_10_15_x86_64.whl
Size 79.6 kB
Tags CPython 3.14 macOS 10.15+ x86-64
SHA-256 checksum
How to use checksums
a847b9f45e024bb25a95348e85bac85864e06f7cbf00b6619064f31b9d744450
BLAKE2b-256 checksum
How to use checksums
9014dc664455e417fcee1ea6bec294d1a976219210ec6d8abf2d1c41f5d0b4f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 26, 2026.

Transparency log

Release files / vsfgs-0.5.1-cp313-cp313-win_amd64.whl

Download URL vsfgs-0.5.1-cp313-cp313-win_amd64.whl
Size 76.1 kB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
e474a7fdb0d49a946510e6e61816c50cc6c7f5205cc1e0c316ad3bccb2fd26a9
BLAKE2b-256 checksum
How to use checksums
4e34844a7de90eacddb06b500734c012d2f2afcadb575c6bc875089ececdfd31
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 26, 2026.

Transparency log

Release files / vsfgs-0.5.1-cp313-cp313-musllinux_1_2_x86_64.whl

Download URL vsfgs-0.5.1-cp313-cp313-musllinux_1_2_x86_64.whl
Size 1.1 MB
Tags CPython 3.13 Linux musl 1.2+ x86-64
SHA-256 checksum
How to use checksums
dedf1a28af5ece6f74e3244761b353325a5812632cce702b212e80e877239358
BLAKE2b-256 checksum
How to use checksums
0bb1f00487cf7ce4604fe170548ee5e89ec0cb1966e78ab3bd224b3dadc58392
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 26, 2026.

Transparency log

Release files / vsfgs-0.5.1-cp313-cp313-musllinux_1_2_aarch64.whl

Download URL vsfgs-0.5.1-cp313-cp313-musllinux_1_2_aarch64.whl
Size 1.0 MB
Tags CPython 3.13 Linux musl 1.2+ ARM64
SHA-256 checksum
How to use checksums
dc28694d58f66011a763fb5509a236c368f186078da7fae8505d41f5fd48b2a6
BLAKE2b-256 checksum
How to use checksums
0435d64e66f962d5d81dd22d7e495e0e2f5ba4a3488979206e52b950d0275052
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 26, 2026.

Transparency log

Release files / vsfgs-0.5.1-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl

Download URL vsfgs-0.5.1-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Size 94.6 kB
Tags CPython 3.13 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
f7d91f6ddb5945f89d94bea115bad17cd6d231e79a477afa2b30713caf5ba3a3
BLAKE2b-256 checksum
How to use checksums
807b39f3708d48d09455cb753ba56787bc79ccc90aee2220313d92eb006ea143
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 26, 2026.

Transparency log

Release files / vsfgs-0.5.1-cp313-cp313-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl

Download URL vsfgs-0.5.1-cp313-cp313-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Size 55.1 kB
Tags CPython 3.13 Linux glibc 2.24+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
9e373bd1987ed016e2354411b93eec37268ca76e07c2324179d6cf8054f730d1
BLAKE2b-256 checksum
How to use checksums
de63cf75a6dfcb41694b251a074be4c1141f207a60ae98da40232ee2e0d5824a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 26, 2026.

Transparency log

Release files / vsfgs-0.5.1-cp313-cp313-macosx_11_0_arm64.whl

Download URL vsfgs-0.5.1-cp313-cp313-macosx_11_0_arm64.whl
Size 52.0 kB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
06e7da5d058e6933cd0f3b1eafe4ae0813cd77b21d1d998653782818eacad06f
BLAKE2b-256 checksum
How to use checksums
ee38022a7d2d28dd6b9225d8d5c33bb2e18a944f29830bd9884f0b91ed256ca6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 26, 2026.

Transparency log

Release files / vsfgs-0.5.1-cp313-cp313-macosx_10_13_x86_64.whl

Download URL vsfgs-0.5.1-cp313-cp313-macosx_10_13_x86_64.whl
Size 79.5 kB
Tags CPython 3.13 macOS 10.13+ x86-64
SHA-256 checksum
How to use checksums
ab364818f1f552fd714a56579180d87c34e38b9f2f3ee0d9fa94c426b46414b6
BLAKE2b-256 checksum
How to use checksums
1d4a43c51aabe027d85d34b4d4657e0019ff0ef3bd1af71f9cece2a85cc16492
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 26, 2026.

Transparency log

Release history Release notifications | RSS feed

1.1.0

8 release files

0.7.0

8 release files

0.6.0

15 release files

This release

0.5.1 This release

15 release files

0.5.0

15 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page