gemer 4 years ago
parent
commit
13b2d0e03b
1 changed files with 15 additions and 21 deletions
  1. 15 21
      install-ffmpeg

+ 15 - 21
install-ffmpeg

@@ -15,7 +15,7 @@ CONFIGURE_OPTIONS=()
 useGitLib=""
 packageURL=http://face3d.4dage.com:7005/zhangyupeng/4dage-ffmpeg/raw/master/packages.tar.gz
 speakerURL=http://face3d.4dage.com:7005/zhangyupeng/speech-denoiser.git
-NONFREE_AND_GPL=false
+# NONFREE_AND_GPL=false
 # Check for Apple Silicon
 if [[ ("$(uname -m)" == "arm64") && ("$OSTYPE" == "darwin"*) ]]; then
   # If arm64 AND darwin (macOS)
@@ -204,11 +204,6 @@ while (($# > 0)); do
     if [[ "$1" == "--build" || "$1" =~ 'b' ]]; then
       bflag='-b'
     fi
-      if [[ "$1" == "--enable-gpl-and-non-free" ]]; then
-      CONFIGURE_OPTIONS+=("--enable-nonfree")
-      CONFIGURE_OPTIONS+=("--enable-gpl")
-      NONFREE_AND_GPL=true
-    fi
     if [[ "$1" == "--cleanup" || "$1" =~ 'c' && ! "$1" =~ '--' ]]; then
       cflag='-c'
       cleanup
@@ -275,6 +270,9 @@ buildEssentialLib() {
 }
 buildEssentialLib
 
+CONFIGURE_OPTIONS+=("--enable-nonfree")
+CONFIGURE_OPTIONS+=("--enable-gpl")
+
 if ! command_exists "make"; then
   echo "make not installed."
   exit 1
@@ -506,23 +504,21 @@ if build "xvidcore"; then
 fi
 CONFIGURE_OPTIONS+=("--enable-libxvid")
 
-if $NONFREE_AND_GPL; then
-  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 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
+  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
+  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")
+  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"
@@ -723,7 +719,6 @@ fi
 #   --pkg-config-flags="--static" \
 #   --prefix="${WORKSPACE}"
 
-
 build "ffmpeg"
 download "https://www.ffmpeg.org/releases/ffmpeg-4.4.tar.gz"
 # shellcheck disable=SC2086
@@ -743,7 +738,6 @@ download "https://www.ffmpeg.org/releases/ffmpeg-4.4.tar.gz"
   --pkg-config-flags="--static" \
   --prefix="${WORKSPACE}"
 
-
 execute make -j $MJOBS
 execute make install