gemer cheung 4 lat temu
rodzic
commit
1eb51fd79d
2 zmienionych plików z 24 dodań i 1 usunięć
  1. 5 1
      4dage-ffmpeg
  2. 19 0
      test.sh

+ 5 - 1
4dage-ffmpeg

@@ -1,6 +1,6 @@
 #!/bin/bash
 
-version="0.1.4"
+version="0.1.5"
 videoFile=''
 audioFile=''
 outputName=''
@@ -153,6 +153,9 @@ while test $# -gt 0; do
     esac
 done
 
+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##*.}
@@ -169,6 +172,7 @@ covertVideoTask() {
     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
     # 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"

+ 19 - 0
test.sh

@@ -0,0 +1,19 @@
+#/bin/bash
+
+all_num=10
+
+a=$(date +%H%M%S)
+
+testFolder=/home/gemer/un-flv/1
+
+for num in $(seq 1 ${all_num}); do
+    sleep 60
+
+    4dage-ffmpeg -s $testFolder/20210107174836.mp4 -a testFolder/20210107174836.mp3 -o $testFolder/TT -n video
+    echo ${num}
+done
+
+b=$(date +%H%M%S)
+
+echo -e "startTime:\t$a"
+echo -e "endTime:\t$b"