Przeglądaj źródła

feat: unix fomat

root 1 rok temu
rodzic
commit
0b49bdd0fc
9 zmienionych plików z 983 dodań i 982 usunięć
  1. 9 9
      .vagrant/rgloader/loader.rb
  2. 260 260
      4dage/4dage-ffmpeg
  3. 245 245
      backup/4dage-ffmpeg
  4. 260 260
      backup/4dage-ffmpeg-v1
  5. 51 51
      cap/batch_video_cover.sh
  6. 10 10
      cap/paths.txt
  7. 33 33
      cap/readme.md
  8. 60 60
      docs/documention-cn.md
  9. 55 54
      install-4dage

+ 9 - 9
.vagrant/rgloader/loader.rb

@@ -1,9 +1,9 @@
-# This file loads the proper rgloader/loader.rb file that comes packaged
-# with Vagrant so that encoded files can properly run with Vagrant.
-
-if ENV["VAGRANT_INSTALLER_EMBEDDED_DIR"]
-  require File.expand_path(
-    "rgloader/loader", ENV["VAGRANT_INSTALLER_EMBEDDED_DIR"])
-else
-  raise "Encoded files can't be read outside of the Vagrant installer."
-end
+# This file loads the proper rgloader/loader.rb file that comes packaged
+# with Vagrant so that encoded files can properly run with Vagrant.
+
+if ENV["VAGRANT_INSTALLER_EMBEDDED_DIR"]
+  require File.expand_path(
+    "rgloader/loader", ENV["VAGRANT_INSTALLER_EMBEDDED_DIR"])
+else
+  raise "Encoded files can't be read outside of the Vagrant installer."
+end

+ 260 - 260
4dage/4dage-ffmpeg

@@ -1,260 +1,260 @@
-#!/bin/bash
-
-version="0.1.7"
-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/4dage-ffmpeg.$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 baseline -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
+#!/bin/bash
+
+version="0.1.7"
+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/4dage-ffmpeg.$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 baseline -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

+ 245 - 245
backup/4dage-ffmpeg

@@ -1,245 +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
+#!/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

+ 260 - 260
backup/4dage-ffmpeg-v1

@@ -1,260 +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
+#!/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

+ 51 - 51
cap/batch_video_cover.sh

@@ -1,51 +1,51 @@
-#!/bin/bash
-
-paths=$(cat paths.txt)
-picName=''
-videoInput=''
-ossUrl='oss://oss-xiaoan' # 更改上传的oss bucket路径
-
-takeVideoCap() {
-    ffmpeg -hide_banner -loglevel error -y -i $videoInput -r 1 -ss 00:00:01 -vframes 1 -vf "transpose=1,scale=iw/4:ih/4,setsar=1:1" -f image2 "$filePath/${picName}.jpg"
-}
-
-command_exists() {
-    if ! [[ -x $(command -v "$1") ]]; then
-        return 1
-    fi
-
-    return 0
-}
-# fileurl=$1
-# directory=$2
-# /opt/ossutil/ossutil64 cp oss://4dkankan/$fileurl \-rf $directory
-
-for path in $paths; do
-    # pathParam=($path)
-    IFS=", " read -a pathParam <<<$path
-    filePath=${pathParam[0]}
-    code=${pathParam[1]}
-
-    if [ -d $filePath ] && command_exists "ffmpeg"; then
-        videoList=("$filePath/*.mp4")
-        if [ ${#videoList[@]} -gt 0 ]; then
-            for video in $videoList; do
-                echo "存在视频: ${video}"
-                filename=$(basename -- "$video")
-                filename="${filename%.*}"
-                export picName=$filename
-                export videoInput=$video
-                echo -e "\033[43;34m cap sucess : $filePath/${picName}.jpg \033[0m"
-                takeVideoCap
-
-                echo -e "upload: video/video${code}"
-                /opt/ossutil/ossutil64 cp -rf $filePath/${picName}.jpg ${ossUrl}/video/video${code}/
-                # https://4dkk2.4dage.com/video/videot-tXj1F7V/8.mp4?imagesVersion=5
-
-            done
-        fi
-    else
-        echo -e "\033[0;33m 文件夹不存在: ${filePath} \033[m"
-    fi
-
-done
+#!/bin/bash
+
+paths=$(cat paths.txt)
+picName=''
+videoInput=''
+ossUrl='oss://oss-xiaoan' # 更改上传的oss bucket路径
+
+takeVideoCap() {
+    ffmpeg -hide_banner -loglevel error -y -i $videoInput -r 1 -ss 00:00:01 -vframes 1 -vf "transpose=1,scale=iw/4:ih/4,setsar=1:1" -f image2 "$filePath/${picName}.jpg"
+}
+
+command_exists() {
+    if ! [[ -x $(command -v "$1") ]]; then
+        return 1
+    fi
+
+    return 0
+}
+# fileurl=$1
+# directory=$2
+# /opt/ossutil/ossutil64 cp oss://4dkankan/$fileurl \-rf $directory
+
+for path in $paths; do
+    # pathParam=($path)
+    IFS=", " read -a pathParam <<<$path
+    filePath=${pathParam[0]}
+    code=${pathParam[1]}
+
+    if [ -d $filePath ] && command_exists "ffmpeg"; then
+        videoList=("$filePath/*.mp4")
+        if [ ${#videoList[@]} -gt 0 ]; then
+            for video in $videoList; do
+                echo "存在视频: ${video}"
+                filename=$(basename -- "$video")
+                filename="${filename%.*}"
+                export picName=$filename
+                export videoInput=$video
+                echo -e "\033[43;34m cap sucess : $filePath/${picName}.jpg \033[0m"
+                takeVideoCap
+
+                echo -e "upload: video/video${code}"
+                /opt/ossutil/ossutil64 cp -rf $filePath/${picName}.jpg ${ossUrl}/video/video${code}/
+                # https://4dkk2.4dage.com/video/videot-tXj1F7V/8.mp4?imagesVersion=5
+
+            done
+        fi
+    else
+        echo -e "\033[0;33m 文件夹不存在: ${filePath} \033[m"
+    fi
+
+done

+ 10 - 10
cap/paths.txt

@@ -1,10 +1,10 @@
-/mnt/data/04d67f148/822047922467110912/4898cab0127d_202103171516481000/results/videos,t-bQGoxnO
-/mnt/data/029ea42e8/822061329467572224/7ca7b00e6772_202103180957505719/results/videos,t-CdcMz3M
-/mnt/data/029ea42e8/822061070460911616/7ca7b00e6772_202103180955573550/results/videos,t-jA07HxJ
-/mnt/data/029ea42e8/822060574761287680/7ca7b00e6772_202103181014456520/results/videos,t-Yp6PmZh
-/mnt/data/029ea42e8/822060406594863104/7ca7b00e6772_202103181016303210/results/videos,t-RorbeDF
-/mnt/data/029ea42e8/822056834037710848/7ca7b00e6772_202103181026294260/results/videos,t-6Khb2sJ
-/mnt/data/0454efda9/821761575101661184/7ca7b00c0675_202103171500304940/results/videos,t-ptHnKTG
-/mnt/data/02fbf551a/821717231883780096/7ca7b00b979f_202103151808497910/results/videos,t-yWfiX5K
-/mnt/data/02fbf551a/821469248969768960/7ca7b00b979f_202103160917440990/results/videos,t-2AYCRXd
-/mnt/data/020baa367/819600506555990016/7ca7b00be91d_202103111527133150/results/videos,t-tXj1F7V
+/mnt/data/04d67f148/822047922467110912/4898cab0127d_202103171516481000/results/videos,t-bQGoxnO
+/mnt/data/029ea42e8/822061329467572224/7ca7b00e6772_202103180957505719/results/videos,t-CdcMz3M
+/mnt/data/029ea42e8/822061070460911616/7ca7b00e6772_202103180955573550/results/videos,t-jA07HxJ
+/mnt/data/029ea42e8/822060574761287680/7ca7b00e6772_202103181014456520/results/videos,t-Yp6PmZh
+/mnt/data/029ea42e8/822060406594863104/7ca7b00e6772_202103181016303210/results/videos,t-RorbeDF
+/mnt/data/029ea42e8/822056834037710848/7ca7b00e6772_202103181026294260/results/videos,t-6Khb2sJ
+/mnt/data/0454efda9/821761575101661184/7ca7b00c0675_202103171500304940/results/videos,t-ptHnKTG
+/mnt/data/02fbf551a/821717231883780096/7ca7b00b979f_202103151808497910/results/videos,t-yWfiX5K
+/mnt/data/02fbf551a/821469248969768960/7ca7b00b979f_202103160917440990/results/videos,t-2AYCRXd
+/mnt/data/020baa367/819600506555990016/7ca7b00be91d_202103111527133150/results/videos,t-tXj1F7V

+ 33 - 33
cap/readme.md

@@ -1,33 +1,33 @@
-# 批量生成缩图的脚本
-
-`注意: paths.txt与batch_video_cover相同目录,如不同,可改:`
-
-```bash
-#!/bin/bash
-
-paths=$(cat paths.txt)  #修改这里
-```
-
-## batch_video_cover.sh
-
-```bash
-chmod +x batch_video_cover.sh
-# 运行脚本
-./batch_video_cover.sh
-```
-
-## paths.txt 批量格式说明 (每行对应一个)
-
-```bash
-/mnt/data/020baa367/819600506555990016/7ca7b00be91d_202103111527133150/results/videos,t-tXj1F7V
-...
-...
-# 以目录文件+逗号+场景码
-```
-
-## 更改对应的 Oss bucket
-
-```bash
- # AKA: oss://4dkankan ,oss://oss-xiaoan
-ossUrl='oss://oss-xiaoan' # 更改上传的oss bucket路径
-```
+# 批量生成缩图的脚本
+
+`注意: paths.txt与batch_video_cover相同目录,如不同,可改:`
+
+```bash
+#!/bin/bash
+
+paths=$(cat paths.txt)  #修改这里
+```
+
+## batch_video_cover.sh
+
+```bash
+chmod +x batch_video_cover.sh
+# 运行脚本
+./batch_video_cover.sh
+```
+
+## paths.txt 批量格式说明 (每行对应一个)
+
+```bash
+/mnt/data/020baa367/819600506555990016/7ca7b00be91d_202103111527133150/results/videos,t-tXj1F7V
+...
+...
+# 以目录文件+逗号+场景码
+```
+
+## 更改对应的 Oss bucket
+
+```bash
+ # AKA: oss://4dkankan ,oss://oss-xiaoan
+ossUrl='oss://oss-xiaoan' # 更改上传的oss bucket路径
+```

+ 60 - 60
docs/documention-cn.md

@@ -1,61 +1,61 @@
-# 4DAGE-FFMPEG 中文说明
-
-## 维护者: 张宇鹏 <zhangyupeng@cgaii.com>
-
-# 文档
-
-* [English](README.md)
-* [中文](docs/documention-cn.md)
-
-> 一个专门为4DAGE 4D Kankan而优化设计的FFmpeg,可以利用NVIDIA's GPU视频核心的加速,拥有python lv2的神经网络学习插件,如有speech-denoiser,ladspa等声音降噪功能,如`4dage-ffmpeg`中有使用。
-
-
-这个仓库是提供一键FFmpeg安装脚本并提供一键安装命令,包括**macOS** and **Linux** 平台,非免费播件等。
-
-## Supported Codecs(支持的解码库):
-
-- `x264`: H.264 Video Codec (MPEG-4 AVC)
-- `x265`: H.265 Video Codec (HEVC)
-- `libsvtav1`, SVT-AV1 Encoder and Decoder
-- `aom`: AV1 Video Codec (Experimental and very slow!)
-- `fdk_aac`: Fraunhofer FDK AAC Codec
-- `xvidcore`: MPEG-4 video coding standard
-- `VP8/VP9/webm`: VP8 / VP9 Video Codec for the WebM video file format
-- `mp3`: MPEG-1 or MPEG-2 Audio Layer III
-- `ogg`: Free, open container format
-- `vorbis`: Lossy audio compression format
-- `theora`: Free lossy video compression format
-- `opus`: Lossy audio coding format
-- `srt`: Secure Reliable Transport
-- `srt`: Secure Reliable Transport
-- `webp`: Image format both lossless and lossy
-
-## 一些我们使用的ffmpeg参数也参考了下面的方法:
-
-[https://gist.github.com/mikoim/27e4e0dc64e384adbcb91ff10a2d3678](https://gist.github.com/mikoim/27e4e0dc64e384adbcb91ff10a2d3678)
-
-### 一键shell全安装命令 :
-
-```bash
-$ /bin/bash -c "$(curl -fsSL http://192.168.0.115:3000/zhangyupeng/4dage-ffmpeg/raw/master/web-install.sh)" 
-```
-
-
-### 一键4dag-ffmpeg安装命令(方便升级安装) :
-
-```bash
-$ /bin/bash -c "$(curl -fsSL http://192.168.0.115:3000/zhangyupeng/4dage-ffmpeg/raw/master/install-4dage)"  
-```
-
-### Deb包安装方法:
-
-TBC
-
-### vagrant(测试):
-
-
-```bash
- vagrant up
- # seem the log to check what happen for script's onging
- tail -f /var/log/4dage-ffmpeg.log 
+# 4DAGE-FFMPEG 中文说明
+
+## 维护者: 张宇鹏 <zhangyupeng@cgaii.com>
+
+# 文档
+
+* [English](README.md)
+* [中文](docs/documention-cn.md)
+
+> 一个专门为4DAGE 4D Kankan而优化设计的FFmpeg,可以利用NVIDIA's GPU视频核心的加速,拥有python lv2的神经网络学习插件,如有speech-denoiser,ladspa等声音降噪功能,如`4dage-ffmpeg`中有使用。
+
+
+这个仓库是提供一键FFmpeg安装脚本并提供一键安装命令,包括**macOS** and **Linux** 平台,非免费播件等。
+
+## Supported Codecs(支持的解码库):
+
+- `x264`: H.264 Video Codec (MPEG-4 AVC)
+- `x265`: H.265 Video Codec (HEVC)
+- `libsvtav1`, SVT-AV1 Encoder and Decoder
+- `aom`: AV1 Video Codec (Experimental and very slow!)
+- `fdk_aac`: Fraunhofer FDK AAC Codec
+- `xvidcore`: MPEG-4 video coding standard
+- `VP8/VP9/webm`: VP8 / VP9 Video Codec for the WebM video file format
+- `mp3`: MPEG-1 or MPEG-2 Audio Layer III
+- `ogg`: Free, open container format
+- `vorbis`: Lossy audio compression format
+- `theora`: Free lossy video compression format
+- `opus`: Lossy audio coding format
+- `srt`: Secure Reliable Transport
+- `srt`: Secure Reliable Transport
+- `webp`: Image format both lossless and lossy
+
+## 一些我们使用的ffmpeg参数也参考了下面的方法:
+
+[https://gist.github.com/mikoim/27e4e0dc64e384adbcb91ff10a2d3678](https://gist.github.com/mikoim/27e4e0dc64e384adbcb91ff10a2d3678)
+
+### 一键shell全安装命令 :
+
+```bash
+$ /bin/bash -c "$(curl -fsSL http://192.168.0.115:3000/zhangyupeng/4dage-ffmpeg/raw/master/web-install.sh)" 
+```
+
+
+### 一键4dag-ffmpeg安装命令(方便升级安装) :
+
+```bash
+$ /bin/bash -c "$(curl -fsSL http://192.168.0.115:3000/zhangyupeng/4dage-ffmpeg/raw/master/install-4dage)"  
+```
+
+### Deb包安装方法:
+
+TBC
+
+### vagrant(测试):
+
+
+```bash
+ vagrant up
+ # seem the log to check what happen for script's onging
+ tail -f /var/log/4dage-ffmpeg.log 
 ```

+ 55 - 54
install-4dage

@@ -1,54 +1,55 @@
-#!/bin/sh
-
-HOMEDIR=/usr/local/4dage-ffmpeg
-
-# scriptURLFolder=http://face3d.4dage.com:7005/zhangyupeng/4dage-ffmpeg/raw/master/4dage
-scriptURLFolder=./4dage
-# 对应 4dage文件下的脚本, 批量安装
-
-declare -a installList=(
-    4dage-ffmpeg
-    4dage-ffmpeg-cam8
-    4dage-ffmpeg-img2video
-    4dage-ffmpeg-rotStereo
-    4dage-ffmpeg-overlay
-    4dage-ffmpeg-rotVwatermark
-    overlay-ffmpeg
-    4dage-ffpmeg-upgrade
-)
-
-mkdir -p $HOMEDIR
-
-command_exists() {
-    if ! [[ -x $(command -v "$1") ]]; then
-        return 1
-    fi
-
-    return 0
-}
-
-if ! command_exists "curl"; then
-    echo "curl not installed."
-    exit 1
-fi
-
-scriptInstall() {
-    scriptURL=$scriptURLFolder/$1
-    binURL=$HOMEDIR/$1
-    if ! command_exists "$1"; then
-        curl -s $scriptURL -o $binURL
-        ln -s $binURL /usr/local/bin/$1
-    else
-        curl -s $scriptURL -o $binURL
-    fi
-    echo "install $1,done"
-    chmod a+x $binURL
-
-}
-
-for i in "${installList[@]}"; do
-    scriptInstall $i
-
-done
-
-# exec bash
+#!/bin/sh
+
+HOMEDIR=/usr/local/4dage-ffmpeg
+
+# scriptURLFolder=http://face3d.4dage.com:7005/zhangyupeng/4dage-ffmpeg/raw/master/4dage
+scriptURLFolder=./4dage
+# 对应 4dage文件下的脚本, 批量安装
+
+declare -a installList=(
+    4dage-ffmpeg
+    4dage-ffmpeg-cam8
+    4dage-ffmpeg-img2video
+    4dage-ffmpeg-rotStereo
+    4dage-ffmpeg-overlay
+    4dage-ffmpeg-rotVwatermark
+    overlay-ffmpeg
+    4dage-ffpmeg-upgrade
+)
+
+mkdir -p $HOMEDIR
+
+command_exists() {
+    if ! [[ -x $(command -v "$1") ]]; then
+        return 1
+    fi
+    
+    return 0
+}
+
+if ! command_exists "curl"; then
+    echo "curl not installed."
+    exit 1
+fi
+
+scriptInstall() {
+    scriptURL=$scriptURLFolder/$1
+    binURL=$HOMEDIR/$1
+    if ! command_exists "$1"; then
+        # curl -s $scriptURL -o $binURL
+        cp $scriptURL $binURL
+        ln -s $binURL /usr/local/bin/$1
+    else
+        cp $scriptURL $binURL
+    fi
+    echo "install $1,done"
+    chmod a+x $binURL
+    
+}
+
+for i in "${installList[@]}"; do
+    scriptInstall $i
+    
+done
+
+# exec bash