From 35cd601e458a008325562f11d97db702539e768d Mon Sep 17 00:00:00 2001 From: Dmitry Voronin Date: Sun, 11 Feb 2024 03:12:24 +0300 Subject: [PATCH] Transcode : Mkv limit to 30 fps max. --- .config/bash/module/Ffmpeg.sh | 2 +- .config/bash/module/Transcode.sh | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) 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}" }