Skip to content
This repository was archived by the owner on Oct 23, 2024. It is now read-only.

Add SRT caller mode support #1174

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion scripts/installCentOSDeps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ installYumDeps(){
${SUDO} yum install devtoolset-7-gcc* -y
${SUDO} yum install docbook2X -y
${SUDO} yum install libffi-devel -y
${SUDO} yum install ca-certificates -y
${SUDO} yum install ca-certificates tcl -y
}

installRepo(){
Expand All @@ -57,11 +57,13 @@ installRepo(){
}

install_mediadeps_nonfree(){
install_srt
install_fdkaac
install_ffmpeg
}

install_mediadeps(){
install_srt
install_ffmpeg
}

Expand Down
33 changes: 31 additions & 2 deletions scripts/installCommonDeps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,35 @@ check_proxy(){
fi
}

install_srt(){
local VERSION="1.4.4"
local SRC="v${VERSION}.tar.gz"
local SRC_URL=" https://github.com/Haivision/srt/archive/${SRC}"
local SRC_DIR="srt-${VERSION}"

local LIST_LIBS=`ls ${PREFIX_DIR}/lib/libsrt.* 2>/dev/null`
[ "$INCR_INSTALL" = true ] && [[ ! -z $LIST_LIBS ]] && \
echo "srt already installed." && return 0

if [ "$CHECK_INSTALL" = true ]; then
if [[ ! -z $LIST_LIBS ]]; then
echo "srt - Yes"
else
echo "srt - No"
fi
return 0
fi

mkdir -p ${LIB_DIR}
pushd ${LIB_DIR}
wget ${SRC_URL}
rm -fr ${SRC_DIR}
tar xf ${SRC}
pushd ${SRC_DIR}
./configure --prefix=${PREFIX_DIR}
make && make install
}

install_fdkaac(){
local VERSION="0.1.6"
local SRC="fdk-aac-${VERSION}.tar.gz"
Expand Down Expand Up @@ -87,8 +116,8 @@ install_ffmpeg(){
tar xf ${SRC}
pushd ${DIR}
[[ "${DISABLE_NONFREE}" == "true" ]] && \
PKG_CONFIG_PATH=${PREFIX_DIR}/lib/pkgconfig CFLAGS=-fPIC ./configure --prefix=${PREFIX_DIR} --enable-shared --disable-static --disable-libvpx --disable-vaapi --enable-libfreetype || \
PKG_CONFIG_PATH=${PREFIX_DIR}/lib/pkgconfig CFLAGS=-fPIC ./configure --prefix=${PREFIX_DIR} --enable-shared --disable-static --disable-libvpx --disable-vaapi --enable-libfreetype --enable-libfdk-aac --enable-nonfree && \
PKG_CONFIG_PATH=${PREFIX_DIR}/lib/pkgconfig CFLAGS=-fPIC ./configure --prefix=${PREFIX_DIR} --enable-shared --disable-static --disable-libvpx --disable-vaapi --enable-libfreetype --enable-libsrt || \
PKG_CONFIG_PATH=${PREFIX_DIR}/lib/pkgconfig CFLAGS=-fPIC ./configure --prefix=${PREFIX_DIR} --enable-shared --disable-static --disable-libvpx --disable-vaapi --enable-libfreetype --enable-libfdk-aac --enable-nonfree --enable-libsrt && \
make -j4 -s V=0 && make install
popd
popd
Expand Down
4 changes: 3 additions & 1 deletion scripts/installUbuntuDeps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ install_apt_deps(){
${SUDO} apt-get install git make gcc g++ libglib2.0-dev docbook2x pkg-config -y
${SUDO} apt-get install libboost-regex-dev libboost-thread-dev libboost-system-dev liblog4cxx-dev -y
${SUDO} apt-get install openjdk-8-jre curl libboost-test-dev nasm yasm gyp libx11-dev libkrb5-dev intel-gpu-tools -y
${SUDO} apt-get install m4 autoconf libtool automake cmake libfreetype6-dev libgstreamer-plugins-base1.0-dev -y
${SUDO} apt-get install m4 autoconf libtool automake cmake libfreetype6-dev libgstreamer-plugins-base1.0-dev tcl -y
if [ "$GITHUB_ACTIONS" != "true" ]; then
${SUDO} apt-get install rabbitmq-server mongodb -y
else
Expand All @@ -31,11 +31,13 @@ install_gcc_7(){
}

install_mediadeps_nonfree(){
install_srt
install_fdkaac
install_ffmpeg
}

install_mediadeps(){
install_srt
install_ffmpeg
}

Expand Down
1 change: 1 addition & 0 deletions scripts/pack.js
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,7 @@ function isLibAllowed(libSrc) {
'libowt_web_transport',
];
if (!options['archive'] || options['with-ffmpeg']) {
whiteList.push('libsrt');
whiteList.push('libav');
whiteList.push('libsw');
if (osType.includes('centos') || (osType.includes('ubuntu') && osType.includes('20.04'))) {
Expand Down
2 changes: 1 addition & 1 deletion scripts/release/init-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ copy_video_libs()
{
cp ${ROOT}/video_agent/lib/* ${ROOT}/audio_agent/lib/
cp ${ROOT}/video_agent/lib/* ${ROOT}/recording_agent/lib/
cp ${ROOT}/video_agent/lib/* ${ROOT}/streaming_agent/lib/
}

init_software()
Expand All @@ -39,6 +38,7 @@ init_software()
${ROOT}/webrtc_agent/install_deps.sh
${ROOT}/video_agent/install_deps.sh
${ROOT}/video_agent/init.sh
${ROOT}/streaming_agent/install_deps.sh
${ROOT}/analytics_agent/install_deps.sh
copy_video_libs
else
Expand Down
65 changes: 59 additions & 6 deletions scripts/release/install_ffmpeg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ if [[ $EUID -ne 0 ]]; then
SUDO="sudo -E"
fi

ENABLE_SRT=false
SRT_OPTION=" "
AGENT=`echo $this | awk -F "/" '{print $NF}'`
if [ "$AGENT" = "streaming_agent" ]; then
ENABLE_SRT=true
SRT_OPTION="--enable-libsrt"
fi

detect_OS() {
lsb_release >/dev/null 2>/dev/null
if [ $? = 0 ]
Expand Down Expand Up @@ -56,23 +64,63 @@ install_build_deps() {
if [[ "$OS" =~ .*centos.* ]]
then
echo -e "\x1b[32mInstalling dependent components and libraries via yum...\x1b[0m"
${SUDO} yum install pkg-config make gcc gcc-c++ nasm yasm freetype-devel -y
${SUDO} yum install pkg-config make gcc gcc-c++ nasm yasm freetype-devel tcl openssl-devel cmake automake -y
elif [[ "$OS" =~ .*ubuntu.* ]]
then
echo -e "\x1b[32mInstalling dependent components and libraries via apt-get...\x1b[0m"
${SUDO} apt-get update
${SUDO} apt-get install pkg-config make gcc g++ nasm yasm libfreetype6-dev -y
${SUDO} apt-get install pkg-config make gcc g++ nasm yasm libfreetype6-dev tcl cmake libssl-dev build-essential -y
else
echo -e "\x1b[32mUnsupported platform...\x1b[0m"
fi
}

install_openssl(){
local PREFIX_DIR="${this}/ffmpeg-install"
local LIST_LIBS=`ls ${PREFIX_DIR}/lib/libssl* 2>/dev/null`
pushd ${this} >/dev/null
[[ ! -z $LIST_LIBS ]] && \
echo "openssl already installed." && return 0

local SSL_BASE_VERSION="1.1.1"
local SSL_VERSION="1.1.1m"
rm -rf openssl-1*
wget -c https://www.openssl.org/source/openssl-${SSL_VERSION}.tar.gz
tar xf openssl-${SSL_VERSION}.tar.gz
pushd openssl-${SSL_VERSION}
./config no-ssl3 --prefix=$PREFIX_DIR -fPIC --libdir=lib
make depend
make -s V=0
make install

popd
}

install_srt(){
local VERSION="1.4.4"
local SRC="v${VERSION}.tar.gz"
local SRC_URL=" https://github.com/Haivision/srt/archive/${SRC}"
local SRC_DIR="srt-${VERSION}"
local PREFIX_DIR="${this}/ffmpeg-install"

local LIST_LIBS=`ls ${this}/lib/libsrt* 2>/dev/null`
pushd ${this} >/dev/null
[[ ! -z $LIST_LIBS ]] && echo "srt already installed." && return 0
wget ${SRC_URL}
rm -fr ${SRC_DIR}
tar xf ${SRC}
pushd ${SRC_DIR}
./configure --prefix=${PREFIX_DIR}
make && make install
popd
}

install_ffmpeg(){
local VERSION="4.1.3"
local VERSION="4.4.1"
local DIR="ffmpeg-${VERSION}"
local SRC="${DIR}.tar.bz2"
local SRC_URL="http://ffmpeg.org/releases/${SRC}"
local SRC_MD5SUM="9985185a8de3678e5b55b1c63276f8b5"
local SRC_MD5SUM="9c2ca54e7f353a861e57525ff6da335b"
local PREFIX_DIR="${this}/ffmpeg-install"

local LIST_LIBS=`ls ${this}/lib/libav* 2>/dev/null`
Expand All @@ -88,8 +136,8 @@ install_ffmpeg(){
rm -fr ${DIR}
tar xf ${SRC}
pushd ${DIR} >/dev/null
CFLAGS=-fPIC ./configure --prefix=${PREFIX_DIR} --enable-shared \
--disable-static --disable-libvpx --disable-vaapi --enable-libfreetype
PKG_CONFIG_PATH=${PREFIX_DIR}/lib/pkgconfig CFLAGS=-fPIC ./configure --prefix=${PREFIX_DIR} --enable-shared \
--disable-static --disable-libvpx --disable-vaapi --enable-libfreetype ${SRT_OPTION}
make -j4 -s V=0 && make install
popd
popd
Expand All @@ -101,5 +149,10 @@ install_ffmpeg(){
echo "Install building dependencies..."
install_build_deps

if [ "$ENABLE_SRT" = "true" ]; then
install_openssl
install_srt
fi

echo "Install ffmpeg..."
install_ffmpeg