2 # Desc: Reèˆncodes .mp4 videos in a specified directory.
3 # Usage: mp4_make480.sh [dir]
5 # file ./out/[files]_480.mp4
10 if [[ $# -ne 1 ]]; then echo "FATAL:No dir specified." 1>&2; exit 1; fi;
11 if [[ ! -d "$dir_in" ]]; then echo "FATAL:Not a dir:$dir_in" 1>&2; exit 1; fi;
13 declare -p dir_in dir_out
; # debug
15 while read -r line
; do
16 path_out
=.
/"$dir_out"/"${line%.mp4}"_480.mp4
;
17 declare -p line path_out
; # debug
18 ffmpeg
-nostdin -i "$dir_in" -vf "scale=-2:480" -c:a copy
"$path_out";
19 done < <(find .
-mindepth 1 -maxdepth 1 -type f
-name "*.mp4")