-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtallcus
More file actions
executable file
·22 lines (20 loc) · 780 Bytes
/
Copy pathtallcus
File metadata and controls
executable file
·22 lines (20 loc) · 780 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
allVideos=()
if [ "$1" = "all" ] # && ([ "$2" = "mkv" ] || [ "$2" = "mp4" ])
then
for i in *."$2"
do
allVideos+=("$i")
done
# adding a ! return the list of all array indices
for x in "${!allVideos[@]}"
do
ffmpeg.exe -hwaccel auto -i "${allVideos[$x]}" -map 0 -c:a "$3" -c:v "$4" -crf "$5" -rc-lookahead 40 "${allVideos[$x]%.*}_crf$5.$6"
# printf "${allVideos[$x]%.*}" # %.* removes filename extension
done
elif [ "$1" = "help" ] || [ "$1" = "h" ] || [ -z "$1" ]
then
printf "Param list :\\n1:[file] [audio codec] [video codec (add crf or qp)] \\n2:[all] [file extension] [audio codec] [video codec (add crf or qp)]"
else
ffmpeg.exe -hwaccel auto -i "$1" -map 0 -c:a "$2" -c:v "$3" -rc-lookahead 40 "$2" "${1%.*}_${2}qp_hevc.mkv"
fi