Source Code for Me (s-c.me)

Allows you to paste souce code to blogs! Adapted for Twitter! Here is Search Form in case you missed your code.
Code:
Selected Language:
Show Linenumbers:
Short link for Twitter:
HTML:

HTML view:

Copy Source | Copy HTML
  1. #!/bin/bash
  2. ABITRATE=128 #Битрейт звуковой дорожки
  3. VOLUME=1 #Во сколько раз будет увеличиваться звук
  4. VBITRATE=800 #Битрейт видео дорожки
  5. OUT="$1"_n810.avi #Выходной файл
  6. #SCALE=480:-2                #Масштабирование
  7. SCALE=400:-2 #Масштабирование
  8. INPUT=$1 #Путь к DVD
  9. #Фильтры:VD
  10. FILTER="" #1)Самое правильное видео - progressive
  11. #FILTER=pullup,softskip,        #2)Чуток сложнее - telecined
  12. #FILTER=pp=lb,                #3)Interlaced - самая пакость.
  13. crop1=1
  14. crop2=2
  15. while [ "$crop1" != "$crop2" ]
  16. do
  17.     ss1=$(expr $RANDOM % 1000)
  18.     crop1=$(mplayer ${INPUT} -benchmark -vo null -nosound -ss $ss1 -frames 70 \
  19.     -vf scale=${SCALE},cropdetect 2>/dev/null | grep CROP | sed -n 50p | \
  20.     sed 's/.*crop=//g'| sed 's/).*//g')
  21.     ss2=$(expr $RANDOM % 1000)
  22.     crop2=$(mplayer ${INPUT} -benchmark -vo null -nosound -ss $ss2 -frames 70 \
  23.     -vf scale=${SCALE},cropdetect 2>/dev/null | grep CROP | sed -n 50p | \
  24.     sed 's/.*crop=//g'| sed 's/).*//g')
  25. done
  26. CROP=$crop1
  27. echo "Pass 1"
  28. mencoder ${INPUT} -nosound -vf ${FILTER}scale=${SCALE},crop=${CROP} -ovc xvid \
  29. -xvidencopts chroma_opt:gmc:max_bframes=1:vhq=4:bvhq=1:quant_type=mpeg:pass=1 -o /dev/null
  30. echo "Pass 2"
  31. mencoder ${INPUT} -oac mp3lame -lameopts vbr=0:br=${ABITRATE}:mode=0:vol=${VOLUME} \
  32. -vf ${FILTER}scale=${SCALE},crop=${CROP} -ovc xvid -xvidencopts bitrate=${VBITRATE}:gmc:\
  33. chroma_opt:max_bframes=1:vhq=4:bvhq=1:quant_type=mpeg:pass=2 -o ${OUT}
  34. rm divx2pass.log
  35. echo "Happy End"
  36.  




Based on Manoli.Net's CodeFormatter. Made by Topbot (c) 2008-2017