Coder Social home page Coder Social logo

datarhei / gosrt Goto Github PK

View Code? Open in Web Editor NEW
108.0 8.0 17.0 1.07 MB

Implementation of the SRT protocol in pure Go

Home Page: https://datarhei.com

License: MIT License

Go 99.42% Dockerfile 0.12% Makefile 0.46%
broadcasting go low-latency multimedia restreamer srt transport datarhei foss-gmbh

gosrt's People

Contributors

aler9 avatar dependabot[bot] avatar ioppermann avatar jstabenow avatar kazhuravlev avatar rlpeck avatar svenerbeck avatar tobbee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gosrt's Issues

Does not work on Windows

@ioppermann β€˜It is really great to have a pure-Go implementation of SRT. Thanks a lot for providing it!

It works nicely on Linux and Mac, but not on Windows.

The main reason is the calls to SetSockOptInt. I have a branch where I fix that. Currently by disabling setting socket options in Dial on Windows, since there is no way to use File and then File().fd() on Windows.

I have a worse problem in that the srt.Conn always hangs on Read() after some TS packets have been read, typically within a few seconds. Do you have any idea what could be the cause and any way of trouble-shooting it?

Request: Make some packages non internal or expose some needed methods

Hey!

I'm trying to implement my own PubSub logic(like destroy all subscribers when a publisher disconnects, etc) and the problem is some important packages like packet.Packet are internal and the readPacket/writePackage methods are also internal, with that I would have to copy too many files to implement my logic. It makes sense?

Thanks!

Rejected SRT request keeps getting accepted

In the listener mode, it seems if the AcceptFunc returns REJECT, the same request will keep getting accepted, even though the incoming socket has gone.

The following sample code demonstrates the issue:

package main

import (
    "fmt"
    "time"

    srt "github.com/datarhei/gosrt"
)

func main() {
    conf := srt.DefaultConfig()
    ln, err := srt.Listen("srt", ":6000", conf)
    if err != nil {
        fmt.Println("err 1", err)
        return
    }

    for {
        fmt.Println("Accepting...")
        conn, mode, err := ln.Accept(func(req srt.ConnRequest) srt.ConnType {
            // check connection request
            fmt.Println("Got connection", req.RemoteAddr())
            time.Sleep(3 * time.Second)
            fmt.Println("Rejecting...")
            return srt.REJECT
        })
        if err != nil {
            fmt.Println("err 2", err)
            return
        }

        fmt.Println("conn", conn)
        if mode == srt.REJECT {
            // rejected connection, ignore
            continue
        }

        fmt.Println("mode", mode)
    }
}

Reproduce procedure:

  1. Start the listener.
  2. Use any SRT client to try to connect to the listener.
  3. Stop the SRT client once the listener starts accepting the request.
  4. Observe the listener behavior.

We observed the following output:

Accepting...
Got connection [::1]:65203
Rejecting...
conn <nil>
Accepting...
Got connection [::1]:65203
Rejecting...
conn <nil>
Accepting...
Got connection [::1]:65203
Rejecting...
conn <nil>
Accepting...
Got connection [::1]:65203
Rejecting...
conn <nil>
Accepting...
Got connection [::1]:65203

How to save streams to disk?

For example, can you have a server that writes each new stream to a .ts file, creating a new file each time based on a value in the query string plus the date?

No way to get URL parameters from connRequest

Hi,

it looks like something is broken, there is no way to retrieve the url parameters (like the token) from the connRequest.

The server contrib example uses streamId for this but all chars after the next & are stripped.

Thanks

Feature Request: Different receiver and publisher tokens

In an environment where it would not be save to give the srt token to the receivers, it would be great to have separate tokens for publishing and a different token to receive the content.

mode=publish,token:<shared-token>,secret-token:<secret-token>
mode=re quest,token:<shared-token>

That way a malicious receiver would not be able to stream to the same channel once the publisher disconnects.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.