Example plugins

These examples ship with AssetGoblin but are optional, independently deployed Python scripts. Their format rules and tool arguments live in the scripts.
| Plugin | Extends | Tool dependency | Documentation |
|---|---|---|---|
| Audio | Host route API (/a/) | FFmpeg for transformations | Audio |
| Video | Host route API (/v/) | FFmpeg for transformations | Video |
| QOI | Core image codecs (/img/) | FFmpeg with QOI support | QOI |
| QOA | Audio plugin (/a/) | FFmpeg and reference qoaconv | QOA |
Deployment
From the repository root, copy selected scripts into one flat directory:
mkdir -p runtime-plugins
cp plugins/audio/assetgoblin-audio.py runtime-plugins/
cp plugins/video/assetgoblin-video.py runtime-plugins/
cp plugins/qoi/assetgoblin-qoi.py runtime-plugins/
cp plugins/qoa/assetgoblin-qoa.py runtime-plugins/
go run . -serve -plugins-dir runtime-plugins
For a built executable, copy selected Python files beside it and restart with -serve.
Discovery is nonrecursive: pointing at this catalog directory does not load scripts
inside its subdirectories. QOA requires the audio script in the same discovery
directory. Removing QOA restores the base audio plugin. Tool dependencies resolve
on PATH when a transformation runs. Install Python 3.10+ on PATH, or use
-python to select an interpreter (including a virtual environment).
Asset directories are relative to the server working directory, not this example
folder. Edit each route’s directory in its script if needed.
See the host API
for image codecs, inheritance and process pipelines.
Shared media parameters
The audio and video scripts require FFmpeg only for modified requests. With no transformation parameters they stream the original file. Their shared options are:
| Parameter | Accepted values |
|---|---|
duration | Required for modifications; greater than 0 and at most 60 seconds. |
start | Clip offset, 0..86400 seconds; default 0. |
volume | Audio gain, 0..2; default 1. |
format | Output format; see each plugin’s supported formats. |
Both scripts request one codec/filter thread and restrict FFmpeg protocols. Invalid parameters return 400; conversion failures return a logged 500. The host execution reference explains the shared worker, size/deadline limits, staging and cache maintenance.