Created
March 7, 2014 22:54
-
-
Save tobert/9421872 to your computer and use it in GitHub Desktop.
Playing around with Gstreamer from Go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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