X-Git-Url: http://gitweb.hugovil.com/?a=blobdiff_plain;f=scripts%2Favi2mp4;h=cf69f8b2876f3a08676a9dc21c3a163bfcea2de7;hb=5204112b92785c2eef618b57c86d38286e4887e2;hp=8ad5487612387decd05089e12968cecfb6142244;hpb=fa37c01979686fe0a32001b8f2687b248c7eb16a;p=hvutilities.git diff --git a/scripts/avi2mp4 b/scripts/avi2mp4 index 8ad5487..cf69f8b 100755 --- a/scripts/avi2mp4 +++ b/scripts/avi2mp4 @@ -6,7 +6,7 @@ VIDEO_OPTS="-c:v libx264 -preset veryslow -crf 15" print_usage() { - echo "${PROG_NAME} -- Conversion AVI à MP4 (x264)" + echo "${PROG_NAME} -- Conversion MP4 (x264)" echo "Usage: ${PROG_NAME} [OPTIONS...] FICHIER" echo echo "Options:" @@ -59,7 +59,7 @@ if [ ${#} -ne 1 ]; then exit 1 fi -src=${1} +src="${1}" # Checking if input file exist. if [ ! -f $1 ]; then @@ -68,6 +68,8 @@ if [ ! -f $1 ]; then exit 1 fi -dest=`echo "${src}" | sed s/\.avi$/.mp4/g` +# Cut everything after the last dot using sed: +dest=`echo "${src}" | sed s/\.[^.]*$//` +dest="${dest}.mp4" -ffmpeg -i ${src} ${VIDEO_OPTS} ${audio_opts} ${dest} +ffmpeg -i "${src}" ${VIDEO_OPTS} ${audio_opts} "${dest}"