mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[performance] ffmpeg ffprobe wrapper improvements (#3225)
* use a single instance of wazero runtime and compiled modules * remove test output 🤦 * undo process-{media,emoji} changes * update test runner to include wazero compilation cache * sign drone.yml --------- Co-authored-by: tobi <tobi.smethurst@protonmail.com>
This commit is contained in:
@@ -27,7 +27,6 @@ import (
|
||||
|
||||
"codeberg.org/gruf/go-byteutil"
|
||||
|
||||
"codeberg.org/gruf/go-ffmpreg/wasm"
|
||||
_ffmpeg "github.com/superseriousbusiness/gotosocial/internal/media/ffmpeg"
|
||||
|
||||
"github.com/superseriousbusiness/gotosocial/internal/gtserror"
|
||||
@@ -161,7 +160,7 @@ func ffmpegGenerateStatic(ctx context.Context, filepath string) (string, error)
|
||||
// ffmpeg calls `ffmpeg [args...]` (WASM) with directory path mounted in runtime.
|
||||
func ffmpeg(ctx context.Context, dirpath string, args ...string) error {
|
||||
var stderr byteutil.Buffer
|
||||
rc, err := _ffmpeg.Ffmpeg(ctx, wasm.Args{
|
||||
rc, err := _ffmpeg.Ffmpeg(ctx, _ffmpeg.Args{
|
||||
Stderr: &stderr,
|
||||
Args: args,
|
||||
Config: func(modcfg wazero.ModuleConfig) wazero.ModuleConfig {
|
||||
@@ -188,7 +187,7 @@ func ffprobe(ctx context.Context, filepath string) (*result, error) {
|
||||
dirpath := path.Dir(filepath)
|
||||
|
||||
// Run ffprobe on our given file at path.
|
||||
_, err := _ffmpeg.Ffprobe(ctx, wasm.Args{
|
||||
_, err := _ffmpeg.Ffprobe(ctx, _ffmpeg.Args{
|
||||
Stdout: &stdout,
|
||||
|
||||
Args: []string{
|
||||
|
Reference in New Issue
Block a user