Files
ffmpeg-go/examples/example_test.go
2020-11-19 14:42:40 +08:00

33 lines
770 B
Go

package examples
import (
"testing"
"github.com/disintegration/imaging"
)
func TestExampleStream(t *testing.T) {
ExampleStream("./sample_data/in1.mp4", "./sample_data/out1.mp4", false)
}
func TestExampleReadFrameAsJpeg(t *testing.T) {
reader := ExampleReadFrameAsJpeg("./sample_data/in1.mp4", 5)
img, err := imaging.Decode(reader)
if err != nil {
t.Fatal(err)
}
err = imaging.Save(img, "./sample_data/out1.jpeg")
if err != nil {
t.Fatal(err)
}
}
func TestExampleShowProgress(t *testing.T) {
ExampleShowProgress("./sample_data/in1.mp4", "./sample_data/out2.mp4")
}
func TestExampleOpenCvFaceDetect(t *testing.T) {
ExampleFaceDetection("./sample_data/head-pose-face-detection-male-short.mp4",
"./sample_data/haarcascade_frontalface_default.xml")
}