mirror of
https://github.com/xfrr/goffmpeg.git
synced 2025-10-30 10:46:19 +08:00
* cleanup readme & examples * upgrade go version * add makefile with basic commands * add e2e test * add gha * update .gitignore
32 lines
476 B
Go
32 lines
476 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/xfrr/goffmpeg/transcoder"
|
|
)
|
|
|
|
const (
|
|
inputPath = "../fixtures/input.3gp"
|
|
outputPath = "../test_results/ultrafast-output.mp4"
|
|
)
|
|
|
|
func main() {
|
|
trans := new(transcoder.Transcoder)
|
|
|
|
err := trans.Initialize(inputPath, outputPath)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
|
|
trans.MediaFile().SetPreset("ultrafast")
|
|
|
|
done := trans.Run(true)
|
|
progress := trans.Output()
|
|
for p := range progress {
|
|
fmt.Println(p)
|
|
}
|
|
|
|
fmt.Println(<-done)
|
|
}
|