• Stars
    star
    131
  • Rank 275,867 (Top 6 %)
  • Language
    Go
  • License
    Apache License 2.0
  • Created over 3 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Go client library for OBS Studio

goobs

Protocol Version Documentation Build Status Go Report

Interact with OBS Studio from Go!

installation

To use this library in your project, add it as a module after you've initialized your own:

go mod init github.com/beautifulperson/my-cool-obs-thinggo get github.com/andreykaipov/goobs

usage

The following example connects to the server and prints out some versions.

Check out the docs for more info, or just jump right into the other examples!

package main

import (
	"fmt"

	"github.com/andreykaipov/goobs"
)

func main() {
	client, err := goobs.New("localhost:4455", goobs.WithPassword("goodpassword"))
	if err != nil {
		panic(err)
	}
	defer client.Disconnect()

	version, err := client.General.GetVersion()
	if err != nil {
		panic(err)
	}

	fmt.Printf("OBS Studio version: %s\n", version.ObsVersion)
	fmt.Printf("Server protocol version: %s\n", version.ObsWebSocketVersion)
	fmt.Printf("Client protocol version: %s\n", goobs.ProtocolVersion)
	fmt.Printf("Client library version: %s\n", goobs.LibraryVersion)
}

The corresponding output:

go run _examples/basic/main.go
OBS Studio version: 30.0.2
Server protocol version: 5.4.0
Client protocol version: 5.4.0
Client library version: 1.2.0