Small tweaks
This commit is contained in:
parent
08ed0a411d
commit
1474e23aea
18
.aliases
18
.aliases
|
|
@ -230,13 +230,15 @@ if [[ "${platform,,}" == *'ming'* ]]; then
|
|||
_checksum() {
|
||||
local algo="$1"
|
||||
local file="$2"
|
||||
certutil -hashfile $file $algo
|
||||
certutil -hashfile "$file" $algo
|
||||
}
|
||||
alias checksum='certutil -hashfile'
|
||||
alias checksum-md5='_checksum MD5'
|
||||
alias checksum-sha1='_checksum SHA1'
|
||||
alias checksum-sha256='_checksum SHA256'
|
||||
alias checksum-sha512='_checksum SHA512'
|
||||
|
||||
# I use delegating to certutil via _checksum() but these programs are faster.
|
||||
alias checksum-md5='md5sum.exe'
|
||||
alias checksum-sha1='sha1sum.exe'
|
||||
alias checksum-sha256='sha256sum.exe'
|
||||
alias checksum-sha512='sha512sum.exe'
|
||||
fi
|
||||
|
||||
check_signature() {
|
||||
|
|
@ -1285,11 +1287,13 @@ alias tv='echo can just do a cv with a time range...' #trim-video-vbr'
|
|||
|
||||
function compress_and_normalize_volume() {
|
||||
local final_name="$1"
|
||||
shift 1
|
||||
local opts="$@"
|
||||
if [[ $final_name == "" ]]; then
|
||||
error "Provide a final file name"
|
||||
error "Provide a final file name and optional args for compress-video"
|
||||
return
|
||||
fi
|
||||
compress-video f.mp4 ff ; normalize-volume ff.mp4 "$final_name"
|
||||
compress-video f.mp4 ff $opts ; normalize-volume ff.mp4 "$final_name"
|
||||
}
|
||||
|
||||
alias cvn='compress_and_normalize_volume'
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
# Shows you the status of an object restore job.
|
||||
#
|
||||
# e.g. aws-see-restore-status my-deep-glacier-bucket object/path.png
|
||||
# e.g. aws-check-restore-status my-deep-glacier-bucket object/path.png
|
||||
#
|
||||
# You know it's ready when ongoing-request is false and there's a date. If that field is null then the file isn't being restored.
|
||||
#
|
||||
|
|
@ -65,7 +65,7 @@ bucket="$1"
|
|||
path="$2"
|
||||
|
||||
if [[ $bucket == "" || $path == "" ]]; then
|
||||
error "Usage: aws-see-restore-status <bucket-name> <path-in-bucket>"
|
||||
error "Usage: aws-check-restore-status <bucket-name> <path-in-bucket>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
|
@ -32,7 +32,7 @@
|
|||
#
|
||||
# (obviously change the bucket and path to suit your needs).
|
||||
#
|
||||
# Or use the aws-see-restore-status script.
|
||||
# Or use the aws-check-restore-status script.
|
||||
# You know it's ready when ongoing-request is false and there's a date. If that
|
||||
# field is null then the file isn't being restored.
|
||||
#
|
||||
|
|
@ -312,7 +312,7 @@ else
|
|||
fi
|
||||
|
||||
printf "(Note: the time it takes to restore an object can be found in the AWS docs - just look for the $restore_tier restore tier, which is what you used.\\\nOnce restored, download the files from the S3 site or better yet use RCloneBrowser.\\\n"
|
||||
printf "You can check the status of a file using the aws-see-restore-status script)\\\n"
|
||||
printf "You can check the status of a file using the aws-check-restore-status script)\\\n"
|
||||
|
||||
exec 3>&-
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Bigger crf values == bigger compression.
|
||||
|
||||
if which tput >/dev/null 2>&1; then
|
||||
ncolors=$(tput colors)
|
||||
fi
|
||||
|
|
@ -24,9 +26,12 @@ else
|
|||
fi
|
||||
|
||||
use_gpu=1
|
||||
# Found the following to work best with vids containing text (e.g. programming vids). These give similar bitrates.
|
||||
cpu_crf=20
|
||||
gpu_crf=33
|
||||
|
||||
if [[ $# < 2 || $# > 5 ]]; then
|
||||
printf "${BOLD}${RED}Usage: compress-video <filename> <output name> <optional: use-gpu (1|0), defaults to $use_gpu> <optional: start time HH:MM:SS> <optional: end time HH:MM:SS> ${NORMAL}\n"
|
||||
printf "${BOLD}${RED}Usage: compress-video <filename> <output name> <optional: use-gpu (1|0), defaults to $use_gpu> <optional: start time HH:MM:SS> <optional: end time HH:MM:SS> (NOTE: gpu crf is $gpu_crf and cpu crf is $cpu_crf - change it by calling compress-video-with-crf)${NORMAL}\n"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
|
@ -37,10 +42,9 @@ if [[ $# > 2 ]]; then
|
|||
use_gpu=$3
|
||||
fi
|
||||
|
||||
# Found the following to work best with vids containing text (e.g. programming vid): 21 for CPU encoding and 28 for GPU (similar bitrates).
|
||||
use_crf=21
|
||||
use_crf=$cpu_crf
|
||||
if [[ $use_gpu -eq 1 ]]; then
|
||||
use_crf=33
|
||||
use_crf=$gpu_crf
|
||||
fi
|
||||
|
||||
compress-video-with-crf $use_crf "$filename" "$output_name" $use_gpu $4 $5
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Bigger crf values == bigger compression.
|
||||
|
||||
if which tput >/dev/null 2>&1; then
|
||||
ncolors=$(tput colors)
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -31,17 +31,17 @@ output="$2"
|
|||
target_crf="$3"
|
||||
max_bitrate_mb="$4"
|
||||
|
||||
default_crf="20"
|
||||
default_crf="33" # if you want to compress then use the same gpu compression level from compress-video (i.e. 33, but verify it's still set to this)
|
||||
default_max_bitrate="6"
|
||||
|
||||
if [[ $filename == "" || $output == "" ]]; then
|
||||
printf "${BOLD}${RED}Usage: create a text file that lists the input video paths on separate lines using the format: file '/path/to/video'. Then call:\n\njoin-video <list filename> <output name> <optional: crf (quality, w/ lower = more compression) - defaults to $default_crf, use 0 for no value> <optional: max bitrate in MB - defaults to ${default_max_bitrate}M><${NORMAL}\n"
|
||||
printf "${BOLD}${RED}Usage: create a text file that lists the input video paths on separate lines using the format: file '/path/to/video'. Then call:\n\njoin-video <list filename> <output name> <optional: crf (quality, value = compression level) - defaults to $default_crf, use 0 for no value> <optional: max bitrate in MB - defaults to ${default_max_bitrate}M>${NORMAL}\n"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
extension="${output##*.}"
|
||||
if [[ $extension == $output ]]; then
|
||||
printf "${BOLD}${RED}output arg should have an extension!\n\nUsage: join-video <list filename> <output name> <optional: crf (quality, w/ lower = more compression) - defaults to $default_crf, use 0 for no value> <optional: max bitrate in MB - defaults to ${default_max_bitrate}M><${NORMAL}\n"
|
||||
printf "${BOLD}${RED}output arg should have an extension!\n\nUsage: join-video <list filename> <output name> <optional: crf (quality, value = compression level) - defaults to $default_crf, use 0 for no value> <optional: max bitrate in MB - defaults to ${default_max_bitrate}M>${NORMAL}\n"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Re-encodes the video using a constrained bitrate/output size. If you want to
|
||||
# To target the visual quality with a variable bitrate, use trim-video-vbr
|
||||
# control the visual quality with a variable bitrate then use trim-video-vbr
|
||||
|
||||
if which tput >/dev/null 2>&1; then
|
||||
ncolors=$(tput colors)
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@
|
|||
# To have a mostly fixed bitrate with no variable quality, use trim-video-target-rate
|
||||
# Just note that it'll result in larger files for a similar max bitrate target and the
|
||||
# quality won't really be noticeably better.
|
||||
#
|
||||
# The higher the CRF value, the higher the compression.
|
||||
|
||||
if which tput >/dev/null 2>&1; then
|
||||
ncolors=$(tput colors)
|
||||
|
|
@ -35,11 +37,11 @@ end_time="$4"
|
|||
target_crf="$5"
|
||||
max_bitrate_mb="$6"
|
||||
|
||||
default_crf="20"
|
||||
default_crf="33" # if you want to compress then use the same gpu compression level from compress-video (i.e. 33, but verify it's still set to this)
|
||||
default_max_bitrate="6"
|
||||
|
||||
if [[ $filename == "" || $output_name == "" || $start_time == "" ]]; then
|
||||
printf "${BOLD}${RED}Usage: trim-video <filename> <output name> <start time HH:MM:SS> <optional: end time HH:MM:SS, use empty string or 0 for no value> <optional: crf (quality, w/ lower = more compression) - defaults to $default_crf, use 0 for no value> <optional: max bitrate in MB - defaults to ${default_max_bitrate}M>${NORMAL}\n"
|
||||
printf "${BOLD}${RED}Usage: trim-video-vbr <filename> <output name> <start time HH:MM:SS> <optional: end time HH:MM:SS, use empty string or 0 for no value> <optional: crf (quality, value = compression level) - defaults to $default_crf, use 0 for no value> <optional: max bitrate in MB - defaults to ${default_max_bitrate}M>${NORMAL}\n"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user