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>
echo "<br>
`basename $0` (c) 2004 Federico 'Pain' Pistono<br>
<br>
usage: `basename $0` [dvd-device] [dvd title] [bitrate] [crop] [outputfile]<br>
- dvd-device = your dvd-device. Either a on-the-fly copy (/dev/dvd)<br>
or a local directory, created before with vobcopy<br>
- dvd title = the title of the dvd using mencoder (e.g mencoder <a href="dvd://1">dvd://1</a>, <br>
also multiple titles, like 2-6 = from 2 to 6)<br>
- bitrate = the bitrate to use for the ffmpeg compression (DivX, Xvid) <br>
(best > 900, 1100 is fair enough.)<br>
- crop = That if you wish to crop the black bars. To see the exact ratio use<br>
this command:<br>
<br>
[bash]$: mplayer <a href="dvd://1">dvd://1</a> -vf cropdetect<br>
<br>
- output file = name of the output file (e.g. Matrix)<br>
<br>
Exmaples files:<br>
<br>
[bash]$: fppdvdmkv /dev/dvd 1 1100 720:352:0:62 Matrix<br>
[bash]$: fppdvdmkv ~/dvd/Matrix/ 1 1100 720:352:0:62 Matrix<br>
<br>
They will produce a file called Matrix.mkv<br>
"<br>
exit 1<br>
}<br>
<br>
if [ $# -ne 5 ]; then<br>
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="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"<br>
#opt="vbitrate=$3"<br>
<br>
#################################<br>
# Example with a temporary FIFO #<br>
#################################<br>
mknod fifotemp p&&<br>
oggenc -Q -q 3 -o audio.ogg fifotemp& <br>
mplayer dvd://$TITLE -chapter 3-3 -aid 128 -vc dummy -vo null -hardframedrop -ao pcm:file=fifotemp&&<br>
rm fifotemp&&<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&&<br>
#oggenc -q 3 -o audio.ogg audio.wav&&<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&&<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&&<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>