Browse Source

modifly some justly for filer

gemer 4 years ago
parent
commit
4b8d6a2f64
7 changed files with 84 additions and 184 deletions
  1. 3 3
      4dage-ffmpeg.sh
  2. 6 1
      README.md
  3. 1 1
      Vagrantfile
  4. 5 0
      install-4dage
  5. 67 34
      install-ffmpeg
  6. 0 143
      install-ffmpeg.sh
  7. 2 2
      vagrant-installer.sh

+ 3 - 3
4dage-ffmpeg.sh

@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 videoFile=''
 audioFile=''
@@ -152,8 +152,8 @@ covertVideoTask() {
     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
+    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
     # 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"

+ 6 - 1
README.md

@@ -28,7 +28,12 @@ This repository is build with the FFmpeg build script provides an easy way to bu
 
 [https://gist.github.com/mikoim/27e4e0dc64e384adbcb91ff10a2d3678](https://gist.github.com/mikoim/27e4e0dc64e384adbcb91ff10a2d3678)
 
-# Easy installnation:
+# Easy installation:
+
+
+
+
+
 
 
 

+ 1 - 1
Vagrantfile

@@ -11,5 +11,5 @@ Vagrant.configure("2") do |config|
   #   config.proxy.https    = "http://$vagrant_host:7890/"
   #   config.proxy.no_proxy = "localhost,127.0.0.1,.example.com"
   # end
-  # config.vm.provision "shell", path: "vagrant-installer.sh"
+  config.vm.provision "shell", path: "vagrant-installer.sh"
 end

+ 5 - 0
install-4dage

@@ -0,0 +1,5 @@
+#!/bin/bash
+
+cat <(curl -s http://192.168.0.115:3000/zhangyupeng/4dage-ffmpeg/src/b7ebf1fa1fdd0ba1af370cb76e067c879da54d9f/4dage-ffmpeg.sh) > /usr/local/4dage-ffmpeg
+chmod a+x /usr/local/4dage-ffmpeg
+ln -s /usr/local/4dage-ffmpeg /usr/bin/4dage-ffmpeg

+ 67 - 34
install-ffmpeg

@@ -1,7 +1,5 @@
 #!/bin/bash
-
-# HOMEPAGE: https://github.com/markus-perl/ffmpeg-build-script
-# LICENSE: https://github.com/markus-perl/ffmpeg-build-script/blob/master/LICENSE
+# export http_proxy=http://192.168.0.144:7890   https_proxy=http://192.168.0.144:7890 
 
 PROGNAME=$(basename "$0")
 VERSION=1.22
@@ -628,43 +626,44 @@ if build "srt"; then
 
   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
+# 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
@@ -739,4 +738,38 @@ elif [[ ! "$SKIPINSTALL" == "yes" ]]; then
   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
+#   git clone https://github.com/lucianodato/speech-denoiser.git "$WORKSPACE/speech-denoiser"
+# fi
+
+# cd "$WORKSPACE/speech-denoiser"
+# sudo apt-get install -y ninja-build python3-pip
+# 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"
+#   # if [ 1 -eq "$(echo "${pyv} > ${laverison}" | bc)" ];then
+#   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.6 -y
+#   # fi
+#   sudo pip3 install meson
+# # else
+# #   sudo apt-get install -y python3-pip
+# #   sudo pip3 install meson
+# fi
+# chmod +x install.sh && ./install.sh
+# build_done "speech-denoiser"
+
 exit 0

+ 0 - 143
install-ffmpeg.sh

@@ -1,143 +0,0 @@
-#!/bin/bash
-
-#ubuntu: 14.04+
-#
-
-#install required things from apt
-installLibs() {
-    echo "Installing prerequisites"
-    sudo apt-get update
-    sudo apt-get -y --force-yes install autoconf automake build-essential libass-dev libfreetype6-dev libgpac-dev \
-        libsdl1.2-dev libtheora-dev libtool libva-dev libvdpau-dev libvorbis-dev libxcb1-dev libxcb-shm0-dev \
-        libxcb-xfixes0-dev pkg-config texi2html zlib1g-dev
-}
-
-#Compile nasm
-compileNasm() {
-    echo "Compiling nasm"
-    cd ~/ffmpeg_sources
-    wget http://www.nasm.us/pub/nasm/releasebuilds/2.14rc0/nasm-2.14rc0.tar.gz
-    tar xzvf nasm-2.14rc0.tar.gz
-    cd nasm-2.14rc0
-    ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin"
-    make -j$(nproc)
-    make -j$(nproc) install
-    make -j$(nproc) distclean
-}
-
-#Compile libx264
-compileLibX264() {
-    echo "Compiling libx264"
-    cd ~/ffmpeg_sources
-    wget http://download.videolan.org/pub/x264/snapshots/last_x264.tar.bz2
-    tar xjvf last_x264.tar.bz2
-    cd x264-snapshot*
-    PATH="$HOME/bin:$PATH" ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" --enable-static
-    PATH="$HOME/bin:$PATH" make -j$(nproc)
-    make -j$(nproc) install
-    make -j$(nproc) distclean
-}
-
-#Compile libfdk-acc
-compileLibfdkcc() {
-    echo "Compiling libfdk-cc"
-    sudo apt-get install unzip
-    cd ~/ffmpeg_sources
-    wget -O fdk-aac.zip https://github.com/mstorsjo/fdk-aac/zipball/master
-    unzip fdk-aac.zip
-    cd mstorsjo-fdk-aac*
-    autoreconf -fiv
-    ./configure --prefix="$HOME/ffmpeg_build" --disable-shared
-    make -j$(nproc)
-    make -j$(nproc) install
-    make -j$(nproc) distclean
-}
-
-#Compile libmp3lame
-compileLibMP3Lame() {
-    echo "Compiling libmp3lame"
-    sudo apt-get install nasm
-    cd ~/ffmpeg_sources
-    wget http://downloads.sourceforge.net/project/lame/lame/3.99/lame-3.99.5.tar.gz
-    tar xzvf lame-3.99.5.tar.gz
-    cd lame-3.99.5
-    ./configure --prefix="$HOME/ffmpeg_build" --enable-nasm --disable-shared
-    make -j$(nproc)
-    make -j$(nproc) install
-    make -j$(nproc) distclean
-}
-
-#Compile libopus
-compileLibOpus() {
-    echo "Compiling libopus"
-    cd ~/ffmpeg_sources
-    wget http://downloads.xiph.org/releases/opus/opus-1.2.1.tar.gz
-    tar xzvf opus-1.2.1.tar.gz
-    cd opus-1.2.1
-    ./configure --prefix="$HOME/ffmpeg_build" --disable-shared
-    make -j$(nproc)
-    make -j$(nproc) install
-    make -j$(nproc) distclean
-}
-
-#Compile libvpx
-compileLibPvx() {
-    echo "Compiling libvpx"
-    cd ~/ffmpeg_sources
-    git clone https://chromium.googlesource.com/webm/libvpx
-    cd libvpx
-    PATH="$HOME/bin:$PATH" ./configure --prefix="$HOME/ffmpeg_build" --disable-examples --enable-runtime-cpu-detect --enable-vp9 --enable-vp8 \
-        --enable-postproc --enable-vp9-postproc --enable-multi-res-encoding --enable-webm-io --enable-better-hw-compatibility --enable-vp9-highbitdepth --enable-onthefly-bitpacking --enable-realtime-only \
-        --cpu=native --as=nasm
-    PATH="$HOME/bin:$PATH" make -j$(nproc)
-    make -j$(nproc) install
-    make -j$(nproc) clean
-}
-
-#Compile ffmpeg
-compileFfmpeg() {
-    echo "Compiling ffmpeg"
-    cd ~/ffmpeg_sources
-    git clone https://github.com/FFmpeg/FFmpeg -b master
-    cd FFmpeg
-    PATH="$HOME/bin:$PATH" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure \
-        --prefix="$HOME/ffmpeg_build" \
-        --extra-cflags="-I$HOME/ffmpeg_build/include" \
-        --extra-ldflags="-L$HOME/ffmpeg_build/lib" \
-        --bindir="$HOME/bin" \
-        --enable-cuvid \
-        --enable-libnpp \
-        --enable-gpl \
-        --enable-libass \
-        --enable-libfdk-aac \
-        --enable-vaapi \
-        --enable-libfreetype \
-        --enable-libmp3lame \
-        --enable-libopus \
-        --enable-libtheora \
-        --enable-libvorbis \
-        --enable-libvpx \
-        --enable-libx264 \
-        --enable-libx265 \
-        --enable-nonfree \
-        --enable-lv2 \
-        --samples=fate-suite/
-
-    PATH="$HOME/bin:$PATH" make -j$(nproc)
-    make -j$(nproc) install
-    make -j$(nproc) distclean
-    hash -r
-}
-
-#The process
-cd ~
-mkdir ffmpeg_sources
-installLibs
-compileNasm
-compileLibX264
-compileLibfdkcc
-compileLibMP3Lame
-compileLibOpus
-compileLibPvx
-compileFfmpeg
-echo "Complete!"

+ 2 - 2
vagrant-installer.sh

@@ -1,6 +1,6 @@
 #!/bin/sh
 
 sudo apt-get install build-essential -y
-sudo apt install nvidia-cuda-toolkit -y
+# sudo apt install nvidia-cuda-toolkit -y
 
-bash /vagrant/install-ffmpeg --build
+bash /vagrant/install-ffmpeg --build