Gstreamer bindings and utilities for golang
Go to file
2020-09-27 09:48:11 +03:00
cmd/go-gst fix package names 2020-09-27 09:25:16 +03:00
gst add some more methods to the Pipeline object, clean up docs 2020-09-27 09:48:11 +03:00
.gitignore implement more functionality and move pipeline wrappers into new "gstauto" package 2020-09-26 14:38:11 +03:00
go.mod add some more methods to the Pipeline object, clean up docs 2020-09-27 09:48:11 +03:00
go.sum add some more methods to the Pipeline object, clean up docs 2020-09-27 09:48:11 +03:00
LICENSE Initial commit 2020-09-24 21:25:44 +03:00
Makefile implement more functionality and move pipeline wrappers into new "gstauto" package 2020-09-26 14:38:11 +03:00
README.md implement more functionality and move pipeline wrappers into new "gstauto" package 2020-09-26 14:38:11 +03:00

go-gst

Go bindings for the gstreamer C library

go.dev reference godoc reference GoReportCard example

This package was originally written to aid the audio support in kvdi. But it made sense to turn it into an independent, consumable package. The intention now is to progressively implement the entire API.

See the go.dev reference for documentation and examples.

For other examples see the command line implementation here.

TODO: Write examples on programatically building the pipeline yourself

Requirements

For building applications with this library you need the following:

  • cgo: You must set CGO_ENABLED=1 in your environment when building
  • pkg-config
  • libgstreamer-1.0-dev: This package name may be different depending on your OS. You need the gst.h header files.

For running applications with this library you'll need to have libgstreamer-1.0 installed. Again, this package may be different depending on your OS.

CLI

There is a CLI utility included with this package that demonstrates some of the things you can do.

For now the functionality is limitted to GIF encoing and other arbitrary pipelines. If I extend it further I'll publish releases, but for now, you can retrieve it with go get.

go get github.com/tinyzimmer/go-gst/cmd/go-gst

The usage is described below:

Go-gst is a CLI utility aiming to implement the core functionality
of the core gstreamer-tools. It's primary purpose is to showcase the functionality of 
the underlying go-gst library.

There are also additional commands showing some of the things you can do with the library,
such as websocket servers reading/writing to/from local audio servers and audio/video/image
encoders/decoders.

Usage:
  go-gst [command]

Available Commands:
  completion  Generate completion script
  gif         Encodes the given video to GIF format
  help        Help about any command
  inspect     Inspect the elements of the given pipeline string
  launch      Run a generic pipeline
  websocket   Run a websocket audio proxy for streaming audio from a pulse server 
              and optionally recording to a virtual mic.

Flags:
  -I, --from-stdin      Write to the pipeline from stdin. If this is specified, then -i is ignored.
  -h, --help            help for go-gst
  -i, --input string    An input file, defaults to the first element in the pipeline.
  -o, --output string   An output file, defaults to the last element in the pipeline.
  -O, --to-stdout       Writes the results from the pipeline to stdout. If this is specified, then -o is ignored.
  -v, --verbose         Verbose output. This is ignored when used with --to-stdout.

Use "go-gst [command] --help" for more information about a command.