Skip to content

Commit

Permalink
Make RTP streaming possible
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelGoerentz committed Nov 27, 2024
1 parent e8229ae commit f0605f5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
11 changes: 8 additions & 3 deletions src/thirdPartyBuffer.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"bufio"
"fmt"
"io"
"net/url"
"os"
"os/exec"
"strings"
Expand Down Expand Up @@ -83,11 +84,15 @@ func RunBufferCommand(bufferType string, path, options string, stream *Stream, e
/*
PrepareBufferArguments
*/
func PrepareBufferArguments(options, url string) []string {
func PrepareBufferArguments(options, streamURL string) []string {
args := []string{}
u, err := url.Parse(streamURL)
if err != nil {
return []string{}
}
for i, a := range strings.Split(options, " ") {
a = strings.Replace(a, "[URL]", url, 1)
if i == 0 && len(Settings.UserAgent) != 0 && Settings.Buffer == "ffmpeg" {
a = strings.Replace(a, "[URL]", streamURL, 1)
if i == 0 && len(Settings.UserAgent) != 0 && Settings.Buffer == "ffmpeg" && u.Scheme != "rtp" {
args = append(args, "-user_agent", Settings.UserAgent)
}
args = append(args, a)
Expand Down
4 changes: 1 addition & 3 deletions src/webserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,9 +344,7 @@ func setProtocol(streamInfo *StreamInfo, u *url.URL, err error) {
case "http":
u.Scheme = "https"
streamInfo.URL = u.String()
case "rtp":
u.Scheme = "rtsp"
case "https", "rtsp":
case "https", "rtsp", "rtp":
return
default:
showInfo(fmt.Sprintf("Streaming: Unknown protocol: %s", u.Scheme))
Expand Down
2 changes: 1 addition & 1 deletion threadfin.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ var GitHub = GitHubStruct{Branch: "Main", User: "marcelGoerentz", Repo: "Threadf
const Name = "Threadfin"

// Version : Version, die Build Nummer wird in der main func geparst.
const Version = "1.7.11-beta"
const Version = "1.7.12-beta"

// DBVersion : Datanbank Version
const DBVersion = "0.5.0"
Expand Down

0 comments on commit f0605f5

Please sign in to comment.