diff --git a/.config/bash/module/transcode.sh b/.config/bash/module/transcode.sh index c08d072..688f9a8 100644 --- a/.config/bash/module/transcode.sh +++ b/.config/bash/module/transcode.sh @@ -87,27 +87,32 @@ transcode() _transcode_gz-xz() { + [[ -f "${2}" ]] && return 0 pv "${1}" | gzip -d | xz -9e > "${2}" } _transcode_xz-gz() { + [[ -f "${2}" ]] && return 0 pv "${1}" | xz -d | gzip -1 > "${2}" } _transcode_mp3() { - ffmpeg -i "${1}" -c:a libmp3lame -b:a 320k -f mp3 "${2}" + ffmpeg -n -i "${1}" -c:a libmp3lame -b:a 320k -f mp3 "${2}" } _transcode_flac() { - ffmpeg -i "${1}" -c:a flac -f flac "${2}" + ffmpeg -n -i "${1}" -c:a flac -f flac "${2}" } _transcode_mka() { - ffmpeg -i "${1}" -c:a libopus -b:a 128k -vn "${2}" + local braudio=$(_ffprobe_ba "${1}") + [[ ${braudio} -gt 128 ]] && braudio=128 + + ffmpeg -n -i "${1}" -c:a libopus -b:a ${braudio}k -vn "${2}" } _transcode_mkv() @@ -116,7 +121,7 @@ _transcode_mkv() local braudio=$(_ffprobe_ba "${1}") [[ ${braudio} -gt 128 ]] && braudio=128 - ffmpeg -i "${1}" -c:a libopus -b:a ${braudio}k -c:v libsvtav1 -crf 30 -svtav1-params "fast-decode=1:tune=0" -preset 6 -pix_fmt yuv420p10le -g ${keyint} -vf "scale=-2:min'(1080,ih)'" "${2}" + ffmpeg -n -i "${1}" -c:a libopus -b:a ${braudio}k -c:v libsvtav1 -crf 30 -svtav1-params "fast-decode=1:tune=0" -preset 8 -pix_fmt yuv420p10le -g ${keyint} -vf "scale=-2:min'(1080,ih)'" "${2}" } # Export.