Advertisement
Guest User

Untitled

a guest
Dec 9th, 2017
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.47 KB | None | 0 0
  1. #!/usr/bin/zsh # x265 encoding, two pass encoding makes quality better compared to single pass if ( [ "$1" = "-f" ] && [ "$2" = "x265" ] ) ; then # encode a video file if [ "$3" = "-i" ] ; then /usr/bin/ffmpeg -y -i "$4" -x265-params pass=1 -c:v libx265 -b:v 1900k -c:a libmp3lame -b:a 128k -f matroska /dev/null /usr/bin/ffmpeg -y -i "$4" -x265-params pass=2 -c:v libx265 -b:v 1900k -c:a libmp3lame -b:a 128k "${4:r}.mkv" # encode multiple *.VOB files else cat *.VOB | /usr/bin/ffmpeg -y -i - -x265-params=1 -c:v libx265 -b:v 2500k -c:a flac -f matroska /dev/null cat *.VOB | /usr/bin/ffmpeg -y -i - -x265-params=2 -c:v libx265 -b:v 2500k -c:a flac "$(basename $(dirname $PWD)).mkv" fi # theora encoding, q:v sets the constant video quality. elif ( [ "$1" = "-f" ] && [ "$2" = "theora" ] ) ; then # encode a video file if [ "$3" = "-i" ] ; then
  2. /usr/bin/ffmpeg -y -i "$4" -c:v libtheora -q:v 5 -c:a libvorbis -q:a 4 "${4:r}.mkv"
  3. # encode multiple *.VOB files
  4. else
  5. cat *.VOB | /usr/bin/ffmpeg -y -i - -c:v libtheora -q:v 7 -c:a flac "$(basename $(dirname $PWD)).mkv" fi # output a message error if no output codec was given elif ( [ "$1" != "-f" ] || [ "$2" != "x265" ] || [ "$2" != "theora" ] ) ; then echo "please specify codec and optional source." fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement