Skip to content

Commit 252510e

Browse files
committed
fix srt hevc blackbox test error.
Root Cause: the ffmpeg 5, inside the docker image srs:ubuntu20-cache, do not support enhanced rtmp.
1 parent 8723ae2 commit 252510e

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

trunk/3rdparty/srs-bench/blackbox/util.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import (
2626
"encoding/json"
2727
"flag"
2828
"fmt"
29+
"log"
2930
"github.com/ossrs/go-oryx-lib/errors"
3031
ohttp "github.com/ossrs/go-oryx-lib/http"
3132
"github.com/ossrs/go-oryx-lib/logger"
@@ -64,11 +65,11 @@ func prepareTest() (err error) {
6465
srsLog = flag.Bool("srs-log", false, "Whether enable the detail log")
6566
srsStdout = flag.Bool("srs-stdout", false, "Whether enable the SRS stdout log")
6667
srsFFmpegStderr = flag.Bool("srs-ffmpeg-stderr", false, "Whether enable the FFmpeg stderr log")
67-
srsDVRStderr = flag.Bool("srs-dvr-stderr", false, "Whether enable the DVR stderr log")
68+
srsDVRStderr = flag.Bool("srs-dvr-stderr", true, "Whether enable the DVR stderr log")
6869
srsFFprobeStdout = flag.Bool("srs-ffprobe-stdout", false, "Whether enable the FFprobe stdout log")
6970
srsTimeout = flag.Int("srs-timeout", 64000, "For each case, the timeout in ms")
7071
srsFFprobeDuration = flag.Int("srs-ffprobe-duration", 16000, "For each case, the duration for ffprobe in ms")
71-
srsFFprobeTimeout = flag.Int("srs-ffprobe-timeout", 21000, "For each case, the timeout for ffprobe in ms")
72+
srsFFprobeTimeout = flag.Int("srs-ffprobe-timeout", 30000, "For each case, the timeout for ffprobe in ms")
7273
srsBinary = flag.String("srs-binary", "../../objs/srs", "The binary to start SRS server")
7374
srsFFmpeg = flag.String("srs-ffmpeg", "ffmpeg", "The FFmpeg tool")
7475
srsFFprobe = flag.String("srs-ffprobe", "ffprobe", "The FFprobe tool")
@@ -845,7 +846,7 @@ func (v *ffprobeClient) doDVR(ctx context.Context) error {
845846
process.name = *srsFFmpeg
846847
process.args = []string{
847848
"-t", fmt.Sprintf("%v", int64(v.duration/time.Second)),
848-
"-i", v.streamURL, "-c", "copy", "-y", v.dvrFile,
849+
"-re", "-i", v.streamURL, "-c", "copy", "-y", v.dvrFile,
849850
}
850851
process.env = os.Environ()
851852

@@ -860,6 +861,7 @@ func (v *ffprobeClient) doDVR(ctx context.Context) error {
860861
logger.Tf(ctx, "DVR process pid=%v exit, r0=%v, stdout=%v", bs.pid, r0, stdout.String())
861862
if *srsDVRStderr && stderr.Len() > 0 {
862863
logger.Tf(ctx, "DVR process pid=%v, stderr is \n%v", bs.pid, stderr.String())
864+
log.Printf("DVR process pid=%v, stderr is \n%v", bs.pid, stderr.String())
863865
}
864866
return nil
865867
}

trunk/Dockerfile.test

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,14 @@ ENV DEBIAN_FRONTEND noninteractive
99
# For go to build and run utest.
1010
ENV PATH $PATH:/usr/local/go/bin
1111

12-
RUN apt update -y && apt install -y gcc make g++ patch unzip perl git libasan5
12+
RUN apt update -y && apt install -y gcc make g++ patch unzip perl git libasan5 wget
13+
14+
# Download and extract the FFmpeg static build
15+
RUN wget https://www.johnvansickle.com/ffmpeg/old-releases/ffmpeg-6.0.1-amd64-static.tar.xz && \
16+
tar -xvf ffmpeg-6.0.1-amd64-static.tar.xz && \
17+
mv ffmpeg-*-static/ffmpeg /usr/local/bin/ && \
18+
mv ffmpeg-*-static/ffprobe /usr/local/bin/ && \
19+
rm -rf ffmpeg-6.0.1-amd64-static.tar.xz ffmpeg-*-static
1320

1421
# Build and install SRS.
1522
COPY . /srs

0 commit comments

Comments
 (0)