-
Notifications
You must be signed in to change notification settings - Fork 17
/
benchmark-e2e-latency-camera.sh
executable file
·72 lines (63 loc) · 2.12 KB
/
benchmark-e2e-latency-camera.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/usr/bin/env bash
#
# Copyright (c) Dell Inc., or its subsidiaries. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
set -ex
ROOT_DIR=$(readlink -f $(dirname $0)/..)
pushd ${ROOT_DIR}/gst-plugin-pravega
cargo build --release
popd
ls -lh ${ROOT_DIR}/target/release/*.so
export GST_PLUGIN_PATH=${ROOT_DIR}/target/release:${GST_PLUGIN_PATH}
export RUST_BACKTRACE=1
PRAVEGA_STREAM=${PRAVEGA_STREAM:-$(uuidgen)}
BITRATE_KILOBITS_PER_SEC=200
export GST_DEBUG="pravegasrc:4,timestampremove:5,pravegasink:5,mpegtsbase:4,mpegtspacketizer:4"
export GST_DEBUG_FILE=trace.log
gst-launch-1.0 \
-v \
pravegasrc stream=examples/${PRAVEGA_STREAM} \
! timestampremove \
! tsdemux \
! h264parse \
! avdec_h264 \
! videoconvert \
! textoverlay "text=from ${PRAVEGA_STREAM}" valignment=baseline halignment=right "font-desc=Sans 24px" shaded-background=true \
! autovideosink sync=false \
&
sleep 2s
export GST_DEBUG_FILE=
gst-launch-1.0 \
-v \
--eos-on-shutdown \
v4l2src do-timestamp=TRUE num_buffers=1000 \
! "video/x-raw,format=YUY2,width=320,height=180,framerate=30/1" \
! videoconvert \
! clockoverlay "font-desc=Sans 48px" "time-format=%F %T" shaded-background=true \
! timeoverlay valignment=bottom "font-desc=Sans 48px" shaded-background=true \
! tee name=t \
t. ! queue \
! x264enc tune=zerolatency bitrate=${BITRATE_KILOBITS_PER_SEC} \
! mpegtsmux \
! tee name=ts \
ts. ! queue \
! timestampadd \
! pravegasink stream=examples/${PRAVEGA_STREAM} timestamp-mode=realtime-clock \
ts. ! queue \
! tsdemux \
! h264parse \
! avdec_h264 \
! videoconvert \
! textoverlay "text=camera encode+decode" valignment=baseline halignment=right "font-desc=Sans 24px" shaded-background=true \
! autovideosink sync=false \
t. ! queue2 \
! textoverlay "text=camera to ${PRAVEGA_STREAM}" valignment=baseline halignment=right "font-desc=Sans 24px" shaded-background=true \
! autovideosink sync=false \
&
wait