Skip to content

Commit

Permalink
fix manual benchmarks (#2249)
Browse files Browse the repository at this point in the history
  • Loading branch information
aler9 committed Aug 26, 2023
1 parent bf8e69e commit 3b0fa57
Show file tree
Hide file tree
Showing 86 changed files with 1,262 additions and 1,330 deletions.
10 changes: 5 additions & 5 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ linters-settings:
- (github.com/datarhei/gosrt.Conn).Close
- (github.com/datarhei/gosrt.Conn).SetReadDeadline
- (github.com/datarhei/gosrt.Conn).SetWriteDeadline
- (*github.com/bluenviron/gortsplib/v3.Client).Close
- (*github.com/bluenviron/gortsplib/v3.Server).Close
- (*github.com/bluenviron/gortsplib/v3.ServerSession).Close
- (*github.com/bluenviron/gortsplib/v3.ServerStream).Close
- (*github.com/bluenviron/gortsplib/v3.ServerConn).Close
- (*github.com/bluenviron/gortsplib/v4.Client).Close
- (*github.com/bluenviron/gortsplib/v4.Server).Close
- (*github.com/bluenviron/gortsplib/v4.ServerSession).Close
- (*github.com/bluenviron/gortsplib/v4.ServerStream).Close
- (*github.com/bluenviron/gortsplib/v4.ServerConn).Close

govet:
enable-all: true
Expand Down
5 changes: 3 additions & 2 deletions bench/proxy/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
FROM golang:1.20-alpine3.18
ARG BASE_IMAGE
FROM $BASE_IMAGE

RUN apk add --no-cache \
ffmpeg

RUN wget -O /video.mkv http://jell.yfish.us/media/jellyfish-10-mbps-hd-h264.mkv
RUN wget -O /video.mkv http://www.larmoire.info/jellyfish/media/jellyfish-10-mbps-hd-h264.mkv

WORKDIR /s

Expand Down
12 changes: 9 additions & 3 deletions bench/proxy/start.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
#!/bin/sh -e

PROXY_COUNT=20
PROXY_COUNT=50
PROXY_PROTOCOL=tcp

#####################################################
# source

CONF=""
CONF="${CONF}rtmp: no\n"
CONF="${CONF}hls: no\n"
CONF="${CONF}webrtc: no\n"
CONF="${CONF}srt: no\n"
CONF="${CONF}rtspAddress: :8555\n"
CONF="${CONF}rtpAddress: :8002\n"
CONF="${CONF}rtcpAddress: :8003\n"
CONF="${CONF}paths:\n"
CONF="${CONF} all:\n"
echo -e "$CONF" > /source.conf

RTSP_RTMP=no /mediamtx /source.conf &
/mediamtx /source.conf &

sleep 1

Expand All @@ -28,7 +31,10 @@ sleep 1
# proxy

CONF=""
CONF="${CONF}rtmp: no\n"
CONF="${CONF}hls: no\n"
CONF="${CONF}webrtc: no\n"
CONF="${CONF}srt: no\n"
CONF="${CONF}pprof: yes\n"
CONF="${CONF}paths:\n"
for i in $(seq 1 $PROXY_COUNT); do
Expand All @@ -38,7 +44,7 @@ for i in $(seq 1 $PROXY_COUNT); do
done
echo -e "$CONF" > /proxy.conf

RTSP_RTMP=no /mediamtx /proxy.conf &
/mediamtx /proxy.conf &

sleep 5

Expand Down
5 changes: 3 additions & 2 deletions bench/publish/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
FROM golang:1.20-alpine3.18
ARG BASE_IMAGE
FROM $BASE_IMAGE

RUN apk add --no-cache \
ffmpeg

RUN wget -O /video.mkv http://jell.yfish.us/media/jellyfish-10-mbps-hd-h264.mkv
RUN wget -O /video.mkv http://www.larmoire.info/jellyfish/media/jellyfish-10-mbps-hd-h264.mkv

WORKDIR /s

Expand Down
2 changes: 1 addition & 1 deletion bench/publish/start.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh -e

PUBLISHER_COUNT=20
PUBLISHER_COUNT=50
PUBLISHER_PROTOCOL=tcp

#####################################################
Expand Down
5 changes: 3 additions & 2 deletions bench/read/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
FROM golang:1.20-alpine3.18
ARG BASE_IMAGE
FROM $BASE_IMAGE

RUN apk add --no-cache \
ffmpeg

RUN wget -O /video.mkv http://jell.yfish.us/media/jellyfish-10-mbps-hd-h264.mkv
RUN wget -O /video.mkv http://www.larmoire.info/jellyfish/media/jellyfish-10-mbps-hd-h264.mkv

WORKDIR /s

Expand Down
4 changes: 2 additions & 2 deletions bench/read/start.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh -e

READER_COUNT=20
READER_COUNT=50
READER_PROTOCOL=tcp

#####################################################
Expand All @@ -26,7 +26,7 @@ sleep 1
for i in $(seq 1 $READER_COUNT); do
ffmpeg -hide_banner -loglevel error \
-rtsp_transport $READER_PROTOCOL \
-i rtsp://localhost:8554/source -c copy -f mpegts -y /dev/null &
-i rtsp://localhost:8554/source -c copy -f null - &
done

sleep 5
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
github.com/abema/go-mp4 v0.13.0
github.com/alecthomas/kong v0.8.0
github.com/bluenviron/gohlslib v1.0.0
github.com/bluenviron/gortsplib/v3 v3.10.0
github.com/bluenviron/gortsplib/v4 v4.0.0-20230826160945-3bdae4ed4630
github.com/bluenviron/mediacommon v1.0.0
github.com/datarhei/gosrt v0.5.3
github.com/fsnotify/fsnotify v1.6.0
Expand Down
8 changes: 6 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@ github.com/benburkert/openpgp v0.0.0-20160410205803-c2471f86866c h1:8XZeJrs4+ZYh
github.com/benburkert/openpgp v0.0.0-20160410205803-c2471f86866c/go.mod h1:x1vxHcL/9AVzuk5HOloOEPrtJY0MaalYr78afXZ+pWI=
github.com/bluenviron/gohlslib v1.0.0 h1:UOI7wW7EdXPnnoflPL+WRiUB+bDSyrR9AXtu029n5EY=
github.com/bluenviron/gohlslib v1.0.0/go.mod h1:fwqXogd2G/CJ/0kD6TTALmWI3KAm66nZoI+06O02YKI=
github.com/bluenviron/gortsplib/v3 v3.10.0 h1:E2ytPD1/b6JgzHYVSsyaG2xtXsvaGw9sxTdZ0Wnwsd4=
github.com/bluenviron/gortsplib/v3 v3.10.0/go.mod h1:prNU1aMVBmgmmKwlvLiEdjBbTEpTw4BRsqVcqEARgMY=
github.com/bluenviron/gortsplib/v4 v4.0.0-20230824162022-6f961c1bbbd0 h1:I/GGZB7wxfLj/dOxGh5RXcKvYzDzL7Rgx+aiUZDEEIs=
github.com/bluenviron/gortsplib/v4 v4.0.0-20230824162022-6f961c1bbbd0/go.mod h1:UU9EkvmpvyXdRIDBBUK7zdFt2LsdnV4iz9cHP3JaB8s=
github.com/bluenviron/gortsplib/v4 v4.0.0-20230825170602-5d8f742d6003 h1:CqEACNXs3lUdq0N7cpYEdus6Tk6k8BOfRSfV/ONXLLU=
github.com/bluenviron/gortsplib/v4 v4.0.0-20230825170602-5d8f742d6003/go.mod h1:UU9EkvmpvyXdRIDBBUK7zdFt2LsdnV4iz9cHP3JaB8s=
github.com/bluenviron/gortsplib/v4 v4.0.0-20230826160945-3bdae4ed4630 h1:Xe2em0Hv8ftQ1G3YgKVIcnor63h+OuXBHL7sNDMpfZA=
github.com/bluenviron/gortsplib/v4 v4.0.0-20230826160945-3bdae4ed4630/go.mod h1:UU9EkvmpvyXdRIDBBUK7zdFt2LsdnV4iz9cHP3JaB8s=
github.com/bluenviron/mediacommon v1.0.0 h1:hKelTQKfetasCmXaXMiL1ihID0GRmItyWZt1/pqiKKk=
github.com/bluenviron/mediacommon v1.0.0/go.mod h1:nt5oKCO0WcZ+AH1oc12gs2ldp67xW2vl88c2StNmPlI=
github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM=
Expand Down
2 changes: 1 addition & 1 deletion internal/conf/auth_method.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"sort"
"strings"

"github.com/bluenviron/gortsplib/v3/pkg/headers"
"github.com/bluenviron/gortsplib/v4/pkg/headers"
)

// AuthMethods is the authMethods parameter.
Expand Down
4 changes: 2 additions & 2 deletions internal/conf/conf.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (
"time"

"github.com/bluenviron/gohlslib"
"github.com/bluenviron/gortsplib/v3"
"github.com/bluenviron/gortsplib/v3/pkg/headers"
"github.com/bluenviron/gortsplib/v4"
"github.com/bluenviron/gortsplib/v4/pkg/headers"

"github.com/bluenviron/mediamtx/internal/conf/decrypt"
"github.com/bluenviron/mediamtx/internal/conf/env"
Expand Down
2 changes: 1 addition & 1 deletion internal/conf/conf_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"testing"
"time"

"github.com/bluenviron/gortsplib/v3"
"github.com/bluenviron/gortsplib/v4"
"github.com/stretchr/testify/require"
"golang.org/x/crypto/nacl/secretbox"

Expand Down
4 changes: 2 additions & 2 deletions internal/conf/path.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
"strings"
"time"

"github.com/bluenviron/gortsplib/v3/pkg/headers"
"github.com/bluenviron/gortsplib/v3/pkg/url"
"github.com/bluenviron/gortsplib/v4/pkg/headers"
"github.com/bluenviron/gortsplib/v4/pkg/url"
)

var rePathName = regexp.MustCompile(`^[0-9a-zA-Z_\-/\.~]+$`)
Expand Down
2 changes: 1 addition & 1 deletion internal/conf/protocol.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"sort"
"strings"

"github.com/bluenviron/gortsplib/v3"
"github.com/bluenviron/gortsplib/v4"
)

// Protocol is a RTSP transport.
Expand Down
2 changes: 1 addition & 1 deletion internal/conf/source_protocol.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"encoding/json"
"fmt"

"github.com/bluenviron/gortsplib/v3"
"github.com/bluenviron/gortsplib/v4"
)

// SourceProtocol is the sourceProtocol parameter.
Expand Down
Loading

0 comments on commit 3b0fa57

Please sign in to comment.