From: Hugo Villeneuve Date: Fri, 1 Mar 2024 15:53:42 +0000 (-0500) Subject: avi2mp4: add quality option X-Git-Url: http://gitweb.hugovil.com/?a=commitdiff_plain;h=75de37b596a25e6bcc8951b0f474f0c051d84dd7;p=hvutilities.git avi2mp4: add quality option --- diff --git a/scripts/avi2mp4 b/scripts/avi2mp4 index 9c2082f..620f6bc 100755 --- a/scripts/avi2mp4 +++ b/scripts/avi2mp4 @@ -11,14 +11,16 @@ print_usage() echo " -a Conversion trame audio AAC (défaut=copier)" echo " -c Copie trame vidéo (défaut=conversion)" echo " -b Si option \"a\" sélectionnée, bitrate (défaut=192k)" + echo " -q Qualité (CRF). plus bas = meilleur (défaut=23)" } # Default values bitrate=192k aac=0 video_copy=0 +crf=23 -while getopts "ab:ch" flag ; do +while getopts "ab:chq:" flag ; do case ${flag} in a) aac=1 @@ -29,6 +31,9 @@ while getopts "ab:ch" flag ; do c) video_copy=1 ;; + q) + crf=${OPTARG} + ;; h) print_usage exit 0 @@ -65,7 +70,7 @@ fi if [ x"${video_copy}" = x1 ]; then video_opts="-c:v copy" else - video_opts="-c:v libx264 -preset veryslow -crf 15" + video_opts="-c:v libx264 -preset veryslow -crf ${crf}" fi src="${1}"