-
Notifications
You must be signed in to change notification settings - Fork 17
/
pravega-to-screen-1x2-and-speaker.sh
executable file
·66 lines (61 loc) · 1.96 KB
/
pravega-to-screen-1x2-and-speaker.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
#!/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
#
# 2 video streams and 2 audio streams will be read from 4 separate Pravega streams as MPEG Transport Streams.
# They will be displayed in a single window side by side.
# Audio will be mixed and output to the speaker.
# This will read data generated by avtestsrc-to-pravega-1x2.sh.
set -ex
ROOT_DIR=$(readlink -f $(dirname $0)/..)
pushd ${ROOT_DIR}/gst-plugin-pravega
cargo build
ls -lh ${ROOT_DIR}/target/debug/*.so
export GST_PLUGIN_PATH=${ROOT_DIR}/target/debug:${GST_PLUGIN_PATH}
export GST_DEBUG="pravegasrc:INFO,basesrc:INFO,mpegtsbase:INFO,mpegtspacketizer:INFO"
export RUST_BACKTRACE=1
export GST_DEBUG_DUMP_DOT_DIR=/tmp/gst-dot/pravega-to-screen-1x2-and-speaker
mkdir -p ${GST_DEBUG_DUMP_DOT_DIR}
PRAVEGA_STREAM=${PRAVEGA_STREAM:-group1}
WIDTH=320
HEIGHT=240
gst-launch-1.0 \
-v \
pravegasrc stream=examples/${PRAVEGA_STREAM}-v1 \
! tsdemux \
! h264parse \
! avdec_h264 \
! videoconvert \
! comp. \
pravegasrc stream=examples/${PRAVEGA_STREAM}-v2 \
! tsdemux \
! h264parse \
! avdec_h264 \
! videoconvert \
! comp. \
compositor name=comp \
sink_0::xpos=0 sink_0::ypos=0 sink_0::width=$WIDTH sink_0::height=$HEIGHT \
sink_1::xpos=$WIDTH sink_1::ypos=0 sink_1::width=$WIDTH sink_1::height=$HEIGHT \
sink_2::xpos=0 sink_2::ypos=$HEIGHT sink_2::width=$WIDTH sink_2::height=$HEIGHT \
sink_3::xpos=$WIDTH sink_3::ypos=$HEIGHT sink_3::width=$WIDTH sink_3::height=$HEIGHT \
! autovideosink \
pravegasrc stream=examples/${PRAVEGA_STREAM}-a1 \
! tsdemux \
! avdec_aac \
! audioconvert \
! audioresample \
! mixer. \
pravegasrc stream=examples/${PRAVEGA_STREAM}-a2 \
! tsdemux \
! avdec_aac \
! audioconvert \
! audioresample \
! mixer. \
audiomixer name=mixer \
! autoaudiosink