mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 13:12:25 -05: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:
parent
53fccb8af8
commit
8e5a72ac5c
10 changed files with 301 additions and 384 deletions
|
|
@ -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{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue