mpeg2 for editing

This commit is contained in:
Q
2024-04-07 21:05:29 +03:00
parent 31ab87b9df
commit b8e1e755e4

View File

@@ -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"