From b8e1e755e4d549c2416951ea5e32d560dcc115b2 Mon Sep 17 00:00:00 2001 From: Q Date: Sun, 7 Apr 2024 21:05:29 +0300 Subject: [PATCH] mpeg2 for editing --- av/video-compress | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/av/video-compress b/av/video-compress index cec380a..bfdcfb5 100755 --- a/av/video-compress +++ b/av/video-compress @@ -48,7 +48,7 @@ get_compression() { echo "$compression" echo "" - get_choice x264 copy similar YIFY + get_choice x264 copy similar YIFY mpeg2 case $choice in x264) echo Video quality: 23 = good, 18 = insane, 30 = poor @@ -61,6 +61,10 @@ get_compression() { compression="$yify_compression" audio="" ;; + mpeg2) + compression="-c:v mpeg2video -qscale 3 -g 1" + audio="-c:a libmp3lame -ar 44100 -b:a 192k" + ;; *) return;; esac } @@ -99,6 +103,7 @@ helpexit() { -low crf:27 abit:64k size:hd480 -medium crf:23 abit:96k -high crf:18 abit:128k + -edit mpeg2 with max quality -yify -custom:crf:abit:[resolution] @@ -141,6 +146,11 @@ for (( i=1; i<=$#; i++ )); do preset="high" argcount=$(( argcount + 1 )) } + [[ ${!i} = "-edit" ]] && { + FORCE=1 + preset="edit" + argcount=$(( argcount + 1 )) + } [[ ${!i} = "-yify" ]] && { FORCE=1 YIFY_PRESET=1 @@ -171,10 +181,17 @@ if [[ "$YIFY_PRESET" -eq 1 ]]; then compression="$yify_compression" audio="" fi +if [[ "$preset" = "edit" ]]; then + extension="mpg" + compression="-c:v mpeg2video -qscale:v 3 -g 1" + audio="-c:a libmp3lame -ar 44100 -b:a 192k" +else + extension="mp4" +fi inputfile="$1" outputfile="$2" inputname="${inputfile%.*}" -if [[ -z "$outputfile" ]]; then outputfile="${inputname}.${preset}.mp4";fi +if [[ -z "$outputfile" ]]; then outputfile="${inputname}.${preset}.${extension}";fi if [[ ! -e "$inputfile" ]]; then echo "Inputfile '$inputfile' missing"; exit 1; fi ffprobe -hide_banner "$inputfile"