diff --git a/ffm2x265.sh b/ffm2x265.sh new file mode 100755 index 0000000..3b4838c --- /dev/null +++ b/ffm2x265.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +FFMPEG=/usr/bin/ffmpeg + +VCODEC=libx265 +VCRF=23 + +# Parameter suggestions: +# https://unix.stackexchange.com/questions/230800/re-encoding-video-library-in-x265-hevc-with-no-quality-loss +# Explanations: http://x265.readthedocs.io/en/default/cli.html + +# <=1080p: +# merange=44:ctu=32:max-tu-size=16 + +#-x265-params crf=22:no-sao:deblock=-2,-2:qcomp=0.8:psy-rd=0.7:psy-rdoq=5.0:rdoq-level=1.0:merange=44:ctu=32:max-tu-size=16 \ + +$FFMPEG \ +-hide_banner \ +-i "$1" \ +-map 0 \ +-c:v $VCODEC \ +-preset fast \ +-x265-params crf=22 \ +-c:a copy \ +-c:s copy \ +"${1}_x265.mkv"