Encoding MTS files with NvENC


# merge more mts file in one and encode it
# to obtain 1600x900 x264/aac file

# detect anctual folder

# check for folder path
if [ -z "$1" ]; then
    echo -e "Nessun argomento trovato !!!\nDevi specificare la path della cartella degli MTS da unire\n"
    exit 1

# move into mts folder path
cd "$1"
FILES=`ls -1 *.MTS`

# concat of MTS files name
for i in $FILES ; do

# encoding command generation
ffmpeg \
  -threads 4 \
  -i "concat:$FILESVAR" \
  -i /file/path/for/watermark.png \
  -filter_complex "[0:v]yadif, scale=-1:900[b];[b][1:v]overlay=x=(main_w-overlay_w-16):y=(main_h-overlay_h-16)" \
  -vcodec h264_nvenc \
  -preset:v llhq \
  -profile:v high \
  -level:v 5 \
  -rc:v ll_2pass_quality \
  -qmin:v 28 \
  -qmax:v 52 \
  -acodec aac \
  -ab 320k \
  -cutoff 22050 \
  -sn out.mkv

# return in first folder
cd $actualdir


Add a certificate authority (CA) certificate to jdk cacerts

We need to have ca certificate in der format, so if we have a my-ca.crt pem format ca certificate we need to convert it using:

openssl x509 -in my-ca.crt -inform pem -out my-ca.der -outform der

So to have list of already added certificates to jdk cacerts, we can use:

keytool -v -list -keystore /usr/lib/jvm/java/jre/lib/security/cacerts
default keystore password is: changeit

Keystore path could be different (es: /etc/pki/java/cacerts).

To import ca certificate use:

keytool -importcert -alias local-CA -keystore /usr/lib/jvm/java/jre/lib/security/cacerts -file my-ca.der