Explorar o código

add scale type

gemer %!s(int64=4) %!d(string=hai) anos
pai
achega
cdc64e0302
Modificáronse 4 ficheiros con 26 adicións e 14 borrados
  1. 3 2
      4dage-ffmpeg.sh
  2. 7 0
      README.md
  3. 14 10
      Vagrantfile
  4. 2 2
      vagrant-installer.sh

+ 3 - 2
4dage-ffmpeg.sh

@@ -150,9 +150,10 @@ covertVideoTask() {
     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.0 -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.0 -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"

+ 7 - 0
README.md

@@ -0,0 +1,7 @@
+# 4DAGE-FFMPEG
+## This repo
+
+
+## Base on youtube 's recommended params spec. 
+
+https://gist.github.com/mikoim/27e4e0dc64e384adbcb91ff10a2d3678

+ 14 - 10
Vagrantfile

@@ -1,11 +1,15 @@
 Vagrant.configure("2") do |config|
-    config.vm.box = "bento/ubuntu-14.04"
-    config.vm.box_version = "201808.24.0"
-    config.vm.synced_folder ".", "/vagrant", type: "rsync"
-    # if Vagrant.has_plugin?("vagrant-proxyconf")
-    #   config.proxy.http     = "http://192.168.2.108:7890/"
-    #   config.proxy.https    = "http://192.168.2.108:7890/"
-    #   config.proxy.no_proxy = "localhost,127.0.0.1,.example.com"
-    # end
-    # config.vm.provision "shell", path: "vagrant-installer.sh"
-  end
+  config.vm.box = "bento/ubuntu-14.04"
+  config.vm.box_version = "201808.24.0"
+  config.vm.synced_folder ".", "/vagrant", type: "rsync"
+  config.vm.provider "virtualbox" do |vb|
+    vb.memory = "2048"
+    vb.cpus = "2"
+  end
+  # if Vagrant.has_plugin?("vagrant-proxyconf")
+  #   config.proxy.http     = "http://$vagrant_host:7890/"
+  #   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"
+end

+ 2 - 2
vagrant-installer.sh

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