Default preset slow & H265 detection (ks-avi)

This commit is contained in:
q3aql 2021-03-10 00:38:53 +01:00
parent 2294f62765
commit eb549a966c

View File

@ -18,6 +18,9 @@ ksToolsTempFolder="/tmp/ks-tools"
rel_size="720x480"
vcodec="libxvid"
b_vcodec="3000k"
# Presets: ultrafast, superfast, veryfast, faster,
# fast, medium (default), slow, slower, veryslow
v_preset="slow"
acodec="libmp3lame"
b_acodec="192k"
default_lang_audio="spa"
@ -131,7 +134,16 @@ fi
p_ffmpeg="ffmpeg -i"
p_ffmpeg_patched="-max_muxing_queue_size 9999"
f_conversion="-vsync 1 -async 1"
p_conversion="-s ${rel_size} -c:v ${vcodec} -b:v ${b_vcodec} -c:a ${acodec} -b:a ${b_acodec}"
# Check if video input uses H265 (HEVC)
codec_h265=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Video:" | grep "h265")
codec_hevc=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Video:" | grep "hevc")
yuv420p10le=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Video:" | grep "yuv420p10le")
codec_h265_hevc="${codec_h265}${codec_hevc}${yuv420p10le}"
if [ -z "${codec_h265_hevc}" ] ; then
p_conversion="-s ${rel_size} -c:v ${vcodec} -b:v ${b_vcodec} -preset ${v_preset} -c:a ${acodec} -b:a ${b_acodec}"
else
p_conversion="-s ${rel_size} -c:v ${vcodec} -pix_fmt yuv420p -b:v ${b_vcodec} -preset ${v_preset} -c:a ${acodec} -b:a ${b_acodec}"
fi
# Init conversion file
current_date=$(date +%Y)
@ -146,6 +158,7 @@ if [ -z "${2}" ] ; then
echo " - Resolution: ${rel_size}"
echo " - Video codec: ${vcodec}"
echo " - Bitrate video: ${b_vcodec}"
echo " - Preset: ${v_preset}"
echo " - Audio codec: ${acodec} (stereo)"
echo " - Bitrate audio: ${b_acodec}"
echo " - Default Audio: ${default_lang_audio}"
@ -267,7 +280,11 @@ else
resolution="${rel_size}"
else
rel_size="${resolution}"
p_conversion="-s ${rel_size} -c:v ${vcodec} -b:v ${b_vcodec} -c:a ${acodec} -b:a ${b_acodec}"
if [ -z "${codec_h265_hevc}" ] ; then
p_conversion="-s ${rel_size} -c:v ${vcodec} -b:v ${b_vcodec} -preset ${v_preset} -c:a ${acodec} -b:a ${b_acodec}"
else
p_conversion="-s ${rel_size} -c:v ${vcodec} -pix_fmt yuv420p -b:v ${b_vcodec} -preset ${v_preset} -c:a ${acodec} -b:a ${b_acodec}"
fi
fi
echo -n "* (Default: n) Do you want apply '-max_muxing_queue_size 9999' patch? (y/n): " ; read patch_thread
if [ "${patch_thread}" == "y" ] ; then