<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1198370458364171196</id><updated>2011-11-28T00:57:47.026+01:00</updated><category term='rip'/><category term='bash'/><title type='text'>Straps4Linux and Open Source</title><subtitle type='html'>Contributing to the Linux and OpenSource community</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://straps4linux.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1198370458364171196/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://straps4linux.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Straps</name><uri>http://www.blogger.com/profile/17416959001622100672</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>2</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1198370458364171196.post-6689229834725254528</id><published>2006-11-17T14:33:00.000+01:00</published><updated>2006-11-18T11:33:15.437+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='bash'/><category scheme='http://www.blogger.com/atom/ns#' term='rip'/><title type='text'>Script: dvd2xvid.sh</title><content type='html'>How to rip a DVD using mencoder; get utility.sh from &lt;a href="http://straps4linux.blogspot.com/2006/11/script-utilitysh.html"&gt;this post&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://del.icio.us/straps/rip"&gt;My delicious rip links&lt;/a&gt;&lt;br /&gt;&lt;div style="overflow: auto; font-family: courier new; font-size: 12px;"&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;#!/bin/bash&lt;br /&gt;&lt;br /&gt;. utility.sh&lt;br /&gt;&lt;br /&gt;function printUsage {&lt;br /&gt; echo "Usage: $0 [-d dvd-device] [-t title-number] [-l language] [-o output-file-name-without-ext] [-c crop-value] [-b bitrate] [-a audio-codec] [-e audio-encoding-options] [-v volume-gain-for-lavc] [-p additional-parameters]"&lt;br /&gt; echo "-t can be passed more times to rip more titles, es -t 1 -t 2 -t 3 ..."&lt;br /&gt; echo "If not passed, required values will be prompted to the user"&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;while getopts ":d:t:l:o:c:b:v:a:e:p:" param; do&lt;br /&gt; case $param in&lt;br /&gt;  d) DEVICE=$OPTARG ;;&lt;br /&gt;  t) TITLE="$TITLE $OPTARG" ;;&lt;br /&gt;  l) LANG=$OPTARG ;;&lt;br /&gt;  o) OUTF=$OPTARG ;;&lt;br /&gt;  c) CROP=$OPTARG ;;&lt;br /&gt;  b) BITRATE=$OPTARG ;;&lt;br /&gt;  a) OAC=$OPTARG ;;&lt;br /&gt;  e) OACOPTS=$OPTARG ;;&lt;br /&gt;  v) VGAIN=$OPTARG ;;&lt;br /&gt;  p) PARAMS=$OPTARG ;;&lt;br /&gt;  *) printUsage; exit 1;;&lt;br /&gt; esac&lt;br /&gt;done&lt;br /&gt;&lt;br /&gt;getAnswerIfNull DEVICE "DVD Device (-dvd-device)" "/dev/dvd"&lt;br /&gt;lsdvd $DEVICE || exit 1&lt;br /&gt;&lt;br /&gt;getAnswerIfNull TITLE "Title Number, specify a single title or a space separated list of titles (dvd://X)" "1"&lt;br /&gt;getAnswerIfNull LANG "Language (-alang)" "it"&lt;br /&gt;getAnswerIfNull OUTF "Output File Name Without Extension" "movie"&lt;br /&gt;&lt;br /&gt;if [ ! "$CROP" ]; then&lt;br /&gt; read -p "Press Enter, Wait for 10-20 seconds, press CTRL+C and copy the crop value, than paste in the next step" RV;&lt;br /&gt; mplayer -dvd-device $DEVICE -vf cropdetect dvd://$TITLE || exit 1&lt;br /&gt; getAnswer "Enter the crop value (XX:XX:XX:XX)" ""; CROP=$RV&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;if [ ! "$LANG" ]; then LANG="it"; echo "LANG not specified, setting to $LANG"; fi&lt;br /&gt;if [ ! "$BITRATE" ]; then BITRATE="1000"; echo "BITRATE not specified, setting to $BITRATE"; fi&lt;br /&gt;if [ ! "$VGAIN" ]; then VGAIN="0"; echo "VGAIN not specified, setting to $VGAIN"; fi&lt;br /&gt;if [ ! "$OAC" ]; then OAC="mp3lame"; echo "OAC not specified, setting to $OAC"; fi&lt;br /&gt;if [ ! "$OACOPTS" ]; then OACOPTS="-lameopts abr:br=128:vol=$VGAIN"; echo "OACOPTS not specified, setting to $OACOPTS"; fi&lt;br /&gt;&lt;br /&gt;#sws 2 = bicubic scaling, slower but better&lt;br /&gt;PARAMS="$PARAMS -sws 2 -ffourcc XVID"&lt;br /&gt;&lt;br /&gt;for T in $TITLE; do&lt;br /&gt; echo ""&lt;br /&gt; echo "-----------------------------------------" &lt;br /&gt; echo EXECUTING: nice -n 3 mencoder $PARAMS -oac $OAC $OACOPTS -ovc xvid -xvidencopts bitrate=$BITRATE:autoaspect -vf crop=$CROP -alang $LANG -dvd-device $DEVICE dvd://$T -o "$OUTF""_""$T"".avi"&lt;br /&gt; echo ""&lt;br /&gt; nice -n 3 mencoder $PARAMS -oac $OAC $OACOPTS -ovc xvid -xvidencopts bitrate=$BITRATE:autoaspect -vf crop=$CROP -alang $LANG -dvd-device $DEVICE dvd://$T -o "$OUTF""_""$T"".avi"&lt;br /&gt;done&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;script src="http://digg.com/tools/diggthis.js" type="text/javascript"&gt;&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1198370458364171196-6689229834725254528?l=straps4linux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://straps4linux.blogspot.com/feeds/6689229834725254528/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1198370458364171196&amp;postID=6689229834725254528' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1198370458364171196/posts/default/6689229834725254528'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1198370458364171196/posts/default/6689229834725254528'/><link rel='alternate' type='text/html' href='http://straps4linux.blogspot.com/2006/11/script-dvd2xvidsh.html' title='Script: dvd2xvid.sh'/><author><name>Straps</name><uri>http://www.blogger.com/profile/17416959001622100672</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1198370458364171196.post-985094097494882365</id><published>2006-11-17T14:29:00.000+01:00</published><updated>2006-11-17T15:53:42.891+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='bash'/><title type='text'>Script: utility.sh</title><content type='html'>Generic script that provide generic functionality&lt;br /&gt;&lt;div style="overflow: auto; font-family: courier new; font-size: 12px;"&gt;&lt;pre&gt;&lt;br /&gt;#!/bin/bash&lt;br /&gt;&lt;br /&gt;#-----------------------------------------------------------------------------------&lt;br /&gt;#Show the message $1 and read from input until a Y or N are pressed&lt;br /&gt;#@param $1 Message to be displayed&lt;br /&gt;#@return $RV&lt;br /&gt;function getAnswerYN {&lt;br /&gt;   export RV="";&lt;br /&gt;   while [ "$RV" != "y" -a "$RV" != "Y" -a "$RV" != "n" -a "$RV" != "N" ]&lt;br /&gt;   do&lt;br /&gt;       #Legge una stringa da stdin (-n 1 = un solo carattere)&lt;br /&gt;       read -p "$1[y/n]" RV;&lt;br /&gt;   done&lt;br /&gt;}&lt;br /&gt;#-----------------------------------------------------------------------------------&lt;br /&gt;#Show the message $1 and wait for a response; if an empty response is&lt;br /&gt;#given, it returns the second parameter (default value)&lt;br /&gt;#@param $1 Message&lt;br /&gt;#@param $2 Default Value&lt;br /&gt;#@return $RV&lt;br /&gt;function getAnswer {&lt;br /&gt;   export RV="";&lt;br /&gt;   read -p "$1[$2]" RV;&lt;br /&gt;   [ "$RV" == "" ] &amp;&amp;amp; RV=$2&lt;br /&gt;}&lt;br /&gt;#-----------------------------------------------------------------------------------&lt;br /&gt;#@param $1 Variable&lt;br /&gt;#@param $2 Message&lt;br /&gt;#@param $3 Default Value&lt;br /&gt;#@return $1 setted&lt;br /&gt;function getAnswerIfNull {&lt;br /&gt;eval VAR=\$$1&lt;br /&gt;if [ ! "$VAR" ]; then getAnswer "$2" "$3"; eval "$1=$RV"; fi&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;script src="http://digg.com/tools/diggthis.js" type="text/javascript"&gt;&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1198370458364171196-985094097494882365?l=straps4linux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://straps4linux.blogspot.com/feeds/985094097494882365/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1198370458364171196&amp;postID=985094097494882365' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1198370458364171196/posts/default/985094097494882365'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1198370458364171196/posts/default/985094097494882365'/><link rel='alternate' type='text/html' href='http://straps4linux.blogspot.com/2006/11/script-utilitysh.html' title='Script: utility.sh'/><author><name>Straps</name><uri>http://www.blogger.com/profile/17416959001622100672</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
