1
0

Fail abort

Signed-off-by: James Ketrenos <jketreno@media.ketrenos.com>
This commit is contained in:
James Ketrenos 2022-04-09 02:08:37 +00:00
parent f6ce5fce54
commit 84bd61eb9b

View File

@ -1,6 +1,10 @@
#!/bin/bash #!/bin/bash
# Look into HW video encoding to vp9 instead of h264: # Look into HW video encoding to vp9 instead of h264:
# https://www.reddit.com/r/VP9/comments/g9uzzv/hardware_encoding_vp9_on_intel/ # https://www.reddit.com/r/VP9/comments/g9uzzv/hardware_encoding_vp9_on_intel/
fail() {
echo "$*" >&2
exit -1
}
video_detect() { video_detect() {
for file in "${*}"; do for file in "${*}"; do
@ -39,8 +43,8 @@ function move {
base="$(dirname "${IN}")" base="$(dirname "${IN}")"
[ ! -d "${base}" ] && continue [ ! -d "${base}" ] && continue
base=/remote/media/backup/"${base}" base=/remote/media/backup/"${base}"
[ ! -d "${base}" ] && mkdir -p "${base}" [ ! -d "${base}" ] && mkdir -p "${base}" || fail "Unable to mkdir '${base}'"
[ -e "${base}" ] && mv "${IN}" "${base}"/ [ -e "${base}" ] && mv "${IN}" "${base}"/ || fail "Unable to move '$IN'"
} }
function convert { function convert {
@ -139,13 +143,11 @@ function convert {
# If the original file was an '.mkv' then OUT was '.transcoded.mkv' # If the original file was an '.mkv' then OUT was '.transcoded.mkv'
# during transcode. Now that the transcode is complete, set the # during transcode. Now that the transcode is complete, set the
# file back to the original name. # file back to the original name.
mv "${OUT}" "${IN}" mv "${OUT}" "${IN}" || fail "Unable to mv '${OUT}' -> '${IN}'"
fi fi
} }
NOW=$(date +%s) NOW=$(date +%s)
echo -e "\nCompleted in $(mstodate $(( NOW - STARTTIME ))000)" echo -e "\nCompleted in $(mstodate $(( NOW - STARTTIME ))000)"
# -vcodec copy \
# -acodec aac \
} }
function check_and_convert { function check_and_convert {