Skip to content

Go bindings for SRT. Advantages of SRT technology for an easy to use programming language

License

Notifications You must be signed in to change notification settings

Haivision/srtgo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

a70d53f · Jun 27, 2023

History

53 Commits
Jul 6, 2021
Feb 17, 2020
Jul 13, 2021
Feb 12, 2022
Jul 8, 2021
Jul 8, 2021
Jul 19, 2021
Feb 12, 2022
Feb 12, 2022
Jun 15, 2021
Jun 15, 2021
Oct 19, 2021
Jul 6, 2021
Oct 19, 2021
Oct 19, 2021
May 9, 2022
Feb 14, 2022
Feb 12, 2022
May 9, 2022
Feb 14, 2022
Jun 26, 2023
Feb 12, 2022
Aug 9, 2021
Oct 31, 2020
May 9, 2022

Repository files navigation

PkgGoDev

srtgo

Go bindings for SRT (Secure Reliable Transport), the open source transport technology that optimizes streaming performance across unpredictable networks.

Why srtgo?

The purpose of srtgo is easing the adoption of SRT transport technology. Using Go, with just a few lines of code you can implement an application that sends/receives data with all the benefits of SRT technology: security and reliability, while keeping latency low.

Is this a new implementation of SRT?

No! We are just exposing the great work done by the community in the SRT project as a golang library. All the functionality and implementation still resides in the official SRT project.

Features supported

  • Basic API exposed to easy develop SRT sender/receiver apps
  • Caller and Listener mode
  • Live transport type
  • File transport type
  • Message/Buffer API
  • SRT transport options up to SRT 1.4.1
  • SRT Stats retrieval

Usage

Example of a SRT receiver application:

package main

import (
    "github.com/haivision/srtgo"
    "fmt"
)

func main() {
    options := make(map[string]string)
    options["transtype"] = "file"

    sck := srtgo.NewSrtSocket("0.0.0.0", 8090, options)
    defer sck.Close()
    sck.Listen(1)
    s, _ := sck.Accept()
    defer s.Close()

    buf := make([]byte, 2048)
    for {
        n, _ := s.Read(buf)
        if n == 0 {
            break
        }
        fmt.Println("Received %d bytes", n)
    }
    //....
}

Dependencies

  • srtlib

You can find detailed instructions about how to install srtlib in its README file

gosrt has been developed with srt 1.4.1 as its main target and has been successfully tested in srt 1.3.4 and above.

About

Go bindings for SRT. Advantages of SRT technology for an easy to use programming language

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published