Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- # Simply converts anything to XviD
- ERROR(){
- printf "\033[0;31mError - $1\033[0m\n"
- exit 1
- }
- [ -z "$1" -o ! -e "$1" ] && ERROR "Wrong input path or file name or none at all."
- IPATH="/home/pintcat/skripte/"
- [ -x "$IPATH"progress.sh ] || ERROR_MSG="progress.sh is"
- if [ ! -x "$IPATH"ffprogress.sh ]; then
- if [ -n "$ERROR_MSG" ]; then
- ERROR_MSG=$ERROR_MSG"\b\band ffprogress.sh are"
- else
- ERROR_MSG="ffprogress.sh is"
- fi
- fi
- [ -n "$ERROR_MSG" ] && ERROR "$ERROR_MSG either missing or not executable."
- . "$IPATH"ffprogress.sh
- #RESX=720 # default
- #RESY=406 # default
- RESX=720
- RESY=406
- #FRAMEX=720 # default
- #FRAMEY=540 # default
- FRAMEX=640
- FRAMEY=480
- POSX=$((($FRAMEX-$RESX)/2))
- POSY=$((($FRAMEY-$RESY)/2))
- # Video filter:
- #VIDEO_CROP="crop=320:180:0:30,"
- VIDEO_SCALE="scale=$RESX:$RESY:sws_flags=bicubic+accurate_rnd,setsar=1:1,"
- #VIDEO_PAD="pad=$FRAMEX:$FRAMEY:$POSX:$POSY,"
- # These filter options convert HDR10 color space to the more commmon SDR8 (yuv420)
- #VIDEO_COLCONV="zscale=tin=smpte2084:min=bt2020nc:pin=bt2020:rin=tv:t=smpte2084:m=bt2020nc:p=bt2020:r=tv,"
- #VIDEO_COLCONV=$VIDEO_COLCONV"zscale=t=linear:npl=100,"
- #VIDEO_COLCONV=$VIDEO_COLCONV"format=gbrpf32le,"
- #VIDEO_COLCONV=$VIDEO_COLCONV"zscale=p=bt709,"
- #VIDEO_COLCONV=$VIDEO_COLCONV"tonemap=tonemap=mobius:param=0.1:desat=0,"
- #VIDEO_COLCONV=$VIDEO_COLCONV"zscale=t=bt709:m=bt709:r=tv:dither=none,"
- #VIDEO_COLCONV=$VIDEO_COLCONV"format=yuv420p,"
- # This filter scales the framerate down to 25fps (PAL standard)
- VIDEO_FPSCONV="fps=25,zscale=rangein=tv:range=tv -pix_fmt yuv420p -r 25/1"
- VIDEO_FILTER="$VIDEO_CROP$VIDEO_SCALE$VIDEO_PAD$VIDEO_COLCONV$VIDEO_FPSCONV"
- # Encoder:
- XVID="libxvid -ssim_acc 0 -me_quality 6 -trellis 1 -g 250 -bf 1 -qmin 1 -q:v 4"
- #XVID="libxvid -variance_aq 1 -ssim_acc 0 -me_quality 6 -trellis 1 -g 250 -bf 1 -qmin 1 -q:v 4"
- AC3="ac3 -b:a 128k -ar 48000 -ac 2 -channel_coupling 1 -dmix_mode 3"
- # Use this to limit the output to a certain number of frames
- #VIDEO_LIMIT="-vframes 25"
- FF_ARGS="-vf $VIDEO_FILTER -acodec $AC3 -vcodec $XVID $VIDEO_LIMIT -f avi"
- FF_INPUT=$1
- FF_OUTPUT=$2
- echo
- if ! FF_PROGRESS; then
- printf "\n\033[0;31mError - $FF_ERROR\033[0;32m\n\n"
- exit 1
- fi
- printf "\n\n\n\n"
- rm -f $FF_LOG $FF_CMD
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement