From f29540d0eb313883ab5954f09e9b361ff7a943ca Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Thu, 18 May 2017 14:03:34 +0200 Subject: Add script compress. --- bin/compress | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 bin/compress (limited to 'bin/compress') diff --git a/bin/compress b/bin/compress new file mode 100755 index 0000000..f1e06b5 --- /dev/null +++ b/bin/compress @@ -0,0 +1,20 @@ +#!/bin/sh + +set -eu + +INPUT=$1 +OUTPUT=${2:-${1%.*}.nut} + +case $INPUT in + *.dv) DEINT=yadif;; +esac + +case ${OUTPUT##*.} in + nut) AENCODE="-codec:a flac"; VENCODE="-codec:v huffyuv";; + mkv) AENCODE="-codec:a flac"; VENCODE="-codec:v libvpx-vp9 -lossless 1";; + mp4) AENCODE="-codec:a libopus -b:a 192k"; VENCODE="-codec:v libx264 -crf 1";; + webm) AENCODE="-codec:a libopus -b:a 192k"; VENCODE="-codec:v libvpx-vp9";; +esac + +mkdir -p "$(dirname "$OUTPUT")" +ffmpeg -hide_banner -threads auto -y -i "$INPUT" -vf ${DEINT:+$DEINT,}format=pix_fmts=yuv420p $AENCODE $VENCODE "$OUTPUT" -- cgit v1.2.3