diff --git a/.config/bash/module/Ffmpeg.sh b/.config/bash/module/Ffmpeg.sh index cc4b1f7..212077c 100644 --- a/.config/bash/module/Ffmpeg.sh +++ b/.config/bash/module/Ffmpeg.sh @@ -77,7 +77,7 @@ function ffmpeg_music_meta() { # Get video FPS. function _ffprobe_fps() { local fps=$(ffprobe -v 0 -of csv=p=0 -select_streams v:0 -show_entries stream=r_frame_rate "${1}") - [[ "${fps}" = "" ]] && fps=24 || fps=$((fps)) + [[ "${fps}" = "" ]] && fps=30 || fps=$((fps)) echo "${fps}" } diff --git a/.config/bash/module/Transcode.sh b/.config/bash/module/Transcode.sh index 3ceae82..2d19f46 100644 --- a/.config/bash/module/Transcode.sh +++ b/.config/bash/module/Transcode.sh @@ -88,9 +88,10 @@ function _transcode_mka() { function _transcode_mkv() { local keyint=$(_ffprobe_keyint "${1}") local braudio=$(_ffprobe_ba "${1}") + local fps=$(_ffprobe_fps "${1}") [[ ${braudio} -gt 128 ]] && braudio=128 - [[ ${braudio} -lt 32 ]] && braudio=32 + [[ ${fps} -gt 30 ]] && fps=30 # 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}" - ffmpeg -n -i "${1}" -map 0 -map -v -map V -map -t -dn -c:s srt -ac 2 -c:a libopus -b:a ${braudio}k -c:v libsvtav1 -crf 30 -svtav1-params "tune=0" -pix_fmt yuv420p10le -g ${keyint} -vf "scale=-2:min'(1080,ih)'" "${2}" + ffmpeg -n -i "${1}" -map 0 -map -v -map V -map -t -dn -c:s srt -ac 2 -c:a libopus -b:a ${braudio}k -c:v libsvtav1 -crf 30 -svtav1-params "tune=0" -pix_fmt yuv420p10le -g ${keyint} -vf "scale=-2:min'(1080,ih)'" -vf "fps=${fps}" "${2}" }