asticode / go-astiav

Golang ffmpeg and libav C bindings
MIT License
393 stars 45 forks source link

GoReportCard GoDoc Test Coveralls

astiav is a Golang library providing C bindings for ffmpeg

It's only compatible with ffmpeg n7.0.

Its main goals are to:

Examples

Examples are located in the examples directory and mirror as much as possible the ffmpeg examples.

name astiav ffmpeg
BitStream Filtering see X
Custom IO Demuxing see see
Demuxing/Decoding see see
Filtering see see
Frame data manipulation see X
Hardware Decoding see see
Hardware Encoding see see
Remuxing see see
Scaling see see
Transcoding see see

Tip: you can use the video sample located in the testdata directory for your tests

Install ffmpeg from source

If you don't know how to install ffmpeg, you can use the following to install it from source:

$ make install-ffmpeg

ffmpeg will be built from source in a directory named tmp and located in you working directory

For your GO code to pick up ffmpeg dependency automatically, you'll need to add the following environment variables:

(don't forget to replace {{ path to your working directory }} with the absolute path to your working directory)

export CGO_LDFLAGS="-L{{ path to your working directory }}/tmp/n7.0/lib/",
export CGO_CFLAGS="-I{{ path to your working directory }}/tmp/n7.0/include/",
export PKG_CONFIG_PATH="{{ path to your working directory }}/tmp/n7.0/lib/pkgconfig",

Why astiav?

After maintaining for several years the most starred fork of goav, I've decided to write from scratch my own C bindings to fix most of the problems I still encountered using goav.

Breaking changes

You can see the list of breaking changes here.