All Projects → giorgisio → Goav

giorgisio / Goav

Licence: mit
Golang bindings for FFmpeg

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Goav

Ffmpeg Libav Tutorial
FFmpeg libav tutorial - learn how media works from basic to transmuxing, transcoding and more
Stars: ✭ 7,074 (+300.34%)
Mutual labels:  ffmpeg-libraries
goxlsxwriter
Golang bindings for libxlsxwriter for writing XLSX files
Stars: ✭ 18 (-98.98%)
Mutual labels:  golang-bindings
nimffmpeg
Nim FFMpeg binding
Stars: ✭ 29 (-98.36%)
Mutual labels:  ffmpeg-libraries
FFCreatorLite
一个基于node.js的轻量极速短视频加工库 A lightweight and fast short video processing library based on node.js
Stars: ✭ 155 (-91.23%)
Mutual labels:  ffmpeg-libraries
go-tree-sitter
Golang bindings for tree-sitter https://github.com/tree-sitter/tree-sitter
Stars: ✭ 137 (-92.25%)
Mutual labels:  golang-bindings
GoRODS
Golang binding for iRODS C API: An iRODS client library written in Golang + C
Stars: ✭ 17 (-99.04%)
Mutual labels:  golang-bindings
go-unsplash
Go Client for the Unsplash API
Stars: ✭ 70 (-96.04%)
Mutual labels:  golang-bindings
rticonnextdds-connector-go
RTI Connector for Connext DDS is a lightweight technology that enables DDS data to be accessed with Go.
Stars: ✭ 18 (-98.98%)
Mutual labels:  golang-bindings
Confluent Kafka Go
Confluent's Apache Kafka Golang client
Stars: ✭ 3,047 (+72.44%)
Mutual labels:  golang-bindings
Go Sciter
Golang bindings of Sciter: the Embeddable HTML/CSS/script engine for modern UI development
Stars: ✭ 2,280 (+29.03%)
Mutual labels:  golang-bindings

goav

Golang binding for FFmpeg

A comprehensive binding to the ffmpeg video/audio manipulation library.

GoDoc

Usage

import "github.com/giorgisio/goav/avformat"

func main() {

	filename := "sample.mp4"

	// Register all formats and codecs
	avformat.AvRegisterAll()

	ctx := avformat.AvformatAllocContext()

	// Open video file
	if avformat.AvformatOpenInput(&ctx, filename, nil, nil) != 0 {
		log.Println("Error: Couldn't open file.")
		return
	}

	// Retrieve stream information
	if ctx.AvformatFindStreamInfo(nil) < 0 {
		log.Println("Error: Couldn't find stream information.")

		// Close input file and free context
		ctx.AvformatCloseInput()
		return
	}

	//...

}

Libraries

  • avcodec corresponds to the ffmpeg library: libavcodec [provides implementation of a wider range of codecs]
  • avformat corresponds to the ffmpeg library: libavformat [implements streaming protocols, container formats and basic I/O access]
  • avutil corresponds to the ffmpeg library: libavutil [includes hashers, decompressors and miscellaneous utility functions]
  • avfilter corresponds to the ffmpeg library: libavfilter [provides a mean to alter decoded Audio and Video through chain of filters]
  • avdevice corresponds to the ffmpeg library: libavdevice [provides an abstraction to access capture and playback devices]
  • swresample corresponds to the ffmpeg library: libswresample [implements audio mixing and resampling routines]
  • swscale corresponds to the ffmpeg library: libswscale [implements color conversion and scaling routines]

Installation

FFMPEG INSTALL INSTRUCTIONS

sudo apt-get -y install autoconf automake build-essential libass-dev libfreetype6-dev libsdl1.2-dev libtheora-dev libtool libva-dev libvdpau-dev libvorbis-dev libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev pkg-config texi2html zlib1g-dev

sudo apt install -y libavdevice-dev libavfilter-dev libswscale-dev libavcodec-dev libavformat-dev libswresample-dev libavutil-dev

sudo apt-get install yasm

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

Coding examples are available in the examples/ directory.

Note

  • Function names in Go are consistent with that of the libraries to help with easy search
  • cgo: Extending Go with C
  • goav comes with absolutely no warranty.

Contribute

  • Fork this repo and create your own feature branch.
  • Follow standard Go conventions
  • Test your code.
  • Create pull request

TODO

  • Returning Errors
  • Garbage Collection
  • Review included/excluded functions from each library
  • Go Tests
  • Possible restructuring packages
  • Tutorial01.c
  • More Tutorial

License

This library is under the MIT License

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].