diff --git a/scripts/installCentOSDeps.sh b/scripts/installCentOSDeps.sh index 03174f86f..002cc9fc2 100644 --- a/scripts/installCentOSDeps.sh +++ b/scripts/installCentOSDeps.sh @@ -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(){ @@ -57,11 +57,13 @@ installRepo(){ } install_mediadeps_nonfree(){ + install_srt install_fdkaac install_ffmpeg } install_mediadeps(){ + install_srt install_ffmpeg } diff --git a/scripts/installCommonDeps.sh b/scripts/installCommonDeps.sh index 22b701a9f..3bf405642 100644 --- a/scripts/installCommonDeps.sh +++ b/scripts/installCommonDeps.sh @@ -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" @@ -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 diff --git a/scripts/installUbuntuDeps.sh b/scripts/installUbuntuDeps.sh index 123862a8a..6ef6bf081 100644 --- a/scripts/installUbuntuDeps.sh +++ b/scripts/installUbuntuDeps.sh @@ -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 @@ -31,11 +31,13 @@ install_gcc_7(){ } install_mediadeps_nonfree(){ + install_srt install_fdkaac install_ffmpeg } install_mediadeps(){ + install_srt install_ffmpeg } diff --git a/scripts/pack.js b/scripts/pack.js index 1b3c90250..9df7af2a2 100755 --- a/scripts/pack.js +++ b/scripts/pack.js @@ -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'))) { diff --git a/scripts/release/init-all.sh b/scripts/release/init-all.sh index 2cd099791..c9e351e5c 100644 --- a/scripts/release/init-all.sh +++ b/scripts/release/init-all.sh @@ -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() @@ -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 diff --git a/scripts/release/install_ffmpeg.sh b/scripts/release/install_ffmpeg.sh index b3c3cca05..b5132fc44 100755 --- a/scripts/release/install_ffmpeg.sh +++ b/scripts/release/install_ffmpeg.sh @@ -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 ] @@ -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` @@ -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 @@ -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