mirror of
https://github.com/u2takey/ffmpeg-go.git
synced 2025-10-05 16:06:52 +08:00
add example; add escape
move sample data
This commit is contained in:
23
examples/example_test.go
Normal file
23
examples/example_test.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package examples
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/disintegration/imaging"
|
||||
)
|
||||
|
||||
func TestExampleStream(t *testing.T) {
|
||||
ExampleStream("./sample_data/in1.mp4", "./sample_data/out1.mp4", false)
|
||||
}
|
||||
|
||||
func TestExampleReadFramAsJpeg(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)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user