gemer il y a 4 ans
Parent
commit
5570db9dc9

+ 3 - 3
4dage-ffmpeg-lite

@@ -1,6 +1,6 @@
 #!/bin/bash
 
-version="0.1.5"
+version="0.1.6"
 videoFile=''
 audioFile=''
 outputName=''
@@ -22,7 +22,7 @@ command_exists() {
     return 0
 }
 print_usage() {
-    echo -e "\033[43;34m $package - 4dage custom version for ffmpeg lite: \033[0m"
+    echo -e "\033[43;34m $package - 4dage custom version for ffmpeg: \033[0m"
     echo "${green}If have problem with this, please contact with gemer AKA: 张宇鹏<zhangyupeng@cgaii.com>"
     echo "$package [options] application [arguments]"
     echo " "
@@ -154,7 +154,7 @@ while test $# -gt 0; do
 done
 
 mkVerison() {
-    echo "4dage-ffmpeg:$version" >>"$outputFolder/version"
+    touch "$outputFolder/$version.version"
 }
 takeVideoCap() {
     FFREPORT=file="$outputFolder/$outputName.cap.txt":level=32 ffmpeg -hide_banner -loglevel error -y -i $tempVideo -r 1 -ss 00:00:01 -vframes 1 -vf "transpose=1,scale=iw/5:ih/5,setsar=1:1" -f image2 "$outputFolder/$outputName.jpg"

+ 245 - 0
4dage/4dage-ffmpeg-cam8

@@ -0,0 +1,245 @@
+#!/bin/bash
+
+version="1.0.4"
+videoFile=''
+rectspec=''
+outputName=''
+outputFolder=''
+allowCacheStay=0
+tempFolder=/tmp/4dage-ffmpeg
+time=$(date "+%Y%m%d-%H%M%S")
+tempFilePrefix="4dage-source-${time}"
+declare -a outputVideoList=('mp4 flv')
+red=$(tput setaf 1)
+green=$(tput setaf 2)
+reset=$(tput sgr0)
+
+command_exists() {
+    if ! [[ -x $(command -v "$1") ]]; then
+        return 1
+    fi
+
+    return 0
+}
+print_usage() {
+    echo -e "\033[43;34m $package - 4dage ffmpeg v2 custom version for ffmpeg: \033[0m"
+    echo "${green}If have problem with this, please contact with gemer AKA: 张宇鹏<zhangyupeng@cgaii.com>"
+    echo "$package [options] application [arguments]"
+    echo " "
+    echo "${red}options:"
+    echo "-h, --help                show brief help"
+    echo "-s, --source=source file path       input the video source path"
+    echo "-r, --rect=rectange size      rectange size"
+    echo "-n, --name=output file name       output file name"
+    echo "-o, --output=DIR      specify a directory to store output in"
+    echo "-v, --version      output verison"
+    echo "--cahche   maintain the cahche file for tmp folder"
+    echo " "
+    echo -e "\033[0;33m"
+    cat <<EOF
+                                  _oo0oo_
+                                 088888880
+                                 88" . "88
+                                 (| -_- |)
+                                  0\ = /0
+                               ___/'---'\___
+                             .' \\\\|     |// '.
+                            / \\\\|||  :  |||// \\
+                           /_ ||||| -:- |||||- \\
+                          |   | \\\\\\  -  /// |   |
+                          | \_|  ''\---/''  |_/ |
+                          \  .-\__  '-'  __/-.  /
+                        ___'. .'  /--.--\  '. .'___
+                     ."" '<  '.___\_<|>_/___.' >'  "".
+                    | | : '-  \'.;'\ _ /';.'/ - ' : | |
+                    \  \ '_.   \_ __\ /__ _/   .-' /  /
+                ====='-.____'.___ \_____/___.-'____.-'=====
+                                  '=---='
+   
+   
+              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+                        佛祖保佑    TTT    万无一失
+EOF
+    echo -e "\033[m"
+}
+make_temp_dir() {
+    # # Make a temp folder
+    if [ ! -d $tempFolder ]; then
+        mkdir -p $tempFolder && chmod 776 $tempFolder
+    fi
+}
+make_temp_dir
+
+while test $# -gt 0; do
+    case "$1" in
+    -h | --help)
+        print_usage
+        exit 0
+        ;;
+    -s)
+        shift
+        if test $# -gt 0; then
+
+            export videoFile=$1
+        else
+            echo "{$red}no video path specified"
+            exit 1
+        fi
+        shift
+        ;;
+    --source*)
+        export videoFile=$(echo $1 | sed -e 's/^[^=]*=//g')
+        echo $1
+        shift
+        ;;
+    -r)
+        shift
+        if test $# -gt 0; then
+            export rectspec=$1
+        else
+
+            echo "{$red}no rectangle format specified"
+            exit 1
+        fi
+        shift
+        ;;
+    --rect*)
+        export rectspec=$(echo $1 | sed -e 's/^[^=]*=//g')
+        shift
+        ;;
+    -o)
+        shift
+        if test $# -gt 0; then
+            export outputFolder=$1
+        else
+            echo "{$red}no output dir folder specified"
+            exit 1
+        fi
+        shift
+        ;;
+    --output*)
+        export outputFolder=$(echo $1 | sed -e 's/^[^=]*=//g')
+        shift
+        ;;
+    -n)
+        shift
+        if test $# -gt 0; then
+            export outputName=$1
+        else
+            echo "no output video name specified"
+            exit 1
+        fi
+        shift
+        ;;
+    --name*)
+        export outputName=$(echo $1 | sed -e 's/^[^=]*=//g')
+        shift
+        ;;
+    --cache)
+        shift
+        echo "allow cahche remain"
+        export allowCacheStay=1
+        shift
+        ;;
+    -v)
+        echo "$version"
+        shift
+        ;;
+    *)
+        print_usage
+        # echo "111"
+        break
+        ;;
+    esac
+done
+
+mkVerison() {
+
+    touch "$outputFolder/4dage-ffmpeg-v2-$version.version"
+}
+takeVideoCap() {
+    FFREPORT=file="$outputFolder/$outputName.cap.txt":level=48 ffmpeg -hide_banner -loglevel error -y -i "$outputFolder/$outputName.mp4" -r 1 -ss 00:00:01 -vframes 1 -vf "transpose=1,scale=iw/5:ih/5,setsar=1:1" -f image2 "$outputFolder/$outputName.jpg"
+}
+covertVideoTask() {
+    videoFileType=${videoFile##*.}
+
+    FFREPORT=file="$outputFolder/$outputName.$videoFileType.txt":level=48 ffmpeg -hide_banner -y -i $videoFile \
+        -filter_complex "[0:v]crop=$rectspec,scale=iw/2:ih/2,pad=ceil(iw/2)*2:ceil(ih/2)*2,split=2[out1][out2]" \
+        -preset superfast -threads 2 -b 1.8M -minrate 1.8M -maxrate 1.8M -bufsize 2M \
+        -map '[out1]' -map 0:a? -profile:v high -vcodec libx264 -ab 128k "$outputFolder/$outputName.mp4" \
+        -map '[out2]' -map 0:a? -profile:v high -vcodec libx264 -ab 128k "$outputFolder/$outputName.flv"
+
+    takeVideoCap
+    mkVerison
+
+}
+clearDist() {
+    rm -f $outputFolder/*.json
+    rm -f $outputFolder/*.version
+}
+
+concatAllLogFile() {
+    cat $outputFolder/*.txt >>"$outputFolder/$outputName.full.log"
+    rm $outputFolder/*.txt
+
+}
+
+if [ ! -z $videoFile ] && [ ! -z $rectspec ] && [ ! -z $outputName ] && [ ! -z $outputFolder ]; then
+    if [ ! -d $outputFolder ]; then
+        mkdir -p $outputFolder
+    else
+        clearDist
+    fi
+    covertVideoTask
+    concatAllLogFile
+    if command_exists "mediainfo"; then
+        mediainfo --fullscan "$outputFolder/$outputName.mp4" --Output=JSON >"$outputFolder/$outputName.json"
+        mediainfo --fullscan "$outputFolder/$outputName.flv" --Output=JSON >"$outputFolder/$outputName.flv.json"
+    fi
+
+    echo -e "\033[0;32m"
+    cat <<EOF
+                                  _oo0oo_
+                                 088888880
+                                 88" . "88
+                                 (| -_- |)
+                                  0\ = /0
+                               ___/'---'\___
+                             .' \\\\|     |// '.
+                            / \\\\|||  :  |||// \\
+                           /_ ||||| -:- |||||- \\
+                          |   | \\\\\\  -  /// |   |
+                          | \_|  ''\---/''  |_/ |
+                          \  .-\__  '-'  __/-.  /
+                        ___'. .'  /--.--\  '. .'___
+                     ."" '<  '.___\_<|>_/___.' >'  "".
+                    | | : '-  \'.;'\ _ /';.'/ - ' : | |
+                    \  \ '_.   \_ __\ /__ _/   .-' /  /
+                ====='-.____'.___ \_____/___.-'____.-'=====
+                                  '=---='
+   
+   
+              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+                        佛祖保佑    TTT    顺利转换
+EOF
+    echo -e "\033[m"
+    echo "covert done!"
+else
+    if [ ! -n "$1" ]; then
+        print_usage
+    else
+        if [ -z $videoFile ]; then
+            echo "${red}miss video file path: 缺视频文件路径"
+        fi
+        if [ -z $rectspec ]; then
+            echo "${red}miss rect spec : 缺少rect的技术参数"
+        fi
+        if [ -z $outputName ]; then
+            echo "${red}miss file name : 缺少输出文件名称"
+        fi
+        if [ -z $outputFolder ]; then
+            echo "${red}miss output path : 缺少输出路径"
+        fi
+    fi
+
+fi

+ 0 - 0
4dage/4dage-ffmpeg-img2video


+ 260 - 0
4dage/4dage-ffmpeg-rotStereo

@@ -0,0 +1,260 @@
+#!/bin/bash
+
+version="0.1.6"
+videoFile=''
+audioFile=''
+outputName=''
+outputFolder=''
+allowCacheStay=0
+tempFolder=/tmp/4dage-ffmpeg
+time=$(date "+%Y%m%d-%H%M%S")
+tempFilePrefix="4dage-source-${time}"
+declare -a outputVideoList=('mp4 flv')
+red=$(tput setaf 1)
+green=$(tput setaf 2)
+reset=$(tput sgr0)
+
+command_exists() {
+    if ! [[ -x $(command -v "$1") ]]; then
+        return 1
+    fi
+
+    return 0
+}
+print_usage() {
+    echo -e "\033[43;34m $package - 4dage custom version for ffmpeg: \033[0m"
+    echo "${green}If have problem with this, please contact with gemer AKA: 张宇鹏<zhangyupeng@cgaii.com>"
+    echo "$package [options] application [arguments]"
+    echo " "
+    echo "${red}options:"
+    echo "-h, --help                show brief help"
+    echo "-s, --source=source file path       input the video source path"
+    echo "-a, --audio=audio file path       audio file path"
+    echo "-n, --name=output file name       output file name"
+    echo "-o, --output=DIR      specify a directory to store output in"
+    echo "-v, --version      output verison"
+    echo "--cahche   maintain the cahche file for tmp folder"
+    echo " "
+    echo -e "\033[0;33m"
+    cat <<EOF
+                                  _oo0oo_
+                                 088888880
+                                 88" . "88
+                                 (| -_- |)
+                                  0\ = /0
+                               ___/'---'\___
+                             .' \\\\|     |// '.
+                            / \\\\|||  :  |||// \\
+                           /_ ||||| -:- |||||- \\
+                          |   | \\\\\\  -  /// |   |
+                          | \_|  ''\---/''  |_/ |
+                          \  .-\__  '-'  __/-.  /
+                        ___'. .'  /--.--\  '. .'___
+                     ."" '<  '.___\_<|>_/___.' >'  "".
+                    | | : '-  \'.;'\ _ /';.'/ - ' : | |
+                    \  \ '_.   \_ __\ /__ _/   .-' /  /
+                ====='-.____'.___ \_____/___.-'____.-'=====
+                                  '=---='
+   
+   
+              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+                        佛祖保佑    TTT    万无一失
+EOF
+    echo -e "\033[m"
+}
+make_temp_dir() {
+    # # Make a temp folder
+    if [ ! -d $tempFolder ]; then
+        mkdir -p $tempFolder && chmod 776 $tempFolder
+    fi
+}
+make_temp_dir
+
+while test $# -gt 0; do
+    case "$1" in
+    -h | --help)
+        print_usage
+        exit 0
+        ;;
+    -s)
+        shift
+        if test $# -gt 0; then
+
+            export videoFile=$1
+        else
+            echo "{$red}no video path specified"
+            exit 1
+        fi
+        shift
+        ;;
+    --source*)
+        export videoFile=$(echo $1 | sed -e 's/^[^=]*=//g')
+        echo $1
+        shift
+        ;;
+    -a)
+        shift
+        if test $# -gt 0; then
+            export audioFile=$1
+        else
+
+            echo "{$red}no audioFile specified"
+            exit 1
+        fi
+        shift
+        ;;
+    --audio*)
+        export audioFile=$(echo $1 | sed -e 's/^[^=]*=//g')
+        shift
+        ;;
+    -o)
+        shift
+        if test $# -gt 0; then
+            export outputFolder=$1
+        else
+            echo "{$red}no output dir folder specified"
+            exit 1
+        fi
+        shift
+        ;;
+    --output*)
+        export outputFolder=$(echo $1 | sed -e 's/^[^=]*=//g')
+        shift
+        ;;
+    -n)
+        shift
+        if test $# -gt 0; then
+            export outputName=$1
+        else
+            echo "no output video name specified"
+            exit 1
+        fi
+        shift
+        ;;
+    --name*)
+        export outputName=$(echo $1 | sed -e 's/^[^=]*=//g')
+        shift
+        ;;
+    --cache)
+        shift
+        echo "allow cahche remain"
+        export allowCacheStay=1
+        shift
+        ;;
+    -v)
+        echo "$version"
+        shift
+        ;;
+    *)
+        print_usage
+        # echo "111"
+        break
+        ;;
+    esac
+done
+
+mkVerison() {
+    touch "$outputFolder/$version.version"
+}
+takeVideoCap() {
+    FFREPORT=file="$outputFolder/$outputName.cap.txt":level=32 ffmpeg -hide_banner -loglevel error -y -i $tempVideo -r 1 -ss 00:00:01 -vframes 1 -vf "transpose=1,scale=iw/5:ih/5,setsar=1:1" -f image2 "$outputFolder/$outputName.jpg"
+}
+covertVideoTask() {
+    videoFileType=${videoFile##*.}
+    audioFileType=${audioFile##*.}
+    tempbaseAudio="$tempFolder/$tempFilePrefix-base.$audioFileType"
+    tempAudio="$tempFolder/$tempFilePrefix.$audioFileType"
+    tempVideo="$tempFolder/$tempFilePrefix.$videoFileType"
+    # FFREPORT=file="$outputFolder/audio.log":level=32 ffmpeg -i $tempAudio -filter_complex 'lv2=plugin=https\\://github.com/lucianodato/speech-denoiser' $tempAudio -y
+    FFREPORT=file="$outputFolder/$outputName.audio.txt":level=32 ffmpeg -i $audioFile -af "lv2=p=https\\\\://github.com/lucianodato/speech-denoiser" -ac 1 $tempAudio -y
+    RC=$?
+    if [ "${RC}" -ne "0" ]; then
+        FFREPORT=file="$outputFolder/$outputName.audio.txt":level=32 ffmpeg -i $audioFile -af "highpass=f=200, lowpass=f=3000" $tempAudio -y
+    fi
+    # -vf "scale=iw/2:ih/2"
+    ffmpeg -i $videoFile -i $tempAudio -c:v copy -c:a aac -strict -2 $tempVideo -y
+    FFREPORT=file="$outputFolder/$outputName.$videoFileType.txt":level=32 ffmpeg -i $tempVideo -s 1056x792 -c:v libx264 -profile:v high -level:v 4.1 -vf "scale=iw/2:ih/2" -pix_fmt yuv420p -movflags +faststart -bf 2 -c:a copy "$outputFolder/$outputName.$videoFileType" -y
+    FFREPORT=file="$outputFolder/$outputName.flv.txt":level=32 ffmpeg -i $tempVideo -s 1056x792 -c:v libx264 -ar 44100 -profile:v high -level:v 4.1 -vf "scale=iw/2:ih/2" -pix_fmt yuv420p -movflags +faststart -bf 2 -c:a copy "$outputFolder/$outputName.flv" -y
+    takeVideoCap
+    mkVerison
+    # ffmpeg -i $tempVideo -s 1056x792 -c:v libx265 -movflags faststart -bf 2 -c:a copy "$outputFolder/$outputName.265.$videoFileType" -y
+    # export lastOutPutVideo=$outputFolder/$outputName.$videoFileType
+    # export lastOutPutVideoFlv="$outputFolder/$outputName.flv"
+    if test $allowCacheStay -eq 0; then
+        rm $tempAudio $tempVideo
+    fi
+
+}
+
+concatAllLogFile() {
+    cat $outputFolder/*.txt >>"$outputFolder/$outputName.full.log"
+    rm $outputFolder/*.txt
+    # rm "$outputFolder/$outputName.$videoFileType.log" "$outputFolder/$outputName.audio.log" "$outputFolder/$outputName.flv.log"
+}
+
+if [ ! -z $videoFile ] && [ ! -z $audioFile ] && [ ! -z $outputName ] && [ ! -z $outputFolder ]; then
+    # ffmpeg -i $audioFile -af "highpass=f=200, lowpass=f=3000" temp.mp3 -y
+    # ffmpeg -i $audioFile -filter_complex 'lv2=plugin=https\\://github.com/lucianodato/speech-denoiser' $tempAudio -y
+    # ffmpeg -i $videoFile -i $tempAudio -c:v copy -c:a aac $tempVideo -y
+    # ffmpeg -i $tempVideo -s 1056x792 -c:v libx264 -profile:v high -level:v 4.0 -movflags faststart -bf 2 -c:a copy $outputFolder/$outputName.$i -y
+    # for i in "${outputVideoList[@]}"; do
+    # done
+    # ffmpeg -i temp.mp4 -s 1056x792 -c:v libx264 -profile:v high -level:v 4.0 -movflags faststart -bf 2 -c:a copy temp1.mp4 -y
+    # ffmpeg -i temp1.mp4 -pix_fmt rgb24 -color_range 2 $output -y
+    # rm temp.mp4 temp1.mp4 temp.mp3
+    if [ ! -d $outputFolder ]; then
+        mkdir -p $outputFolder
+    fi
+    covertVideoTask
+    concatAllLogFile
+    if command_exists "mediainfo"; then
+        mediainfo --fullscan "$outputFolder/$outputName.$videoFileType" --Output=JSON >"$outputFolder/$outputName.json"
+        mediainfo --fullscan "$outputFolder/$outputName.flv" --Output=JSON >"$outputFolder/$outputName.flv.json"
+    fi
+
+    echo "\033[0;32m"
+    cat <<EOF
+                                  _oo0oo_
+                                 088888880
+                                 88" . "88
+                                 (| -_- |)
+                                  0\ = /0
+                               ___/'---'\___
+                             .' \\\\|     |// '.
+                            / \\\\|||  :  |||// \\
+                           /_ ||||| -:- |||||- \\
+                          |   | \\\\\\  -  /// |   |
+                          | \_|  ''\---/''  |_/ |
+                          \  .-\__  '-'  __/-.  /
+                        ___'. .'  /--.--\  '. .'___
+                     ."" '<  '.___\_<|>_/___.' >'  "".
+                    | | : '-  \'.;'\ _ /';.'/ - ' : | |
+                    \  \ '_.   \_ __\ /__ _/   .-' /  /
+                ====='-.____'.___ \_____/___.-'____.-'=====
+                                  '=---='
+   
+   
+              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+                        佛祖保佑    TTT    顺利转换
+EOF
+    echo "\033[m"
+    echo "covert done!"
+else
+    if [ ! -n "$1" ]; then
+        print_usage
+    else
+        if [ -z $videoFile ]; then
+            echo "${red}miss video file path: 缺视频文件路径"
+        fi
+        if [ -z $audioFile ]; then
+            echo "${red}miss audio file path : 缺音频少文件路径"
+        fi
+        if [ -z $outputName ]; then
+            echo "${red}miss file name : 缺音输出文件名称"
+        fi
+        if [ -z $outputFolder ]; then
+            echo "${red}miss output path : 缺音输出路径"
+        fi
+    fi
+
+fi

+ 35 - 15
install-4dage

@@ -2,7 +2,10 @@
 
 HOMEDIR=/usr/local/4dage-ffmpeg
 
-scriptURL=http://face3d.4dage.com:7005/zhangyupeng/4dage-ffmpeg/raw/master/4dage-ffmpeg
+scriptURLFolder=http://face3d.4dage.com:7005/zhangyupeng/4dage-ffmpeg/raw/master/4dage
+
+# 对应 4dage文件下的脚本, 批量安装
+declare -a installList=('4dage-ffmpeg 4dage-ffmpeg-cam8 4dage-ffmpeg-img2video 4dage-ffmpeg-rotStereo')
 
 mkdir -p $HOMEDIR
 
@@ -13,17 +16,34 @@ command_exists() {
 
     return 0
 }
-## command exsits
-if ! command_exists "curl"; then
-    echo "curl not installed."
-    exit 1
-fi
-if ! command_exists "4dage-ffmpeg"; then
-    curl -s $scriptURL -o $HOMEDIR/4dage-ffmpeg
-    ln -s $HOMEDIR/4dage-ffmpeg /usr/local/bin/4dage-ffmpeg
-else
-    curl -s $scriptURL -o $HOMEDIR/4dage-ffmpeg
-fi
-
-chmod a+x $HOMEDIR/4dage-ffmpeg
-exec bash
+
+# if ! command_exists "curl"; then
+#     echo "curl not installed."
+#     exit 1
+# fi
+
+scriptInstall() {
+
+    echo "传数:$1"
+
+}
+
+for i in "${installList[@]}"; do
+
+    scriptURL=$scriptURLFolder/$i
+    curl -s $scriptURL -o ./docs
+    echo $scriptURL
+
+done
+
+# ## command exsits
+
+# if ! command_exists "4dage-ffmpeg"; then
+#     curl -s $scriptURL -o $HOMEDIR/4dage-ffmpeg
+#     ln -s $HOMEDIR/4dage-ffmpeg /usr/local/bin/4dage-ffmpeg
+# else
+#     curl -s $scriptURL -o $HOMEDIR/4dage-ffmpeg
+# fi
+
+# chmod a+x $HOMEDIR/4dage-ffmpeg
+# exec bash

+ 0 - 30
install-4dage-outsider

@@ -1,30 +0,0 @@
-#!/bin/sh
-
-HOMEDIR=/usr/local/4dage-ffmpeg
-
-scriptURL=http://face3d.4dage.com:7005/zhangyupeng/4dage-ffmpeg/raw/master/4dage-ffmpeg
-
-mkdir -p $HOMEDIR
-
-command_exists() {
-    if ! [[ -x $(command -v "$1") ]]; then
-        return 1
-    fi
-
-    return 0
-}
-## command exsits
-if ! command_exists "curl"; then
-    echo "curl not installed."
-    exit 1
-fi
-if ! command_exists "4dage-ffmpeg"; then
-    curl -s $scriptURL -o $HOMEDIR/4dage-ffmpeg
-    ln -s $HOMEDIR/4dage-ffmpeg /usr/local/bin/4dage-ffmpeg
-else
-    rm $HOMEDIR/4dage-ffmpeg /usr/local/bin/4dage-ffmpeg
-    curl -s $scriptURL -o $HOMEDIR/4dage-ffmpeg
-    ln -s $HOMEDIR/4dage-ffmpeg /usr/local/bin/4dage-ffmpeg
-fi
-
-chmod a+x $HOMEDIR/4dage-ffmpeg

+ 0 - 810
install-ffmpeg-ousider

@@ -1,810 +0,0 @@
-#!/bin/bash
-# export http_proxy=http://192.168.0.144:7890   https_proxy=http://192.168.0.144:7890
-
-PROGNAME=$(basename "$0")
-VERSION=1.22
-CWD=$(pwd)
-PACKAGES="$CWD/packages"
-WORKSPACE="$CWD/workspace"
-CFLAGS="-I$WORKSPACE/include"
-LDFLAGS="-L$WORKSPACE/lib"
-LDEXEFLAGS=""
-EXTRALIBS="-ldl -lpthread -lm -lz"
-MACOS_M1=false
-CONFIGURE_OPTIONS=()
-useGitLib=""
-packageURL=http://git.nps.gemer.xyz/zhangyupeng/4dage-ffmpeg/raw/master/packages.tar.gz
-speakerURL=http://face3d.4dage.com:7005/zhangyupeng/speech-denoiser.git
-# Check for Apple Silicon
-if [[ ("$(uname -m)" == "arm64") && ("$OSTYPE" == "darwin"*) ]]; then
-  # If arm64 AND darwin (macOS)
-  export ARCH=arm64
-  export MACOSX_DEPLOYMENT_TARGET=11.0
-  MACOS_M1=true
-fi
-
-# Speed up the process
-# Env Var NUMJOBS overrides automatic detection
-if [[ -n "$NUMJOBS" ]]; then
-  MJOBS="$NUMJOBS"
-elif [[ -f /proc/cpuinfo ]]; then
-  MJOBS=$(grep -c processor /proc/cpuinfo)
-elif [[ "$OSTYPE" == "darwin"* ]]; then
-  MJOBS=$(sysctl -n machdep.cpu.thread_count)
-  CONFIGURE_OPTIONS=("--enable-videotoolbox")
-else
-  MJOBS=4
-fi
-
-make_dir() {
-  remove_dir "$1"
-  if ! mkdir "$1"; then
-    printf "\n Failed to create dir %s" "$1"
-    exit 1
-  fi
-}
-
-remove_dir() {
-  if [ -d "$1" ]; then
-    rm -r "$1"
-  fi
-}
-
-download() {
-  # download url [filename[dirname]]
-
-  DOWNLOAD_PATH="$PACKAGES"
-  DOWNLOAD_FILE="${2:-"${1##*/}"}"
-
-  if [[ "$DOWNLOAD_FILE" =~ tar. ]]; then
-    TARGETDIR="${DOWNLOAD_FILE%.*}"
-    TARGETDIR="${3:-"${TARGETDIR%.*}"}"
-  else
-    TARGETDIR="${3:-"${DOWNLOAD_FILE%.*}"}"
-  fi
-
-  if [ ! -f "$DOWNLOAD_PATH/$DOWNLOAD_FILE" ]; then
-    echo "Downloading $1 as $DOWNLOAD_FILE"
-    curl -L --silent -o "$DOWNLOAD_PATH/$DOWNLOAD_FILE" "$1"
-
-    EXITCODE=$?
-    if [ $EXITCODE -ne 0 ]; then
-      echo ""
-      echo "Failed to download $1. Exitcode $EXITCODE. Retrying in 10 seconds"
-      sleep 10
-      curl -L --silent -o "$DOWNLOAD_PATH/$DOWNLOAD_FILE" "$1"
-    fi
-
-    EXITCODE=$?
-    if [ $EXITCODE -ne 0 ]; then
-      echo ""
-      echo "Failed to download $1. Exitcode $EXITCODE"
-      exit 1
-    fi
-
-    echo "... Done"
-  else
-    echo "$DOWNLOAD_FILE has already downloaded."
-  fi
-
-  make_dir "$DOWNLOAD_PATH/$TARGETDIR"
-
-  if [ -n "$3" ]; then
-    if ! tar -xvf "$DOWNLOAD_PATH/$DOWNLOAD_FILE" -C "$DOWNLOAD_PATH/$TARGETDIR" 2>/dev/null >/dev/null; then
-      echo "Failed to extract $DOWNLOAD_FILE"
-      exit 1
-    fi
-  else
-    if ! tar -xvf "$DOWNLOAD_PATH/$DOWNLOAD_FILE" -C "$DOWNLOAD_PATH/$TARGETDIR" --strip-components 1 2>/dev/null >/dev/null; then
-      echo "Failed to extract $DOWNLOAD_FILE"
-      exit 1
-    fi
-  fi
-
-  echo "Extracted $DOWNLOAD_FILE"
-
-  cd "$DOWNLOAD_PATH/$TARGETDIR" || (
-    echo "Error has occurred."
-    exit 1
-  )
-}
-
-execute() {
-  echo "$ $*"
-
-  OUTPUT=$("$@" 2>&1)
-
-  # shellcheck disable=SC2181
-  if [ $? -ne 0 ]; then
-    echo "$OUTPUT"
-    echo ""
-    echo "Failed to Execute $*" >&2
-    exit 1
-  fi
-}
-
-build() {
-  echo ""
-  echo "building $1"
-  echo "======================="
-
-  if [ -f "$PACKAGES/$1.done" ]; then
-    echo "$1 already built. Remove $PACKAGES/$1.done lockfile to rebuild it."
-    return 1
-  fi
-
-  return 0
-}
-
-command_exists() {
-  if ! [[ -x $(command -v "$1") ]]; then
-    return 1
-  fi
-
-  return 0
-}
-
-library_exists() {
-  if ! [[ -x $(pkg-config --exists --print-errors "$1" 2>&1 >/dev/null) ]]; then
-    return 1
-  fi
-
-  return 0
-}
-
-build_done() {
-  touch "$PACKAGES/$1.done"
-}
-
-verify_binary_type() {
-  BINARY_TYPE=$(file "$WORKSPACE/bin/ffmpeg" | sed -n 's/^.*\:\ \(.*$\)/\1/p')
-  echo ""
-  case $BINARY_TYPE in
-  "Mach-O 64-bit executable arm64")
-    echo "Successfully built Apple Silicon (M1) for ${OSTYPE}: ${BINARY_TYPE}"
-    ;;
-  *)
-    echo "Successfully built binary for ${OSTYPE}: ${BINARY_TYPE}"
-    ;;
-  esac
-}
-
-cleanup() {
-  remove_dir "$PACKAGES"
-  remove_dir "$WORKSPACE"
-  echo "Cleanup done."
-  echo ""
-}
-
-usage() {
-  echo "Usage: $PROGNAME [OPTIONS]"
-  echo "Options:"
-  echo "  -h, --help          Display usage information"
-  echo "      --version       Display version information"
-  echo "  -b, --build         Starts the build process"
-  echo "  -c, --cleanup       Remove all working dirs"
-  echo "  -i, --in        use innet package source for gogs"
-  echo "  -f, --full-static   Build a full static FFmpeg binary (eg. glibc, pthreads etc...) **only Linux**"
-  echo "                      Note: Because of the NSS (Name Service Switch), glibc does not recommend static links."
-  echo ""
-}
-
-while (($# > 0)); do
-  case $1 in
-  -h | --help)
-    usage
-    exit 0
-    ;;
-  --version)
-    echo "$VERSION"
-    exit 0
-    ;;
-  -*)
-    if [[ "$1" == "--build" || "$1" =~ 'b' ]]; then
-      bflag='-b'
-    fi
-    if [[ "$1" == "--cleanup" || "$1" =~ 'c' && ! "$1" =~ '--' ]]; then
-      cflag='-c'
-      cleanup
-    fi
-    if [[ "$1" == "--full-static" || "$1" =~ 'f' ]]; then
-      if [[ "$OSTYPE" == "darwin"* ]]; then
-        echo "Error: A full static binary can only be build on Linux."
-        exit 1
-      fi
-      LDEXEFLAGS="-static"
-    fi
-    if [[ "$1" == "--in" || "$1" =~ 'i' ]]; then
-      useGitLib="1"
-      echo 'use gogs in lib'
-    fi
-    shift
-    ;;
-  *)
-    usage
-    exit 1
-    ;;
-  esac
-done
-
-echo "ffmpeg-build-script v$VERSION"
-echo "========================="
-echo ""
-
-if [ -z "$bflag" ]; then
-  if [ -z "$cflag" ]; then
-    usage
-    exit 1
-  fi
-  exit 0
-fi
-
-echo "Using $MJOBS make jobs simultaneously."
-
-if [ -n "$LDEXEFLAGS" ]; then
-  echo "Start the build in full static mode."
-fi
-
-mkdir -p "$PACKAGES"
-mkdir -p "$WORKSPACE"
-
-export PATH="${WORKSPACE}/bin:$PATH"
-PKG_CONFIG_PATH="/usr/local/lib/x86_64-linux-gnu/pkgconfig:/usr/local/lib/pkgconfig"
-PKG_CONFIG_PATH+=":/usr/local/share/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig:/usr/lib64/pkgconfig"
-export PKG_CONFIG_PATH
-
-buildEssentialLib() {
-  sudo apt-get install build-essential autoconf m4 libtool curl pkg-config cmake make -y
-  echo "building Essential Lib"
-  echo "======================="
-  if [ "$useGitLib" -eq 1 ]; then
-    if build "gogs-lib"; then
-      echo "--- pull gogs lib --- "
-      download "${packageURL}" "packages.tar.gz"
-      execute cp -r "${PACKAGES}"/packages/* "${PACKAGES}"
-      build_done "gogs-lib"
-    fi
-
-  fi
-}
-buildEssentialLib
-
-if ! command_exists "make"; then
-  echo "make not installed."
-  exit 1
-fi
-
-if ! command_exists "g++"; then
-  echo "g++ not installed."
-  exit 1
-fi
-
-if ! command_exists "curl"; then
-  echo "curl not installed."
-  exit 1
-fi
-
-if ! command_exists "python"; then
-  echo "Python command not found. Lv2 filter will not be available."
-  exit 1
-fi
-
-##
-## build tools
-##
-
-if build "pkg-config"; then
-  download "https://pkgconfig.freedesktop.org/releases/pkg-config-0.29.2.tar.gz"
-  execute ./configure --silent --prefix="${WORKSPACE}" --with-pc-path="${WORKSPACE}"/lib/pkgconfig --with-internal-glib
-  execute make -j $MJOBS
-  execute make install
-  build_done "pkg-config"
-fi
-
-if command_exists "python"; then
-
-  if build "lv2"; then
-    download "https://lv2plug.in/spec/lv2-1.18.0.tar.bz2" "lv2-1.18.0.tar.bz2"
-    execute ./waf configure --prefix="${WORKSPACE}" --lv2-user
-    execute ./waf
-    execute ./waf install
-
-    build_done "lv2"
-  fi
-
-  if build "waflib"; then
-    download "https://gitlab.com/drobilla/autowaf/-/archive/cc37724b9bfa889baebd8cb10f38b8c7cab83e37/autowaf-cc37724b9bfa889baebd8cb10f38b8c7cab83e37.tar.gz" "autowaf.tar.gz"
-    build_done "waflib"
-  fi
-
-  if build "serd"; then
-    download "https://gitlab.com/drobilla/serd/-/archive/v0.30.6/serd-v0.30.6.tar.gz" "serd-v0.30.6.tar.gz"
-    execute cp -r "${PACKAGES}"/autowaf/* "${PACKAGES}/serd-v0.30.6/waflib/"
-    execute ./waf configure --prefix="${WORKSPACE}" --static --no-shared --no-posix
-    execute ./waf
-    execute ./waf install
-    build_done "serd"
-  fi
-
-  if build "pcre"; then
-    download "https://ftp.pcre.org/pub/pcre/pcre-8.44.tar.gz" "pcre-8.44.tar.gz"
-    execute ./configure --prefix="${WORKSPACE}" --disable-shared --enable-static
-    execute make -j $MJOBS
-    execute make install
-
-    build_done "pcre"
-  fi
-
-  if build "sord"; then
-    download "https://gitlab.com/drobilla/sord/-/archive/v0.16.6/sord-v0.16.6.tar.gz" "sord-v0.16.6.tar.gz"
-    execute cp -r "${PACKAGES}"/autowaf/* "${PACKAGES}/sord-v0.16.6/waflib/"
-    execute ./waf configure --prefix="${WORKSPACE}" CFLAGS="${CFLAGS}" --static --no-shared --no-utils
-    execute ./waf CFLAGS="${CFLAGS}"
-    execute ./waf install
-
-    build_done "sord"
-  fi
-
-  if build "sratom"; then
-    download "https://gitlab.com/lv2/sratom/-/archive/v0.6.6/sratom-v0.6.6.tar.gz" "sratom-v0.6.6.tar.gz"
-    execute cp -r "${PACKAGES}"/autowaf/* "${PACKAGES}/sratom-v0.6.6/waflib/"
-    execute ./waf configure --prefix="${WORKSPACE}" --static --no-shared
-    execute ./waf
-    execute ./waf install
-
-    build_done "sratom"
-  fi
-
-  if build "lilv"; then
-    download "https://gitlab.com/lv2/lilv/-/archive/v0.24.10/lilv-v0.24.10.tar.gz" "lilv-v0.24.10.tar.gz"
-    execute cp -r "${PACKAGES}"/autowaf/* "${PACKAGES}/lilv-v0.24.10/waflib/"
-    execute ./waf configure --prefix="${WORKSPACE}" --static --no-shared --no-utils
-    execute ./waf
-    execute ./waf install
-    CFLAGS+=" -I$WORKSPACE/include/lilv-0"
-    build_done "lilv"
-  fi
-
-  CONFIGURE_OPTIONS+=("--enable-lv2")
-fi
-
-if build "yasm"; then
-  download "https://github.com/yasm/yasm/releases/download/v1.3.0/yasm-1.3.0.tar.gz"
-  execute ./configure --prefix="${WORKSPACE}"
-  execute make -j $MJOBS
-  execute make install
-  build_done "yasm"
-fi
-
-if build "nasm"; then
-  download "https://www.nasm.us/pub/nasm/releasebuilds/2.15.05/nasm-2.15.05.tar.xz"
-  execute ./configure --prefix="${WORKSPACE}" --disable-shared --enable-static
-  execute make -j $MJOBS
-  execute make install
-  build_done "nasm"
-fi
-
-if build "zlib"; then
-  download "https://www.zlib.net/zlib-1.2.11.tar.gz"
-  execute ./configure --static --prefix="${WORKSPACE}"
-  execute make -j $MJOBS
-  execute make install
-  build_done "zlib"
-fi
-
-if build "openssl"; then
-  download "https://www.openssl.org/source/openssl-1.1.1i.tar.gz"
-  if $MACOS_M1; then
-    sed -n 's/\(##### GNU Hurd\)/"darwin64-arm64-cc" => { \n    inherit_from     => [ "darwin-common", asm("aarch64_asm") ],\n    CFLAGS           => add("-Wall"),\n    cflags           => add("-arch arm64 "),\n    lib_cppflags     => add("-DL_ENDIAN"),\n    bn_ops           => "SIXTY_FOUR_BIT_LONG", \n    perlasm_scheme   => "macosx", \n}, \n\1/g' Configurations/10-main.conf
-    execute ./configure --prefix="${WORKSPACE}" no-shared no-asm darwin64-arm64-cc
-  else
-    execute ./config --prefix="${WORKSPACE}" --openssldir="${WORKSPACE}" --with-zlib-include="${WORKSPACE}"/include/ --with-zlib-lib="${WORKSPACE}"/lib no-shared zlib
-  fi
-  execute make -j $MJOBS
-  execute make install_sw
-  build_done "openssl"
-fi
-CONFIGURE_OPTIONS+=("--enable-openssl")
-
-if build "cmake"; then
-  download "https://cmake.org/files/v3.18/cmake-3.18.4.tar.gz"
-  execute ./configure --prefix="${WORKSPACE}" --system-zlib
-  execute make -j $MJOBS
-  execute make install
-  build_done "cmake"
-fi
-
-if build "svtav1"; then
-  download "https://github.com/AOMediaCodec/SVT-AV1/archive/v0.8.6.tar.gz"
-  cd Build/linux || exit
-  execute cmake -DCMAKE_INSTALL_PREFIX="${WORKSPACE}" -DENABLE_SHARED=off -DBUILD_SHARED_LIBS=OFF ../.. -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=Release
-  execute make -j $MJOBS
-  execute make install
-  execute cp SvtAv1Enc.pc "${WORKSPACE}/lib/pkgconfig/"
-  execute cp SvtAv1Dec.pc "${WORKSPACE}/lib/pkgconfig/"
-  build_done "svtav1"
-fi
-CONFIGURE_OPTIONS+=("--enable-libsvtav1")
-
-##
-## video library
-##
-
-if build "x264"; then
-  download "https://code.videolan.org/videolan/x264/-/archive/0d754ec36013fee82978496cd56fbd48824910b3/x264-0d754ec36013fee82978496cd56fbd48824910b3.tar.gz" "x264-0d754ec.tar.gz"
-  cd "${PACKAGES}"/x264-0d754ec || exit
-
-  if [[ "$OSTYPE" == "linux-gnu" ]]; then
-    execute ./configure --prefix="${WORKSPACE}" --enable-static --enable-pic CXXFLAGS="-fPIC"
-  else
-    execute ./configure --prefix="${WORKSPACE}" --enable-static --enable-pic
-  fi
-
-  execute make -j $MJOBS
-  execute make install
-  execute make install-lib-static
-
-  build_done "x264"
-fi
-CONFIGURE_OPTIONS+=("--enable-libx264")
-
-if build "x265"; then
-  download "https://github.com/videolan/x265/archive/Release_3.5.tar.gz" "x265-3.5.tar.gz"
-  cd build/linux || exit
-
-  execute cmake -DCMAKE_INSTALL_PREFIX="${WORKSPACE}" -DENABLE_SHARED=off -DBUILD_SHARED_LIBS=OFF ../../source
-  execute make -j $MJOBS
-  execute make install
-
-  if [ -n "$LDEXEFLAGS" ]; then
-    sed -i.backup 's/-lgcc_s/-lgcc_eh/g' "${WORKSPACE}/lib/pkgconfig/x265.pc" # The -i.backup is intended and required on MacOS: https://stackoverflow.com/questions/5694228/sed-in-place-flag-that-works-both-on-mac-bsd-and-linux
-  fi
-
-  build_done "x265"
-fi
-CONFIGURE_OPTIONS+=("--enable-libx265")
-
-if build "libvpx"; then
-  download "https://github.com/webmproject/libvpx/archive/v1.9.0.tar.gz" "libvpx-1.9.0.tar.gz"
-
-  if [[ "$OSTYPE" == "darwin"* ]]; then
-    echo "Applying Darwin patch"
-    sed "s/,--version-script//g" build/make/Makefile >build/make/Makefile.patched
-    sed "s/-Wl,--no-undefined -Wl,-soname/-Wl,-undefined,error -Wl,-install_name/g" build/make/Makefile.patched >build/make/Makefile
-  fi
-
-  execute ./configure --prefix="${WORKSPACE}" --disable-unit-tests --disable-shared --as=yasm
-  execute make -j $MJOBS
-  execute make install
-
-  build_done "libvpx"
-fi
-CONFIGURE_OPTIONS+=("--enable-libvpx")
-
-if build "xvidcore"; then
-  download "http://fossies.org/linux/misc/xvidcore-1.3.7.tar.gz"
-  cd build/generic || exit
-  execute ./configure --prefix="${WORKSPACE}" --disable-shared --enable-static
-  execute make -j $MJOBS
-  execute make install
-
-  if [[ -f ${WORKSPACE}/lib/libxvidcore.4.dylib ]]; then
-    execute rm "${WORKSPACE}/lib/libxvidcore.4.dylib"
-  fi
-
-  if [[ -f ${WORKSPACE}/lib/libxvidcore.so ]]; then
-    execute rm "${WORKSPACE}"/lib/libxvidcore.so*
-  fi
-
-  build_done "xvidcore"
-fi
-CONFIGURE_OPTIONS+=("--enable-libxvid")
-
-if build "vid_stab"; then
-  download "https://github.com/georgmartius/vid.stab/archive/v1.1.0.tar.gz" "vid.stab-1.1.0.tar.gz"
-
-  if $MACOS_M1; then
-
-    curl -s -o "$PACKAGES/vid.stab-1.1.0/fix_cmake_quoting.patch" https://raw.githubusercontent.com/Homebrew/formula-patches/5bf1a0e0cfe666ee410305cece9c9c755641bfdf/libvidstab/fix_cmake_quoting.patch
-    patch -p1 <fix_cmake_quoting.patch
-  fi
-
-  execute cmake -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX="${WORKSPACE}" -DUSE_OMP=OFF -DENABLE_SHARED=off .
-  execute make
-  execute make install
-
-  build_done "vid_stab"
-fi
-CONFIGURE_OPTIONS+=("--enable-libvidstab")
-
-if build "av1"; then
-  # download "https://aomedia.googlesource.com/aom/+archive/b52ee6d44adaef8a08f6984390de050d64df9faa.tar.gz" "av1.tar.gz" "av1"
-  download "https://www.andrews-corner.org/downloads/aom-b52ee6d44adaef8a08f6984390de050d64df9faa.tar.gz" "av1.tar.gz" "av1"
-  make_dir "$PACKAGES"/aom_build
-  cd "$PACKAGES"/aom_build || exit
-  if $MACOS_M1; then
-    execute cmake -DENABLE_TESTS=0 -DCMAKE_INSTALL_PREFIX="${WORKSPACE}" -DCMAKE_INSTALL_LIBDIR=lib -DCONFIG_RUNTIME_CPU_DETECT=0 "$PACKAGES"/av1
-  else
-    execute cmake -DENABLE_TESTS=0 -DCMAKE_INSTALL_PREFIX="${WORKSPACE}" -DCMAKE_INSTALL_LIBDIR=lib "$PACKAGES"/av1
-  fi
-  execute make -j $MJOBS
-  execute make install
-
-  build_done "av1"
-fi
-CONFIGURE_OPTIONS+=("--enable-libaom")
-
-##
-## audio library
-##
-
-if build "opencore"; then
-  download "https://deac-riga.dl.sourceforge.net/project/opencore-amr/opencore-amr/opencore-amr-0.1.5.tar.gz"
-  execute ./configure --prefix="${WORKSPACE}" --disable-shared --enable-static
-  execute make -j $MJOBS
-  execute make install
-
-  build_done "opencore"
-fi
-CONFIGURE_OPTIONS+=("--enable-libopencore_amrnb" "--enable-libopencore_amrwb")
-
-if build "lame"; then
-  download "https://fossies.org/linux/misc/lame-3.100.tar.gz"
-  execute ./configure --prefix="${WORKSPACE}" --disable-shared --enable-static
-  execute make -j $MJOBS
-  execute make install
-
-  build_done "lame"
-fi
-CONFIGURE_OPTIONS+=("--enable-libmp3lame")
-
-if build "opus"; then
-  download "https://archive.mozilla.org/pub/opus/opus-1.3.1.tar.gz"
-  execute ./configure --prefix="${WORKSPACE}" --disable-shared --enable-static
-  execute make -j $MJOBS
-  execute make install
-
-  build_done "opus"
-fi
-CONFIGURE_OPTIONS+=("--enable-libopus")
-
-if build "libogg"; then
-  download "https://ftp.osuosl.org/pub/xiph/releases/ogg/libogg-1.3.3.tar.gz"
-  execute ./configure --prefix="${WORKSPACE}" --disable-shared --enable-static
-  execute make -j $MJOBS
-  execute make install
-  build_done "libogg"
-fi
-
-if build "libvorbis"; then
-  download "https://ftp.osuosl.org/pub/xiph/releases/vorbis/libvorbis-1.3.6.tar.gz"
-  execute ./configure --prefix="${WORKSPACE}" --with-ogg-libraries="${WORKSPACE}"/lib --with-ogg-includes="${WORKSPACE}"/include/ --enable-static --disable-shared --disable-oggtest
-  execute make -j $MJOBS
-  execute make install
-
-  build_done "libvorbis"
-fi
-CONFIGURE_OPTIONS+=("--enable-libvorbis")
-
-if build "libtheora"; then
-  download "https://ftp.osuosl.org/pub/xiph/releases/theora/libtheora-1.1.1.tar.gz"
-  sed "s/-fforce-addr//g" configure >configure.patched
-  chmod +x configure.patched
-  mv configure.patched configure
-  execute ./configure --prefix="${WORKSPACE}" --with-ogg-libraries="${WORKSPACE}"/lib --with-ogg-includes="${WORKSPACE}"/include/ --with-vorbis-libraries="${WORKSPACE}"/lib --with-vorbis-includes="${WORKSPACE}"/include/ --enable-static --disable-shared --disable-oggtest --disable-vorbistest --disable-examples --disable-asm --disable-spec
-  execute make -j $MJOBS
-  execute make install
-
-  build_done "libtheora"
-fi
-CONFIGURE_OPTIONS+=("--enable-libtheora")
-
-if build "fdk_aac"; then
-  download "https://sourceforge.net/projects/opencore-amr/files/fdk-aac/fdk-aac-2.0.1.tar.gz/download?use_mirror=gigenet" "fdk-aac-2.0.1.tar.gz"
-  execute ./configure --prefix="${WORKSPACE}" --disable-shared --enable-static
-  execute make -j $MJOBS
-  execute make install
-
-  build_done "fdk_aac"
-fi
-CONFIGURE_OPTIONS+=("--enable-libfdk-aac")
-
-##
-## image library
-##
-
-if build "libwebp"; then
-  download "https://github.com/webmproject/libwebp/archive/v1.1.0.tar.gz" "libwebp-1.1.0.tar.gz"
-  make_dir build
-  cd build || exit
-  execute cmake -DCMAKE_INSTALL_PREFIX="${WORKSPACE}" -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_INSTALL_BINDIR=bin -DCMAKE_INSTALL_INCLUDEDIR=include -DENABLE_SHARED=OFF -DENABLE_STATIC=ON ../
-  execute make -j $MJOBS
-  execute make install
-
-  build_done "libwebp"
-fi
-CONFIGURE_OPTIONS+=("--enable-libwebp")
-
-##
-## other library
-##
-
-if build "libsdl"; then
-  download "https://www.libsdl.org/release/SDL2-2.0.14.tar.gz"
-  execute ./configure --prefix="${WORKSPACE}" --disable-shared --enable-static
-  execute make -j $MJOBS
-  execute make install
-
-  build_done "libsdl"
-fi
-
-if build "srt"; then
-  download "https://github.com/Haivision/srt/archive/v1.4.1.tar.gz" "srt-1.4.1.tar.gz"
-  export OPENSSL_ROOT_DIR="${WORKSPACE}"
-  export OPENSSL_LIB_DIR="${WORKSPACE}"/lib
-  export OPENSSL_INCLUDE_DIR="${WORKSPACE}"/include/
-  execute cmake . -DCMAKE_INSTALL_PREFIX="${WORKSPACE}" -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_INSTALL_BINDIR=bin -DCMAKE_INSTALL_INCLUDEDIR=include -DENABLE_SHARED=OFF -DENABLE_STATIC=ON -DENABLE_APPS=OFF -DUSE_STATIC_LIBSTDCXX=ON
-  execute make install
-
-  if [ -n "$LDEXEFLAGS" ]; then
-    sed -i.backup 's/-lgcc_s/-lgcc_eh/g' "${WORKSPACE}"/lib/pkgconfig/srt.pc # The -i.backup is intended and required on MacOS: https://stackoverflow.com/questions/5694228/sed-in-place-flag-that-works-both-on-mac-bsd-and-linux
-  fi
-
-  build_done "srt"
-fi
-# ERROR: srt >= 1.3.0 not found using pkg-config temp hide
-CONFIGURE_OPTIONS+=("--enable-libsrt")
-
-##
-## HWaccel library
-##
-
-# if [[ "$OSTYPE" == "linux-gnu" ]]; then
-#   if command_exists "nvcc"; then
-#     if build "nv-codec"; then
-#       download "https://github.com/FFmpeg/nv-codec-headers/releases/download/n11.0.10.0/nv-codec-headers-11.0.10.0.tar.gz"
-#       execute make PREFIX="${WORKSPACE}"
-#       execute make install PREFIX="${WORKSPACE}"
-#       build_done "nv-codec"
-#     fi
-#     CFLAGS+=" -I/usr/local/cuda/include"
-#     LDFLAGS+=" -L/usr/local/cuda/lib64"
-#     CONFIGURE_OPTIONS+=("--enable-cuda-nvcc" "--enable-cuvid" "--enable-nvenc" "--enable-cuda-llvm")
-
-#     if [ -z "$LDEXEFLAGS" ]; then
-#       CONFIGURE_OPTIONS+=("--enable-libnpp") # Only libnpp cannot be statically linked.
-#     fi
-
-#     # https://arnon.dk/matching-sm-architectures-arch-and-gencode-for-various-nvidia-cards/
-#     CONFIGURE_OPTIONS+=("--nvccflags=-gencode arch=compute_52,code=sm_52")
-#   fi
-
-#   # Vaapi doesn't work well with static links FFmpeg.
-#   if [ -z "$LDEXEFLAGS" ]; then
-#     # If the libva development SDK is installed, enable vaapi.
-#     if library_exists "libva"; then
-#       if build "vaapi"; then
-#         build_done "vaapi"
-#       fi
-#       CONFIGURE_OPTIONS+=("--enable-vaapi")
-#     fi
-#   fi
-# fi
-
-##
-## FFmpeg
-##
-
-build "ffmpeg"
-download "https://git.ffmpeg.org/gitweb/ffmpeg.git/snapshot/553eb0773763798a6b9656b621cb125e1f6edbcc.tar.gz"
-# shellcheck disable=SC2086
-./configure "${CONFIGURE_OPTIONS[@]}" \
-  --disable-debug \
-  --disable-doc \
-  --disable-shared \
-  --enable-gpl \
-  --enable-nonfree \
-  --enable-pthreads \
-  --enable-static \
-  --enable-small \
-  --enable-version3 \
-  --extra-cflags="${CFLAGS}" \
-  --extra-ldexeflags="${LDEXEFLAGS}" \
-  --extra-ldflags="${LDFLAGS}" \
-  --extra-libs="${EXTRALIBS}" \
-  --pkgconfigdir="$WORKSPACE/lib/pkgconfig" \
-  --pkg-config-flags="--static" \
-  --prefix="${WORKSPACE}"
-
-execute make -j $MJOBS
-execute make install
-
-INSTALL_FOLDER="/usr/bin"
-if [[ "$OSTYPE" == "darwin"* ]]; then
-  INSTALL_FOLDER="/usr/local/bin"
-fi
-
-verify_binary_type
-
-echo ""
-echo "Building done. The following binaries can be found here:"
-echo "- ffmpeg: $WORKSPACE/bin/ffmpeg"
-echo "- ffprobe: $WORKSPACE/bin/ffprobe"
-echo "- ffplay: $WORKSPACE/bin/ffplay"
-
-echo ""
-
-if [[ "$AUTOINSTALL" == "yes" ]]; then
-  if command_exists "sudo"; then
-    sudo cp "$WORKSPACE/bin/ffmpeg" "$INSTALL_FOLDER/ffmpeg"
-    sudo cp "$WORKSPACE/bin/ffprobe" "$INSTALL_FOLDER/ffprobe"
-    sudo cp "$WORKSPACE/bin/ffplay" "$INSTALL_FOLDER/ffplay"
-    echo "Done. FFmpeg is now installed to your system."
-  else
-    cp "$WORKSPACE/bin/ffmpeg" "$INSTALL_FOLDER/ffmpeg"
-    cp "$WORKSPACE/bin/ffprobe" "$INSTALL_FOLDER/ffprobe"
-    sudo cp "$WORKSPACE/bin/ffplay" "$INSTALL_FOLDER/ffplay"
-    echo "Done. FFmpeg is now installed to your system."
-  fi
-elif [[ ! "$SKIPINSTALL" == "yes" ]]; then
-  read -r -p "Install these binaries to your $INSTALL_FOLDER folder? Existing binaries will be replaced. [Y/n] " response
-  case $response in
-  [yY][eE][sS] | [yY])
-    if command_exists "sudo"; then
-      sudo cp "$WORKSPACE/bin/ffmpeg" "$INSTALL_FOLDER/ffmpeg"
-      sudo cp "$WORKSPACE/bin/ffprobe" "$INSTALL_FOLDER/ffprobe"
-      sudo cp "$WORKSPACE/bin/ffplay" "$INSTALL_FOLDER/ffplay"
-    else
-      cp "$WORKSPACE/bin/ffmpeg" "$INSTALL_FOLDER/ffmpeg"
-      cp "$WORKSPACE/bin/ffprobe" "$INSTALL_FOLDER/ffprobe"
-      cp "$WORKSPACE/bin/ffplay" "$INSTALL_FOLDER/ffplay"
-    fi
-    echo "Done. FFmpeg is now installed to your system."
-    ;;
-  esac
-fi
-
-##
-## build lv2 speech-denoiser
-##
-
-build "speech-denoiser"
-if ! command_exists "git"; then
-  sudo apt-get install -y git
-fi
-
-if [ ! -d "$WORKSPACE/speech-denoiser" ]; then
-  if [ "$useGitLib" -eq 1 ]; then
-    git clone $speakerURL "$WORKSPACE/speech-denoiser"
-  else
-    git clone https://github.com/lucianodato/speech-denoiser.git "$WORKSPACE/speech-denoiser"
-  fi
-fi
-cd "$WORKSPACE/speech-denoiser"
-if command_exists "python3"; then
-  pyv="$(python3 -c 'import sys; print(".".join(map(str, sys.version_info[:3])))' 2>&1)"
-  laverison="3.5.2"
-  echo "$pyv"
-  echo "detect your system python3 verison: is $pyv"
-  echo "======================="
-  comparse=$(awk 'BEGIN{ print "'$pyv'"<="'$laverison'" }')
-  if [ "$comparse" -eq 1 ]; then
-    echo "system need install system python3.7"
-    echo "======================="
-    sudo apt-get remove python3.4 -y
-    sudo apt-get install software-properties-common python-software-properties -y
-    sudo add-apt-repository ppa:deadsnakes/ppa -y
-    sudo apt-get update -y
-    sudo apt-get install python3-pip python3.7 -y
-    sudo apt-get install python3.7-gdbm -y
-  else
-    echo "system python3 $pyv,only need install meson ninja"
-    echo "======================="
-    sudo apt-get install python3-pip -y
-    sudo pip3 -H install meson ninja
-  fi
-fi
-chmod +x install.sh && sudo ./install.sh
-build_done "speech-denoiser"
-
-exit 0