diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 00000000..f48469bd --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,10 @@ +version: 2 +jobs: + build: + docker: + - image: circleci/golang:1.13-buster + steps: + - checkout + - run: sudo apt-get install -qq -y libavdevice-dev libavfilter-dev libswscale-dev libavcodec-dev libavformat-dev libswresample-dev libavutil-dev + - run: go get -v -t -d ./... + - run: go test -v ./... diff --git a/README.md b/README.md index 9e129c20..149177a8 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,8 @@ Golang binding for FFmpeg A comprehensive binding to the ffmpeg video/audio manipulation library. [![GoDoc](https://godoc.org/github.com/giorgisio/goav?status.svg)](https://godoc.org/github.com/giorgisio/goav) +[![CircleCI](https://circleci.com/gh/giorgisio/goav/tree/master.svg?style=shield)](https://circleci.com/gh/giorgisio/goav/tree/master) + ## Usage @@ -66,12 +68,12 @@ export FFMPEG_ROOT=$HOME/ffmpeg export CGO_LDFLAGS="-L$FFMPEG_ROOT/lib/ -lavcodec -lavformat -lavutil -lswscale -lswresample -lavdevice -lavfilter" export CGO_CFLAGS="-I$FFMPEG_ROOT/include" export LD_LIBRARY_PATH=$HOME/ffmpeg/lib -``` +``` -``` +``` go get github.com/giorgisio/goav -``` +``` ## More Examples diff --git a/avcodec/rational.go b/avcodec/rational.go index ee17df03..33abb654 100644 --- a/avcodec/rational.go +++ b/avcodec/rational.go @@ -26,7 +26,7 @@ func (r Rational) Den() int { } func (r Rational) String() string { - return fmt.Sprintln("%d/%d", int(r.num), int(r.den)) + return fmt.Sprintf("%d/%d", int(r.num), int(r.den)) } func (r *Rational) Assign(o Rational) { diff --git a/example/sample.mp4 b/examples/sample.mp4 similarity index 100% rename from example/sample.mp4 rename to examples/sample.mp4 diff --git a/example/tutorial01.go b/examples/save-frame/main.go similarity index 100% rename from example/tutorial01.go rename to examples/save-frame/main.go diff --git a/example/versions.go b/examples/versions/main.go similarity index 99% rename from example/versions.go rename to examples/versions/main.go index 2f4d9d07..ddf5726b 100644 --- a/example/versions.go +++ b/examples/versions/main.go @@ -24,5 +24,4 @@ func main() { log.Printf("AvUtil Version:\t%v", avutil.AvutilVersion()) log.Printf("AvCodec Version:\t%v", avcodec.AvcodecVersion()) log.Printf("Resample Version:\t%v", swresample.SwresampleLicense()) - } diff --git a/go.mod b/go.mod index 7f3b18fc..de40c7e1 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,5 @@ module github.com/giorgisio/goav -require ( - github.com/gosuri/uilive v0.0.0-20170323041506-ac356e6e42cd // indirect - github.com/gosuri/uiprogress v0.0.0-20170224063937-d0567a9d84a1 // indirect -) +require github.com/stretchr/testify v1.4.0 + +go 1.13 diff --git a/go.sum b/go.sum index 79367829..8fdee585 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,11 @@ -github.com/gosuri/uilive v0.0.0-20170323041506-ac356e6e42cd h1:1e+0Z+T4t1mKL5xxvxXh5FkjuiToQGKreCobLu7lR3Y= -github.com/gosuri/uilive v0.0.0-20170323041506-ac356e6e42cd/go.mod h1:qkLSc0A5EXSP6B04TrN4oQoxqFI7A8XvoXSlJi8cwk8= -github.com/gosuri/uiprogress v0.0.0-20170224063937-d0567a9d84a1 h1:4iPLwzjiWGBQnYdtKbg/JNlGlEEvklrrMdjypdA1LKQ= -github.com/gosuri/uiprogress v0.0.0-20170224063937-d0567a9d84a1/go.mod h1:C1RTYn4Sc7iEyf6j8ft5dyoZ4212h8G1ol9QQluh5+0= +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=