added nautilus scripts (needs nautilus-python package)
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Source the script 'common-functions.sh'.
|
||||
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
|
||||
ROOT_DIR=$(grep --only-matching "^.*scripts[^/]*" <<<"$SCRIPT_DIR")
|
||||
source "$ROOT_DIR/common-functions.sh"
|
||||
|
||||
_main() {
|
||||
local input_files=""
|
||||
local output_dir=""
|
||||
|
||||
# Execute initial checks.
|
||||
_check_dependencies "
|
||||
command=ffmpeg; pkg_manager=apt; package=ffmpeg |
|
||||
command=ffmpeg; pkg_manager=dnf; package=ffmpeg-free |
|
||||
command=ffmpeg; pkg_manager=pacman; package=ffmpeg |
|
||||
command=ffmpeg; pkg_manager=zypper; package=ffmpeg"
|
||||
_display_wait_box "2"
|
||||
input_files=$(_get_files "par_type=file; par_select_mime='audio/|video/'; par_min_items=2; par_sort_list=true")
|
||||
output_dir=$(_get_output_dir "par_use_same_dir=true")
|
||||
|
||||
_main_task "$input_files" "$output_dir"
|
||||
_display_result_box "$output_dir"
|
||||
}
|
||||
|
||||
_main_task() {
|
||||
local input_files=$1
|
||||
local output_dir=$2
|
||||
local output_file=""
|
||||
local std_output=""
|
||||
|
||||
# Create the input list for the 'ffmpeg'.
|
||||
local temp_file=""
|
||||
temp_file=$(_get_temp_file)
|
||||
input_files="file '$input_files'"
|
||||
# shellcheck disable=SC2001
|
||||
input_files=$(sed "s|$FIELD_SEPARATOR|'${FIELD_SEPARATOR}file '|g" <<<"$input_files")
|
||||
_convert_filenames_to_text "$input_files" >"$temp_file"
|
||||
|
||||
# Run the main process.
|
||||
output_file=$(_get_output_filename "Concatenated audio.wav" "$output_dir" "par_extension_opt=preserve")
|
||||
std_output=$(ffmpeg -hide_banner -y -f "concat" -safe 0 -i "$temp_file" -- "$output_file" 2>&1)
|
||||
_check_output "$?" "$std_output" "" "$output_file" || return 1
|
||||
}
|
||||
|
||||
_main "$@"
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Source the script 'common-functions.sh'.
|
||||
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
|
||||
ROOT_DIR=$(grep --only-matching "^.*scripts[^/]*" <<<"$SCRIPT_DIR")
|
||||
source "$ROOT_DIR/common-functions.sh"
|
||||
|
||||
_main() {
|
||||
local input_files=""
|
||||
local output_dir=""
|
||||
|
||||
# Execute initial checks.
|
||||
_check_dependencies "
|
||||
command=ffmpeg; pkg_manager=apt; package=ffmpeg |
|
||||
command=ffmpeg; pkg_manager=dnf; package=ffmpeg-free |
|
||||
command=ffmpeg; pkg_manager=pacman; package=ffmpeg |
|
||||
command=ffmpeg; pkg_manager=zypper; package=ffmpeg"
|
||||
_display_wait_box "2"
|
||||
input_files=$(_get_files "par_type=file; par_select_mime='audio/|video/'; par_validate_conflict=true")
|
||||
output_dir=$(_get_output_dir "par_use_same_dir=true")
|
||||
|
||||
# Execute the function '_main_task' for each file in parallel.
|
||||
_run_task_parallel "$input_files" "$output_dir"
|
||||
_display_result_box "$output_dir"
|
||||
}
|
||||
|
||||
_main_task() {
|
||||
local input_file=$1
|
||||
local output_dir=$2
|
||||
local output_file=""
|
||||
local std_output=""
|
||||
|
||||
# Run the main process.
|
||||
output_file=$(_get_output_filename "$input_file" "$output_dir" "par_extension_opt=replace; par_extension=flac")
|
||||
std_output=$(ffmpeg -hide_banner -y -i "$input_file" -vn -ac 2 -- "$output_file" 2>&1)
|
||||
_check_output "$?" "$std_output" "$input_file" "$output_file" || return 1
|
||||
}
|
||||
|
||||
_main "$@"
|
||||
@@ -0,0 +1,39 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Source the script 'common-functions.sh'.
|
||||
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
|
||||
ROOT_DIR=$(grep --only-matching "^.*scripts[^/]*" <<<"$SCRIPT_DIR")
|
||||
source "$ROOT_DIR/common-functions.sh"
|
||||
|
||||
_main() {
|
||||
local input_files=""
|
||||
local output_dir=""
|
||||
|
||||
# Execute initial checks.
|
||||
_check_dependencies "
|
||||
command=ffmpeg; pkg_manager=apt; package=ffmpeg |
|
||||
command=ffmpeg; pkg_manager=dnf; package=ffmpeg-free |
|
||||
command=ffmpeg; pkg_manager=pacman; package=ffmpeg |
|
||||
command=ffmpeg; pkg_manager=zypper; package=ffmpeg"
|
||||
_display_wait_box "2"
|
||||
input_files=$(_get_files "par_type=file; par_select_mime='audio/|video/'; par_validate_conflict=true")
|
||||
output_dir=$(_get_output_dir "par_use_same_dir=true")
|
||||
|
||||
# Execute the function '_main_task' for each file in parallel.
|
||||
_run_task_parallel "$input_files" "$output_dir"
|
||||
_display_result_box "$output_dir"
|
||||
}
|
||||
|
||||
_main_task() {
|
||||
local input_file=$1
|
||||
local output_dir=$2
|
||||
local output_file=""
|
||||
local std_output=""
|
||||
|
||||
# Run the main process.
|
||||
output_file=$(_get_output_filename "$input_file" "$output_dir" "par_extension_opt=replace; par_extension=mp3")
|
||||
std_output=$(ffmpeg -hide_banner -y -i "$input_file" -vn -c:a libmp3lame -b:a 192k -ac 2 -- "$output_file" 2>&1)
|
||||
_check_output "$?" "$std_output" "$input_file" "$output_file" || return 1
|
||||
}
|
||||
|
||||
_main "$@"
|
||||
@@ -0,0 +1,39 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Source the script 'common-functions.sh'.
|
||||
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
|
||||
ROOT_DIR=$(grep --only-matching "^.*scripts[^/]*" <<<"$SCRIPT_DIR")
|
||||
source "$ROOT_DIR/common-functions.sh"
|
||||
|
||||
_main() {
|
||||
local input_files=""
|
||||
local output_dir=""
|
||||
|
||||
# Execute initial checks.
|
||||
_check_dependencies "
|
||||
command=ffmpeg; pkg_manager=apt; package=ffmpeg |
|
||||
command=ffmpeg; pkg_manager=dnf; package=ffmpeg-free |
|
||||
command=ffmpeg; pkg_manager=pacman; package=ffmpeg |
|
||||
command=ffmpeg; pkg_manager=zypper; package=ffmpeg"
|
||||
_display_wait_box "2"
|
||||
input_files=$(_get_files "par_type=file; par_select_mime='audio/|video/'; par_validate_conflict=true")
|
||||
output_dir=$(_get_output_dir "par_use_same_dir=true")
|
||||
|
||||
# Execute the function '_main_task' for each file in parallel.
|
||||
_run_task_parallel "$input_files" "$output_dir"
|
||||
_display_result_box "$output_dir"
|
||||
}
|
||||
|
||||
_main_task() {
|
||||
local input_file=$1
|
||||
local output_dir=$2
|
||||
local output_file=""
|
||||
local std_output=""
|
||||
|
||||
# Run the main process.
|
||||
output_file=$(_get_output_filename "$input_file" "$output_dir" "par_extension_opt=replace; par_extension=mp3")
|
||||
std_output=$(ffmpeg -hide_banner -y -i "$input_file" -vn -c:a libmp3lame -b:a 320k -ac 2 -- "$output_file" 2>&1)
|
||||
_check_output "$?" "$std_output" "$input_file" "$output_file" || return 1
|
||||
}
|
||||
|
||||
_main "$@"
|
||||
@@ -0,0 +1,39 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Source the script 'common-functions.sh'.
|
||||
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
|
||||
ROOT_DIR=$(grep --only-matching "^.*scripts[^/]*" <<<"$SCRIPT_DIR")
|
||||
source "$ROOT_DIR/common-functions.sh"
|
||||
|
||||
_main() {
|
||||
local input_files=""
|
||||
local output_dir=""
|
||||
|
||||
# Execute initial checks.
|
||||
_check_dependencies "
|
||||
command=ffmpeg; pkg_manager=apt; package=ffmpeg |
|
||||
command=ffmpeg; pkg_manager=dnf; package=ffmpeg-free |
|
||||
command=ffmpeg; pkg_manager=pacman; package=ffmpeg |
|
||||
command=ffmpeg; pkg_manager=zypper; package=ffmpeg"
|
||||
_display_wait_box "2"
|
||||
input_files=$(_get_files "par_type=file; par_select_mime='audio/|video/'; par_validate_conflict=true")
|
||||
output_dir=$(_get_output_dir "par_use_same_dir=true")
|
||||
|
||||
# Execute the function '_main_task' for each file in parallel.
|
||||
_run_task_parallel "$input_files" "$output_dir"
|
||||
_display_result_box "$output_dir"
|
||||
}
|
||||
|
||||
_main_task() {
|
||||
local input_file=$1
|
||||
local output_dir=$2
|
||||
local output_file=""
|
||||
local std_output=""
|
||||
|
||||
# Run the main process.
|
||||
output_file=$(_get_output_filename "$input_file" "$output_dir" "par_extension_opt=replace; par_extension=mp3")
|
||||
std_output=$(ffmpeg -hide_banner -y -i "$input_file" -vn -c:a libmp3lame -b:a 48k -ac 1 -- "$output_file" 2>&1)
|
||||
_check_output "$?" "$std_output" "$input_file" "$output_file" || return 1
|
||||
}
|
||||
|
||||
_main "$@"
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Source the script 'common-functions.sh'.
|
||||
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
|
||||
ROOT_DIR=$(grep --only-matching "^.*scripts[^/]*" <<<"$SCRIPT_DIR")
|
||||
source "$ROOT_DIR/common-functions.sh"
|
||||
|
||||
_main() {
|
||||
local input_files=""
|
||||
local output_dir=""
|
||||
|
||||
# Execute initial checks.
|
||||
_check_dependencies "
|
||||
command=ffmpeg; pkg_manager=apt; package=ffmpeg |
|
||||
command=ffmpeg; pkg_manager=dnf; package=ffmpeg-free |
|
||||
command=ffmpeg; pkg_manager=pacman; package=ffmpeg |
|
||||
command=ffmpeg; pkg_manager=zypper; package=ffmpeg"
|
||||
_display_wait_box "2"
|
||||
input_files=$(_get_files "par_type=file; par_select_mime='audio/|video/'; par_validate_conflict=true")
|
||||
output_dir=$(_get_output_dir "par_use_same_dir=true")
|
||||
|
||||
# Execute the function '_main_task' for each file in parallel.
|
||||
_run_task_parallel "$input_files" "$output_dir"
|
||||
_display_result_box "$output_dir"
|
||||
}
|
||||
|
||||
_main_task() {
|
||||
local input_file=$1
|
||||
local output_dir=$2
|
||||
local output_file=""
|
||||
local std_output=""
|
||||
|
||||
# Run the main process.
|
||||
output_file=$(_get_output_filename "$input_file" "$output_dir" "par_extension_opt=replace; par_extension=ogg")
|
||||
std_output=$(ffmpeg -hide_banner -y -i "$input_file" -vn -ac 2 -- "$output_file" 2>&1)
|
||||
_check_output "$?" "$std_output" "$input_file" "$output_file" || return 1
|
||||
}
|
||||
|
||||
_main "$@"
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Source the script 'common-functions.sh'.
|
||||
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
|
||||
ROOT_DIR=$(grep --only-matching "^.*scripts[^/]*" <<<"$SCRIPT_DIR")
|
||||
source "$ROOT_DIR/common-functions.sh"
|
||||
|
||||
_main() {
|
||||
local input_files=""
|
||||
local output_dir=""
|
||||
|
||||
# Execute initial checks.
|
||||
_check_dependencies "
|
||||
command=ffmpeg; pkg_manager=apt; package=ffmpeg |
|
||||
command=ffmpeg; pkg_manager=dnf; package=ffmpeg-free |
|
||||
command=ffmpeg; pkg_manager=pacman; package=ffmpeg |
|
||||
command=ffmpeg; pkg_manager=zypper; package=ffmpeg"
|
||||
_display_wait_box "2"
|
||||
input_files=$(_get_files "par_type=file; par_select_mime='audio/|video/'; par_validate_conflict=true")
|
||||
output_dir=$(_get_output_dir "par_use_same_dir=true")
|
||||
|
||||
# Execute the function '_main_task' for each file in parallel.
|
||||
_run_task_parallel "$input_files" "$output_dir"
|
||||
_display_result_box "$output_dir"
|
||||
}
|
||||
|
||||
_main_task() {
|
||||
local input_file=$1
|
||||
local output_dir=$2
|
||||
local output_file=""
|
||||
local std_output=""
|
||||
|
||||
# Run the main process.
|
||||
output_file=$(_get_output_filename "$input_file" "$output_dir" "par_extension_opt=replace; par_extension=wav")
|
||||
std_output=$(ffmpeg -hide_banner -y -i "$input_file" -vn -ac 2 -- "$output_file" 2>&1)
|
||||
_check_output "$?" "$std_output" "$input_file" "$output_file" || return 1
|
||||
}
|
||||
|
||||
_main "$@"
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Source the script 'common-functions.sh'.
|
||||
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
|
||||
ROOT_DIR=$(grep --only-matching "^.*scripts[^/]*" <<<"$SCRIPT_DIR")
|
||||
source "$ROOT_DIR/common-functions.sh"
|
||||
|
||||
_main() {
|
||||
local input_files=""
|
||||
local output_dir=""
|
||||
|
||||
# Execute initial checks.
|
||||
_check_dependencies "
|
||||
command=ffmpeg; pkg_manager=apt; package=ffmpeg |
|
||||
command=ffmpeg; pkg_manager=dnf; package=ffmpeg-free |
|
||||
command=ffmpeg; pkg_manager=pacman; package=ffmpeg |
|
||||
command=ffmpeg; pkg_manager=zypper; package=ffmpeg"
|
||||
_display_wait_box "2"
|
||||
input_files=$(_get_files "par_type=file; par_select_mime='audio/|video/'")
|
||||
output_dir=$(_get_output_dir "par_use_same_dir=false")
|
||||
|
||||
# Execute the function '_main_task' for each file in parallel.
|
||||
_run_task_parallel "$input_files" "$output_dir"
|
||||
_display_result_box "$output_dir"
|
||||
}
|
||||
|
||||
_main_task() {
|
||||
local input_file=$1
|
||||
local output_dir=$2
|
||||
local output_file=""
|
||||
local std_output=""
|
||||
|
||||
# Run the main process.
|
||||
output_file=$(_get_output_filename "$input_file" "$output_dir" "par_extension_opt=preserve")
|
||||
std_output=$(ffmpeg -hide_banner -y -i "$input_file" -filter:a "afade=d=10" -- "$output_file" 2>&1)
|
||||
_check_output "$?" "$std_output" "$input_file" "$output_file" || return 1
|
||||
}
|
||||
|
||||
_main "$@"
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Source the script 'common-functions.sh'.
|
||||
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
|
||||
ROOT_DIR=$(grep --only-matching "^.*scripts[^/]*" <<<"$SCRIPT_DIR")
|
||||
source "$ROOT_DIR/common-functions.sh"
|
||||
|
||||
_main() {
|
||||
local input_files=""
|
||||
local output_dir=""
|
||||
|
||||
# Execute initial checks.
|
||||
_check_dependencies "
|
||||
command=ffmpeg; pkg_manager=apt; package=ffmpeg |
|
||||
command=ffmpeg; pkg_manager=dnf; package=ffmpeg-free |
|
||||
command=ffmpeg; pkg_manager=pacman; package=ffmpeg |
|
||||
command=ffmpeg; pkg_manager=zypper; package=ffmpeg"
|
||||
_display_wait_box "2"
|
||||
input_files=$(_get_files "par_type=file; par_select_mime='audio/|video/'")
|
||||
output_dir=$(_get_output_dir "par_use_same_dir=false")
|
||||
|
||||
# Execute the function '_main_task' for each file in parallel.
|
||||
_run_task_parallel "$input_files" "$output_dir"
|
||||
_display_result_box "$output_dir"
|
||||
}
|
||||
|
||||
_main_task() {
|
||||
local input_file=$1
|
||||
local output_dir=$2
|
||||
local output_file=""
|
||||
local std_output=""
|
||||
|
||||
# Run the main process.
|
||||
output_file=$(_get_output_filename "$input_file" "$output_dir" "par_extension_opt=preserve")
|
||||
std_output=$(ffmpeg -hide_banner -y -i "$input_file" -filter:a "areverse, afade=d=10, areverse" -- "$output_file" 2>&1)
|
||||
_check_output "$?" "$std_output" "$input_file" "$output_file" || return 1
|
||||
}
|
||||
|
||||
_main "$@"
|
||||
@@ -0,0 +1,39 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Source the script 'common-functions.sh'.
|
||||
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
|
||||
ROOT_DIR=$(grep --only-matching "^.*scripts[^/]*" <<<"$SCRIPT_DIR")
|
||||
source "$ROOT_DIR/common-functions.sh"
|
||||
|
||||
_main() {
|
||||
local input_files=""
|
||||
local output_dir=""
|
||||
|
||||
# Execute initial checks.
|
||||
_check_dependencies "
|
||||
command=ffmpeg; pkg_manager=apt; package=ffmpeg |
|
||||
command=ffmpeg; pkg_manager=dnf; package=ffmpeg-free |
|
||||
command=ffmpeg; pkg_manager=pacman; package=ffmpeg |
|
||||
command=ffmpeg; pkg_manager=zypper; package=ffmpeg"
|
||||
_display_wait_box "2"
|
||||
input_files=$(_get_files "par_type=file; par_select_mime='audio/|video/'")
|
||||
output_dir=$(_get_output_dir "par_use_same_dir=false")
|
||||
|
||||
# Execute the function '_main_task' for each file in parallel.
|
||||
_run_task_parallel "$input_files" "$output_dir"
|
||||
_display_result_box "$output_dir"
|
||||
}
|
||||
|
||||
_main_task() {
|
||||
local input_file=$1
|
||||
local output_dir=$2
|
||||
local output_file=""
|
||||
local std_output=""
|
||||
|
||||
# Run the main process.
|
||||
output_file=$(_get_output_filename "$input_file" "$output_dir" "par_extension_opt=preserve")
|
||||
std_output=$(ffmpeg -hide_banner -y -i "$input_file" -filter:a "compand=attacks=0:points=-80/-115|-30.1/-80|-30/-30|20/20" -- "$output_file" 2>&1)
|
||||
_check_output "$?" "$std_output" "$input_file" "$output_file" || return 1
|
||||
}
|
||||
|
||||
_main "$@"
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Source the script 'common-functions.sh'.
|
||||
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
|
||||
ROOT_DIR=$(grep --only-matching "^.*scripts[^/]*" <<<"$SCRIPT_DIR")
|
||||
source "$ROOT_DIR/common-functions.sh"
|
||||
|
||||
_main() {
|
||||
local input_files=""
|
||||
local output_dir=""
|
||||
|
||||
# Execute initial checks.
|
||||
_check_dependencies "
|
||||
command=ffmpeg; pkg_manager=apt; package=ffmpeg |
|
||||
command=ffmpeg; pkg_manager=dnf; package=ffmpeg-free |
|
||||
command=ffmpeg; pkg_manager=pacman; package=ffmpeg |
|
||||
command=ffmpeg; pkg_manager=zypper; package=ffmpeg"
|
||||
_display_wait_box "2"
|
||||
input_files=$(_get_files "par_type=file; par_select_mime='audio/|video/'")
|
||||
output_dir=$(_get_output_dir "par_use_same_dir=false")
|
||||
|
||||
# Execute the function '_main_task' for each file in parallel.
|
||||
_run_task_parallel "$input_files" "$output_dir"
|
||||
_display_result_box "$output_dir"
|
||||
}
|
||||
|
||||
_main_task() {
|
||||
local input_file=$1
|
||||
local output_dir=$2
|
||||
local output_file=""
|
||||
local std_output=""
|
||||
|
||||
# Run the main process.
|
||||
output_file=$(_get_output_filename "$input_file" "$output_dir" "par_extension_opt=preserve")
|
||||
std_output=$(ffmpeg -hide_banner -y -i "$input_file" -filter:a "loudnorm" -- "$output_file" 2>&1)
|
||||
_check_output "$?" "$std_output" "$input_file" "$output_file" || return 1
|
||||
}
|
||||
|
||||
_main "$@"
|
||||
@@ -0,0 +1,39 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Source the script 'common-functions.sh'.
|
||||
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
|
||||
ROOT_DIR=$(grep --only-matching "^.*scripts[^/]*" <<<"$SCRIPT_DIR")
|
||||
source "$ROOT_DIR/common-functions.sh"
|
||||
|
||||
_main() {
|
||||
local input_files=""
|
||||
local output_dir=""
|
||||
|
||||
# Execute initial checks.
|
||||
_check_dependencies "
|
||||
command=ffmpeg; pkg_manager=apt; package=ffmpeg |
|
||||
command=ffmpeg; pkg_manager=dnf; package=ffmpeg-free |
|
||||
command=ffmpeg; pkg_manager=pacman; package=ffmpeg |
|
||||
command=ffmpeg; pkg_manager=zypper; package=ffmpeg"
|
||||
_display_wait_box "2"
|
||||
input_files=$(_get_files "par_type=file; par_select_mime='audio/|video/'")
|
||||
output_dir=$(_get_output_dir "par_use_same_dir=false")
|
||||
|
||||
# Execute the function '_main_task' for each file in parallel.
|
||||
_run_task_parallel "$input_files" "$output_dir"
|
||||
_display_result_box "$output_dir"
|
||||
}
|
||||
|
||||
_main_task() {
|
||||
local input_file=$1
|
||||
local output_dir=$2
|
||||
local output_file=""
|
||||
local std_output=""
|
||||
|
||||
# Run the main process.
|
||||
output_file=$(_get_output_filename "$input_file" "$output_dir" "par_extension_opt=preserve")
|
||||
std_output=$(ffmpeg -hide_banner -y -i "$input_file" -filter:a "silenceremove=stop_periods=-1:stop_duration=1:stop_threshold=-30dB" -- "$output_file" 2>&1)
|
||||
_check_output "$?" "$std_output" "$input_file" "$output_file" || return 1
|
||||
}
|
||||
|
||||
_main "$@"
|
||||
+67
@@ -0,0 +1,67 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Source the script 'common-functions.sh'.
|
||||
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
|
||||
ROOT_DIR=$(grep --only-matching "^.*scripts[^/]*" <<<"$SCRIPT_DIR")
|
||||
source "$ROOT_DIR/common-functions.sh"
|
||||
|
||||
_main() {
|
||||
local input_files=""
|
||||
local output_dir=""
|
||||
|
||||
# Execute initial checks.
|
||||
_check_dependencies "
|
||||
command=sox |
|
||||
pkg_manager=apt; package=libsox-fmt-mp3"
|
||||
_display_wait_box "2"
|
||||
input_files=$(_get_files "par_type=file; par_recursive=true; par_select_mime='audio/|video/'")
|
||||
|
||||
# Execute the function '_main_task' for each file in parallel.
|
||||
_run_task_parallel "$input_files" "$output_dir"
|
||||
|
||||
local std_output=""
|
||||
std_output=$(_storage_text_read_all)
|
||||
std_output=$(_text_sort "$std_output")
|
||||
|
||||
_display_list_box "$std_output" "--column=Status;--column=File"
|
||||
}
|
||||
|
||||
_main_task() {
|
||||
local input_file=$1
|
||||
local output_dir=$2
|
||||
local std_output=""
|
||||
|
||||
# Run the main process.
|
||||
std_output=$(sox "$input_file" -n remix 1 sinc "19k-20k" -m stat 2>&1)
|
||||
_check_output "$?" "$std_output" "$input_file" ""
|
||||
|
||||
std_output=$(grep "^Mean.*norm" <<<"$std_output")
|
||||
std_output=$(cut -d ":" -f 2 <<<"$std_output")
|
||||
std_output=$(tr -d " " <<<"$std_output")
|
||||
|
||||
local status="[excellent quality]"
|
||||
if [[ -z "$std_output" ]]; then
|
||||
status="[poor quality]"
|
||||
elif [[ "$std_output" == "0.00000"* ]]; then
|
||||
status="[medium quality]"
|
||||
fi
|
||||
|
||||
if [[ "$status" == "[medium quality]" ]]; then
|
||||
std_output=$(sox "$input_file" -n remix 1 sinc "17k-18k" -m stat 2>&1)
|
||||
_check_output "$?" "$std_output" "$input_file" ""
|
||||
|
||||
std_output=$(grep "^Mean.*norm" <<<"$std_output")
|
||||
std_output=$(cut -d ":" -f 2 <<<"$std_output")
|
||||
std_output=$(tr -d " " <<<"$std_output")
|
||||
|
||||
if [[ -z "$std_output" ]]; then
|
||||
status="[poor quality]"
|
||||
elif [[ "$std_output" == "0.00000"* ]]; then
|
||||
status="[poor quality]"
|
||||
fi
|
||||
fi
|
||||
|
||||
_storage_text_write_ln "$status$FIELD_SEPARATOR$(_text_remove_pwd "$input_file")"
|
||||
}
|
||||
|
||||
_main "$@"
|
||||
@@ -0,0 +1,39 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Source the script 'common-functions.sh'.
|
||||
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
|
||||
ROOT_DIR=$(grep --only-matching "^.*scripts[^/]*" <<<"$SCRIPT_DIR")
|
||||
source "$ROOT_DIR/common-functions.sh"
|
||||
|
||||
_main() {
|
||||
local input_files=""
|
||||
local output_dir=""
|
||||
|
||||
# Execute initial checks.
|
||||
_check_dependencies "
|
||||
command=ffmpeg; pkg_manager=apt; package=ffmpeg |
|
||||
command=ffmpeg; pkg_manager=dnf; package=ffmpeg-free |
|
||||
command=ffmpeg; pkg_manager=pacman; package=ffmpeg |
|
||||
command=ffmpeg; pkg_manager=zypper; package=ffmpeg"
|
||||
_display_wait_box "2"
|
||||
input_files=$(_get_files "par_type=file; par_select_mime='audio/|video/'")
|
||||
output_dir=$(_get_output_dir "par_use_same_dir=false")
|
||||
|
||||
# Execute the function '_main_task' for each file in parallel.
|
||||
_run_task_parallel "$input_files" "$output_dir"
|
||||
_display_result_box "$output_dir"
|
||||
}
|
||||
|
||||
_main_task() {
|
||||
local input_file=$1
|
||||
local output_dir=$2
|
||||
local output_file=""
|
||||
local std_output=""
|
||||
|
||||
# Run the main process.
|
||||
output_file=$(_get_output_filename "$input_file" "$output_dir" "par_extension_opt=preserve")
|
||||
std_output=$(ffmpeg -hide_banner -y -i "$input_file" -ac 1 -- "$output_file" 2>&1)
|
||||
_check_output "$?" "$std_output" "$input_file" "$output_file" || return 1
|
||||
}
|
||||
|
||||
_main "$@"
|
||||
@@ -0,0 +1,43 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Source the script 'common-functions.sh'.
|
||||
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
|
||||
ROOT_DIR=$(grep --only-matching "^.*scripts[^/]*" <<<"$SCRIPT_DIR")
|
||||
source "$ROOT_DIR/common-functions.sh"
|
||||
|
||||
_main() {
|
||||
local input_files=""
|
||||
local output_dir=""
|
||||
|
||||
# Execute initial checks.
|
||||
_check_dependencies "
|
||||
command=ffmpeg; pkg_manager=apt; package=ffmpeg |
|
||||
command=ffmpeg; pkg_manager=dnf; package=ffmpeg-free |
|
||||
command=ffmpeg; pkg_manager=pacman; package=ffmpeg |
|
||||
command=ffmpeg; pkg_manager=zypper; package=ffmpeg"
|
||||
_display_wait_box "2"
|
||||
input_files=$(_get_files "par_type=file; par_select_mime='audio/|video/'; par_min_items=2; par_max_items=2; par_sort_list=true")
|
||||
output_dir=$(_get_output_dir "par_use_same_dir=true")
|
||||
|
||||
_main_task "$input_files" "$output_dir"
|
||||
_display_result_box "$output_dir"
|
||||
}
|
||||
|
||||
_main_task() {
|
||||
local input_files=$1
|
||||
local output_dir=$2
|
||||
local output_file=""
|
||||
local std_output=""
|
||||
local file_1=""
|
||||
local file_2=""
|
||||
|
||||
file_1=$(cut -d "$FIELD_SEPARATOR" -f 1 <<<"$input_files")
|
||||
file_2=$(cut -d "$FIELD_SEPARATOR" -f 2 <<<"$input_files")
|
||||
|
||||
# Run the main process.
|
||||
output_file=$(_get_output_filename "Mixed audio.wav" "$output_dir" "par_extension_opt=preserve")
|
||||
std_output=$(ffmpeg -hide_banner -y -i "$file_1" -i "$file_2" -filter_complex "amix=inputs=2:duration=longest" -- "$output_file" 2>&1)
|
||||
_check_output "$?" "$std_output" "" "$output_file" || return 1
|
||||
}
|
||||
|
||||
_main "$@"
|
||||
@@ -0,0 +1,37 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Source the script 'common-functions.sh'.
|
||||
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
|
||||
ROOT_DIR=$(grep --only-matching "^.*scripts[^/]*" <<<"$SCRIPT_DIR")
|
||||
source "$ROOT_DIR/common-functions.sh"
|
||||
|
||||
_main() {
|
||||
local input_files=""
|
||||
local output_dir=""
|
||||
|
||||
# Execute initial checks.
|
||||
_check_dependencies "
|
||||
command=sox |
|
||||
pkg_manager=apt; package=libsox-fmt-mp3"
|
||||
_display_wait_box "2"
|
||||
input_files=$(_get_files "par_type=file; par_select_mime='audio/|video/'")
|
||||
output_dir=$(_get_output_dir "par_use_same_dir=true")
|
||||
|
||||
# Execute the function '_main_task' for each file in parallel.
|
||||
_run_task_parallel "$input_files" "$output_dir"
|
||||
_display_result_box "$output_dir"
|
||||
}
|
||||
|
||||
_main_task() {
|
||||
local input_file=$1
|
||||
local output_dir=$2
|
||||
local output_file=""
|
||||
local std_output=""
|
||||
|
||||
# Run the main process.
|
||||
output_file=$(_get_output_filename "$input_file" "$output_dir" "par_extension_opt=replace; par_extension=png")
|
||||
std_output=$(sox "$input_file" -n "spectrogram" -c "" -o "$output_file" 2>&1)
|
||||
_check_output "$?" "$std_output" "$input_file" "$output_file" || return 1
|
||||
}
|
||||
|
||||
_main "$@"
|
||||
@@ -0,0 +1,48 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Source the script 'common-functions.sh'.
|
||||
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
|
||||
ROOT_DIR=$(grep --only-matching "^.*scripts[^/]*" <<<"$SCRIPT_DIR")
|
||||
source "$ROOT_DIR/common-functions.sh"
|
||||
|
||||
_main() {
|
||||
local input_files=""
|
||||
local output_dir=""
|
||||
|
||||
# Execute initial checks.
|
||||
_check_dependencies "
|
||||
command=ffmpeg; pkg_manager=apt; package=ffmpeg |
|
||||
command=ffmpeg; pkg_manager=dnf; package=ffmpeg-free |
|
||||
command=ffmpeg; pkg_manager=pacman; package=ffmpeg |
|
||||
command=ffmpeg; pkg_manager=zypper; package=ffmpeg"
|
||||
_display_wait_box "2"
|
||||
input_files=$(_get_files "par_type=file; par_recursive=true; par_select_mime='audio/|video/'; par_skip_extension=bak")
|
||||
|
||||
# Execute the function '_main_task' for each file in parallel.
|
||||
_run_task_parallel "$input_files" "$output_dir"
|
||||
_display_result_box ""
|
||||
}
|
||||
|
||||
_main_task() {
|
||||
local input_file=$1
|
||||
local output_dir=$2
|
||||
local output_file=""
|
||||
local std_output=""
|
||||
local temp_file=""
|
||||
|
||||
# Work on a temporary file.
|
||||
temp_file=$(_get_temp_file)$(_get_filename_extension "$input_file")
|
||||
|
||||
# Run the main process.
|
||||
std_output=$(ffmpeg -hide_banner -y -i "$input_file" -map_metadata -1 -vn -c:a copy -- "$temp_file" 2>&1)
|
||||
_check_output "$?" "$std_output" "$input_file" "" || return 1
|
||||
|
||||
# Move the temporary file to the output.
|
||||
output_file=$input_file
|
||||
_move_temp_file_to_output "$input_file" "$temp_file" "$output_file"
|
||||
|
||||
# Remove the temporary files on each iteration (if not removed before).
|
||||
rm -f -- "$temp_file"
|
||||
}
|
||||
|
||||
_main "$@"
|
||||
Reference in New Issue
Block a user