feat(user/bkmpv2):Filter audio files by file extension
[BK-2020-03.git] / user / mp4_make480.sh
index abe5120a888f5b6b71770e477320e7137426945e..8799a2e08c1f3e0dba1cd13d1c4f3f79a72f4502 100644 (file)
@@ -5,7 +5,7 @@
 #        arg2  dir  output dir (optional)
 # Output: dir   ./out/
 #         file  ./out/[files]_480.mp4
-# Version: 0.1.0
+# Version: 0.1.2
 # Depends: GNU parallel 20161222, ffmpeg 4.3.6-0
 # Ref/Attrb: [1]: FFmpeg wiki: https://trac.ffmpeg.org/wiki/Scaling
 declare -g dir_in dir_out;
@@ -24,7 +24,7 @@ check_input() {
     declare -p dir_in dir_out;  # debug
 };
 convert_video() {
-    find "$dir_in" -mindepth 1 -maxdepth 1 -type f -name "*.mp4" | \
+    find "$dir_in" -mindepth 1 -maxdepth 1 -type f -iname "*.mp4" | \
         parallel job_ffmpeg "{}" "$path_out";
 };
 job_ffmpeg() {
@@ -34,7 +34,7 @@ job_ffmpeg() {
     path_out=./"$dir_out"/"${file_in%.mp4}"_480.mp4;
     opt_scale="scale=-2:480";  # See [1]
     declare -p path_in path_out file_in dir_out path_out opt_scale;
-    ffmpeg -nostdin -i "$path_in" -vf "$opt_scale" -c:a copy "$path_out" 1>/dev/random 2>&1;
+    ffmpeg -nostdin -i "$path_in" -vf "$opt_scale" "$path_out";
 };
 export -f job_ffmpeg;