Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Instantiator = wasm.Instantiator{ Module: "ffmpeg", Runtime: func(ctx context.Context) wazero.Runtime { cfg := wazero.NewRuntimeConfig() cfg = cfg.WithCoreFeatures(ffmpeg.CoreFeatures) cfg = cfg.WithCompilationCache(internal.Cache) rt := wazero.NewRuntimeWithConfig(ctx, cfg) env := rt.NewHostModuleBuilder("env") _, err := env.Instantiate(context.Background()) if err != nil { panic(err) } _, err = wasi_snapshot_preview1.Instantiate(ctx, rt) if err != nil { panic(err) } return rt }, Config: wazero.NewModuleConfig, Source: ffmpeg.B, }
Functions ¶
func Precompile ¶ added in v0.2.0
Precompile creates a new ffmpeg WASM instance and immediately closes it. This ensures the ffmpeg binary is in the global compilation cache, reducing any possible slowdowns on next call to New().
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.