Files
goffmpeg/examples/hls/main.go
Fran ec40467798 cleanup & fix ci (#82)
* cleanup readme & examples
* upgrade go version
* add makefile with basic commands
* add e2e test
* add gha
* update .gitignore
2023-09-29 17:47:28 +02:00

35 lines
592 B
Go

package main
import (
"fmt"
"github.com/xfrr/goffmpeg/transcoder"
)
const (
inputPath = "../fixtures/input.3gp"
outputPath = "../test_results/hls-output.mp4"
keyinfoPath = "keyinfo"
)
func main() {
trans := new(transcoder.Transcoder)
err := trans.Initialize(inputPath, outputPath)
if err != nil {
panic(err)
}
trans.MediaFile().SetVideoCodec("libx264")
trans.MediaFile().SetHlsSegmentDuration(4)
trans.MediaFile().SetEncryptionKey(keyinfoPath)
done := trans.Run(true)
progress := trans.Output()
for p := range progress {
fmt.Println(p)
}
fmt.Println(<-done)
}