ffmpeg

package
v0.2.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 14, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

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 New added in v0.2.4

func New(ctx context.Context) (*wasm.Instance, error)

New is shorthand for Instantiator.New().

func Precompile added in v0.2.0

func Precompile(ctx context.Context) error

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL