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:
ffmpeg-python==0.1.17
import ffmpeg
Examples of video encoding apps for App Engine: