Ok, I've got some good points and some problems.<br>
<br>
Good points: <br>
(1) Video is great, at 1100 is almost DVD quality.<br>
<br>
Bad points:<br>
<br>
(1) Audio is not synchronized. <br>
<br>
Creating an mkv file with<br>
<br>
mkvmerge -o $TITLE.mkv -A output.avi audio.ogg<br>
<br>
makes the audio to daly a bit, even in a few seconds.<br>
<br>
If I make an OGM, the dealy is terrible playing with mplayer, but it's perfect with xine. (??????)<br>
<br>
(2) What's the easiest way to grab the crop and inset into the script
without making the person do the job before running the script?<br>
<br>
Here's the modified code, a sample for only one chapter.:<br>
<br>
#!/bin/bash<br>
Usage()<br>
{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo &quot;<br>
&nbsp; `basename $0` (c) 2004 Federico 'Pain' Pistono<br>
<br>
&nbsp; usage: `basename $0` [dvd-device] [dvd title] [bitrate] [crop] [outputfile]<br>
&nbsp; - dvd-device = your dvd-device. Either a on-the-fly copy (/dev/dvd)<br>
&nbsp;&nbsp;&nbsp; or a local directory, created before with vobcopy<br>
&nbsp; - dvd title = the title of the dvd using mencoder (e.g mencoder <a href="dvd://1">dvd://1</a>, <br>
&nbsp;&nbsp;&nbsp; also multiple titles, like 2-6 = from 2 to 6)<br>
&nbsp; - bitrate&nbsp; = the bitrate to use for the ffmpeg compression (DivX, Xvid) <br>
&nbsp;&nbsp;&nbsp; (best &gt; 900, 1100 is fair enough.)<br>
&nbsp; - crop = That if you wish to crop the black bars. To see the exact ratio use<br>
&nbsp;&nbsp;&nbsp; this command:<br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp; &nbsp;&nbsp;&nbsp; [bash]$: mplayer <a href="dvd://1">dvd://1</a> -vf cropdetect<br>
&nbsp; <br>
&nbsp; - output file = name of the output file (e.g. Matrix)<br>
<br>
&nbsp;&nbsp;&nbsp; Exmaples files:<br>
<br>
&nbsp;&nbsp;&nbsp; [bash]$: fppdvdmkv /dev/dvd 1 1100 720:352:0:62 Matrix<br>
&nbsp;&nbsp;&nbsp; [bash]$: fppdvdmkv ~/dvd/Matrix/ 1 1100 720:352:0:62 Matrix<br>
<br>
&nbsp;&nbsp;&nbsp; They will produce a file called Matrix.mkv<br>
&nbsp;&nbsp;&nbsp; &quot;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit 1<br>
}<br>
<br>
if [ $# -ne 5 ]; then<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Usage<br>
fi<br>
<br>
<br>
####################################<br>
# Parameter variables for encoding #<br>
####################################<br>
DEVICE=$1<br>
TITLE=$2<br>
BITRATE=$3<br>
CROP=$4<br>
NAME=$5<br>
<br>
<br>
#####################################<br>
# Variable for the encoding quality #<br>
#####################################<br>
opt=vcodec=mpeg4:psnr:mv0:cbp:trell:mbd=2:keyint=125:naq:v4mv:vlelim=-4:vcelim=7:lumi_mask=0.05:dark_mask=0.01:tcplx_mask=0.01:scplx_mask=0.01:vratetol=32000:vbitrate=$BITRATE<br>
#opt=vcodec=mpeg4:vbitrate=$3:vqmin=1:lmin=1:v4mv:mbd=2:trell:subcmp=2:cmp=2:precmp=2:mv0:autoaspect:vpass=1:mpeg_quant:psnr:vqcomp=0.7:vqblur=0.3<br>
#opt=&quot;vbitrate=$3:mbd=2:keyint=132:v4mv:vqmin=3:lumi_mask=0.07:dark_mask=0.2:scplx_mask=0.1:tcplx_mask=0.1:naq&quot;<br>
#opt=&quot;vbitrate=$3&quot;<br>
<br>
#################################<br>
# Example with a temporary FIFO #<br>
#################################<br>
mknod fifotemp p&amp;&amp;<br>
oggenc -Q -q 3 -o audio.ogg fifotemp&amp; <br>
mplayer dvd://$TITLE -chapter 3-3 -aid 128 -vc dummy -vo null -hardframedrop -ao pcm:file=fifotemp&amp;&amp;<br>
rm fifotemp&amp;&amp;<br>
<br>
############################<br>
# Faster, but needs space. #<br>
############################<br>
#mplayer -dvd-device $1 dvd://$2 -aid 128 -vc null -vo null -hardframedrop -ao pcm:file=audio.wav&amp;&amp;<br>
#oggenc -q 3 -o audio.ogg audio.wav&amp;&amp;<br>
<br>
mencoder -dvd-device $DEVICE dvd://$TITLE -chapter 3-3 -aid 128 -vf
crop=$CROP -ovc lavc -lavcopts vcodec=mpeg4:vpass=1:$opt -oac copy -o
/dev/null&amp;&amp;<br>
mencoder -dvd-device $DEVICE dvd://$TITLE -chapter 3-3 -aid 128 -vf
crop=$CROP -ovc lavc -lavcopts vcodec=mpeg4:vpass=2:$opt -oac copy -o
output.avi&amp;&amp;<br>
mkvmerge -o $TITLE.mkv -A output.avi audio.ogg<br>
<br>
<br>
Federico<br>
<br>
<br>-- <br>Federico 'Pain' Pistono - Scream for me....<br>Department of Computer Science - Verona, Italy<br>My website :::::::::::::::: <a href="http://www.federicopistono.org">www.federicopistono.org</a> <br>My personal website :: 
<a href="http://pain.altervista.org">http://pain.altervista.org</a><br>Ex-College Website :::: <a href="http://pain.altervista.org/flatnukeuwcad">http://pain.altervista.org/flatnukeuwcad</a><br><br>Linux Registered User #340392
<br>