Git Product home page Git Product logo

go-libav's Introduction

go-libav

Go Reference GitHub release (with filter) GitHub go.mod Go version (subdirectory of monorepo) Static Badge Go Report Card Static Badge

English | δΈ­ζ–‡

Golang binding for FFmpeg and libav.

Things to know

  1. This package is implemented using CGO and requires FFmpeg's header files and libraries for compilation.
  2. Due to well-known performance issues with CGO calls, it is recommended to use C/CPP to achieve your needs.

Getting Started

Package go-libav/av* are cgo bindings. Before using this package, you'd better to master the basic usage of the FFmpeg library.

Package golibav/advance is a secondary package to simplify use in go.

Need Golang version 1.21 and FFmpeg library version 6.1.

Set your environment variable if your library is not in the default directory.

# using pkg-config
PKG_CONFIG_PATH="/ffmpeg/lib/pkgconfig"

# or set compiler flags
CGO_LDFLAGS="-L/ffmpeg/lib -lavcodec -lavdevice -lavfilter -lavformat -lavutil -lswresample -lswscale"
CGO_CFLAGS="-I/ffmpeg/include"

Examples

Check advance/example directory.

Try examples With Docker

# Run container with Debian 13 (trixie).
sudo docker run --rm -it debian:trixie
# Install development environment.
apt install golang git
# Clone project.
git clone https://github.com/Lensual/go-libav
# Install FFmpeg development libraries.
apt install libavcodec-dev libavdevice-dev libavfilter-dev libavformat-dev libavutil-dev libswresample-dev libswscale-dev
# Build example like 'mux' and then run iut.
cd go-libav/example/mux
go build .
./mux ./test.mp4

License

GNU Lesser General Public License version 2.1

go-libav's People

Contributors

lensual avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.