Skip to content

Instantly share code, notes, and snippets.

@peterhellberg
Created April 23, 2017 15:44
Show Gist options
  • Save peterhellberg/7ec4bfc5d27a592c58aca9aa1af7955b to your computer and use it in GitHub Desktop.
Save peterhellberg/7ec4bfc5d27a592c58aca9aa1af7955b to your computer and use it in GitHub Desktop.
FFmpeg from Go usage example
package main
import (
"os/exec"
)
func newCmd(imageFile, audioFile, outFile string) *exec.Cmd {
return exec.Command("ffmpeg",
"-r", "1",
"-loop", "1",
"-i", imageFile,
"-i", audioFile,
"-acodec", "copy",
"-r", "1",
"-shortest", "-vf",
"scale=1280:720",
outFile,
)
}
func main() {
cmd := newCmd("ep1.jpg", "ep1.wav", "ep1.flv")
cmd.Run()
}
Copy link

ghost commented Apr 2, 2021

thanks for those!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment