Skip to content

Instantly share code, notes, and snippets.

@tobert
Created March 7, 2014 22:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tobert/9421872 to your computer and use it in GitHub Desktop.
Save tobert/9421872 to your computer and use it in GitHub Desktop.
Playing around with Gstreamer from Go
package main
import (
"fmt"
"github.com/tobert/glib"
"github.com/tobert/gst"
)
func main() {
fmt.Printf("Version %s\n", gst.VersionString())
vsrc := gst.ElementFactoryMake("v4l2src", "Logitech_C920_video")
vqueue := gst.ElementFactoryMake("queue", "video_queue")
asrc := gst.ElementFactoryMake("pulsesrc", "pulsesrc")
sink := gst.ElementFactoryMake("autocluttersink", "display")
pl := gst.NewPipeline("slicker")
pl.Add(vsrc, vqueue, asrc, sink)
vsrc.Link(vqueue, sink)
pl.SetState(gst.STATE_PLAYING)
glib.NewMainLoop(nil).Run()
}
// vim: ts=4 sw=4 noet tw=120 softtabstop=4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment