golang:在不运行可执行文件的情况下将音频转换为FLAC

I am trying to make a Google App Engine that takes a file from Storage, and the converts arbitrary audio file to FLAC. App Engine, however, does not permit running executables.

My current code looks something like this:

cmd := exec.CommandContext(ctx, `./ffmpeg`,
    `-i`, `pipe:0`, `pipe:1`, `-ac`, `1`, `-c:a`, `flac`, `-f`, `flac`)
cmd.Stdin = rc
cmd.Stdout = wc

var errOutput bytes.Buffer
cmd.Stderr = &errOutput

err = cmd.Run()
fmt.Printf("Running ffmpeg: %v... 
stderr: %s
", err, errOutput.String())

Tried looking for go packages (e.g. https://github.com/xfrr/goffmpeg) that do this, but all that I found seem to use the same "run executable on inputs" paradigm as the code above.

How should I approach this? Is there a package that provides bindings to FFMPEG or similar?

You can use ffmpeg functionality in App Engine importing ffmpeg-python: Python bindings for FFmpeg or for example Libav.

Please note that there are two steps to use third-party library with App Engine:

  1. Add library to requirements file, that will be used during app build: ffmpeg-python==0.1.17
  2. Add it to the app code: import ffmpeg

Examples of video encoding apps for App Engine:

  1. Scalable Video Transcoding With App Engine Flexible.
  2. Distributed FFMPEG using Google App Engine.