Change the way we detect Windows admin permission
This commit is contained in:
parent
e1f29f72e1
commit
3dec337272
|
@ -45,18 +45,17 @@ function encode() {
|
||||||
output="${output_name}.$extension"
|
output="${output_name}.$extension"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
printf "\n${YELLOW}${BOLD}Encoding with crf $crf | output: $output${NORMAL}\n"
|
printf "\n${YELLOW}${BOLD}Encoding '$filename.$extension' with CRF $crf | output: $output${NORMAL}\n"
|
||||||
ffmpeg -i "$filename.$extension" -c:v libx264 -crf $crf -preset veryfast -profile:v baseline -level 3.0 -strict -2 "$output"
|
ffmpeg -i "$filename.$extension" -c:v libx264 -crf $crf -preset veryfast -profile:v baseline -level 3.0 -strict -2 "$output"
|
||||||
printf "\n${GREEN}${BOLD}Done encoding with crf $crf${NORMAL}\n\n"
|
printf "\n${GREEN}${BOLD}Done encoding '$filename.$extension' with CRF $crf${NORMAL}\n\n"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if [[ $use_crf == "" ]]; then
|
if [[ $use_crf == "" ]]; then
|
||||||
use_crf=$default_crf
|
use_crf=$default_crf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $use_crf == -1 ]]; then
|
if [[ $use_crf == -1 ]]; then
|
||||||
printf "\n${YELLOW}${BOLD}Encoding using a range of crf values.${NORMAL}\n"
|
printf "\n${YELLOW}${BOLD}Encoding using a range of CRF values.${NORMAL}\n"
|
||||||
|
|
||||||
# Bigger crf values == bigger compression.
|
# Bigger crf values == bigger compression.
|
||||||
for crf in {25..28}
|
for crf in {25..28}
|
||||||
|
|
6
install
6
install
|
@ -20,9 +20,11 @@ os_is_windows is_windows
|
||||||
os_is_macos is_macos
|
os_is_macos is_macos
|
||||||
os_is_linux is_linux
|
os_is_linux is_linux
|
||||||
|
|
||||||
|
# Check for admin permissions when running on Windows.
|
||||||
if [[ $is_windows -eq 1 ]]; then
|
if [[ $is_windows -eq 1 ]]; then
|
||||||
# Check for admin permissions.
|
# `openfiles` is a command present on all supported Windows versions,
|
||||||
net session &>/dev/null
|
# requires admin privileges, and has no side effects.
|
||||||
|
openfiles &>/dev/null
|
||||||
admin_error=$?
|
admin_error=$?
|
||||||
if [[ ! $admin_error -eq 0 ]]; then
|
if [[ ! $admin_error -eq 0 ]]; then
|
||||||
fatal "You need to run this in an admin shell!"
|
fatal "You need to run this in an admin shell!"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user