| |
| Author |
Message |
Adrenaline Rush
Afterdark Admin

Joined: 02 Oct 2005
Posts: 105
Location: Welcome to New York City
|
Posted:
Sun Apr 09, 2006 1:15 am |
  |
|
  |
 |
janrocks
The Bad Witch

Joined: 03 Jul 2006
Posts: 148
Location: The dark woods, waiting for you XXX
|
Posted:
Mon Nov 27, 2006 9:25 am |
  |
Some really complicated stuff...
Here's what I currently use to backup dvd's that I've purchased.
### This page is not a runnable script... it's a collection of scripts I use to backup my dvd collection.
### I used to think I could concoct the Ultimate Script that would allow me to pop in a dvd and make a copy with
### the touch of a button, but after doing a lot of research and gaining a lot of experience, I now realize that's
### impossible with ALL dvd's because not all dvd's are the same. No matter what, you have to collect information
### about the dvd by the output of \"mplayer -v dvd://1\". ### Also! I'm not a programmer at all, so if you make improvements please,
### please pm them to me. I'm still having a few problems with audio synch.
### Thanks!!!
### This first script makes an avi out of the big mpeg you'll get from a dvd with:
### \"mplayer dvd://1 -dumpstream -dumpfile desired_moviename\"
[code]
#!/bin/bash
if [ -z \"$1\" ]; then
echo -e \"nThis script is designed to be used in one of two ways:n\";
echo -e \"1. The best way is to do:nn mplayer dvd://1 -dumpstream -dumpfile movienamenn
and then point this script at moviename. Read the script for more details.n\"
end
#echo -e \"2. If you're having trouble you can try this: 'mplayer -dumpstream file1.vob' for every vob you want to include in n
#your final movie. Then concatenate them all together like:nn 'cat file1.vob file2.vob ... > big_mpeg.mpg' n
#Then run this script, pointing it at the big mpeg. Assuming you had a full-length movie, n
#it will produce about a 1.1 GB avi. nn\"
#echo \"Enter the title of the big mpeg below. (probably moviename if you followed #1)\";
#read big_mpeg;
# These are for interlaced videos.
# mencoder $big_mpeg -oac copy -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=1000:vhq:vpass=1:vqmin=2:vqmax=31 lavcdeint -o $big_mpeg.avi ;
# mencoder $big_mpeg -oac copy -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=1000:vhq:vpass=2:vqmin=2:vqmax=31 lavcdeint -o $big_mpeg.avi ;
# These are for non-interlaced videos.
#mencoder $big_mpeg -ffourcc xvid -ni -oac copy -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=1000:vhq:vpass=1:vqmin=2:vqmax=31 $big_mpeg.avi ;
#mencoder $big_mpeg -ffourcc xvid -ni -oac copy -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=1000:vhq:vpass=2:vqmin=2:vqmax=31 $big_mpeg.avi ;
#mv test.avi $big_mpeg.avi
#rm divx2pass.log ;
else
#mencoder $1 -ni -oac copy -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=1000:vhq:vpass=1:vqmin=2:vqmax=31 $1.avi ;
#mencoder $1 -ni -oac copy -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=1000:vhq:vpass=2:vqmin=2:vqmax=31 $1.avi ;
# If you're having trouble with the default language, (ie the rip ends up being in French)
# try running mplayer -v on the big mpeg, then look for the languages. 128 is usually english.
#mencoder $1 -aid 128 -ni -oac copy -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=1000:vhq:vpass=1:vqmin=2:vqmax=31 $1.avi ;
#mencoder $1 -aid 128 -ni -oac copy -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=1000:vhq:vpass=2:vqmin=2:vqmax=31 $1.avi ;
# This is for the new mencoder from mplayer-1.0_pre7. The \"-ffourcc xvid\" bit is new to this version of mplayer.
mencoder $1 -ffourcc xvid -aid 128 -ni -oac copy -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=1000:vhq:vpass=1:vqmin=2:vqmax=31 $1.avi ;
mencoder $1 -ffourcc xvid -aid 128 -ni -oac copy -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=1000:vhq:vpass=2:vqmin=2:vqmax=31 ;
mv test.avi $1.avi ;
rm divx2pass.log ;
fi
exit
# to concatenate avi's:
# cat file1.avi file2.avi > big.avi
# mencoder -ovc copy -oac copy -o out.avi -forceidx big.avi
##################################################
### This script will take a big mpeg you've collected with \"mplayer dvd://1 -dumpstream -dumpfile desired_moviename\"
### and cut it down to whatever size you want. I use 2100 MB and put 2 on each dvd. The quality is excellent.
### Unless you have a multiprocessor box, you'll want to remove \":threads=2\" from -lavcopts below.
#!/bin/bash
echo -e \"Enter name of mpeg file.\"
read FILENAME
echo -e \"Enter length (in minutes) of movie.\"
read MINUTES
echo -e \"Enter desired final size in MB.\"
read FINALSIZE
FINALKBSIZE=$(($FINALSIZE*1000))
SECONDS=$(($MINUTES*60))
AUDIOSIZE=$(($SECONDS*24))
DIFFERENCE=$(($FINALKBSIZE - $AUDIOSIZE))
RATE=$((($DIFFERENCE*8) / $SECONDS))
echo -e \"Title: $FILENAME\"
echo -e \"Length: $MINUTES\"
echo -e \"Number of seconds: $SECONDS\"
echo \"Rate is $RATE\"
echo -e \"An mpeg of final size $FINALSIZE MB is going to be created in 10 sec.n I hope you know what the f*** you're doing...\"
sleep 10
mencoder $FILENAME -of mpeg -aid 128 -vf scale=720:480,harddup -oac lavc -ovc lavc -lavcopts
acodec=ac3:abitrate=192:vcodec=mpeg2video:keyint=25:vbitrate=$RATE:aspect=16/9:threads=2
-mpegopts format=dvd -srate 48000 -ofps 30000/1001 -o $FILENAME.mpg
exit
#################################################################
# Here's another version I'm using...I launch it like:
# mymencodeadvd.sh moviename timeInMinutes desiredSizeInMB
#!/bin/bash
#echo -e \"Enter name of mpeg file.\"
#read FILENAME
#echo -e \"Enter length (in minutes) of movie.\"
#read MINUTES
#echo -e \"Enter desired final size in MB.\"
#read FINALSIZE
FILENAME=$1
MINUTES=$2
FINALSIZE=$3
FINALKBSIZE=$(($FINALSIZE*1000))
SECONDS=$(($MINUTES*60))
AUDIOSIZE=$(($SECONDS*24))
DIFFERENCE=$(($FINALKBSIZE - $AUDIOSIZE))
RATE=$((($DIFFERENCE*8) / $SECONDS))
echo -e \"Title: $FILENAME\"
echo -e \"Length: $MINUTES\"
echo -e \"Number of seconds: $SECONDS\"
echo \"Rate is $RATE\"
echo -e \"An mpeg of final size $FINALSIZE MB is going to be created in 10 sec.n I hope you know what the f*** you're doing...\"
sleep 10
mencoder $FILENAME -oac lavc -ovc lavc -of mpeg -mpegopts format=dvd -aid 128 -vf scale=720:480,harddup
-srate 48000 -lavcopts acodec=ac3:abitrate=192:vcodec=mpeg2video:keyint=25:trell:mbd=2:
vbitrate=$RATE:aspect=16/9:threads=2 -ofps 30000/1001 -o $FILENAME.mpg
exit
##########################################################
And now my favorite...
##########################################################
#!/bin/bash
# This script uses a framerate for telecined dvd's that are common in the US. The option is -ofps 24000/1001
# if you start seeing lots of frames dropped you might want to change it.
if [ -z \"$1\" ]; then
echo -e \"Enter arguments as follows: MovieName Minutes FinalsizeMB Devicen\";
else
FILENAME=$1 ;
MINUTES=$2 ;
FINALSIZE=$3 ;
DEVICE=$4 ;
# FRAMERATE=$5;
FINALKBSIZE=$(($FINALSIZE*1000)) ;
SECONDS=$(($MINUTES*60)) ;
AUDIOSIZE=$(($SECONDS*24)) ;
DIFFERENCE=$(($FINALKBSIZE - $AUDIOSIZE)) ;
RATE=$((($DIFFERENCE*8) / $SECONDS)) ;
echo -e \"Title: $FILENAME\" ;
echo -e \"Length: $MINUTES\" ;
echo -e \"Number of seconds: $SECONDS\" ;
echo \"Rate is $RATE\" ;
echo -e \"An mpeg of final size $FINALSIZE MB is going to be created in 10 sec.n I hope you know what the f*** you're doing...\" ;
sleep 10 ;
mplayer dvd://`lsdvd -d /dev/$4 | grep Longest | cut -c 16-17` -dvd-device /dev/$4 -dumpstream -dumpfile $1 ;
mencoder $FILENAME -oac lavc -ovc lavc -of mpeg -mpegopts format=dvd:telecine -aid 128 -vf scale=720:480,harddup
-srate 48000 -lavcopts acodec=ac3:abitrate=192:vcodec=mpeg2video:keyint=25:trell:mbd=2:dc=10:
vbitrate=$RATE:aspect=16/9:threads=2 -ofps 24000/1001 -o $FILENAME.mpg ;
fi
exit
##########################################################
### Here's another script I've just started using after reading some more docs at
### The mencoder documentation page.
##########################################################
#!/bin/bash
# This script uses a framerate for telecined dvd's that are common in the US. The option
# \"-ofps 30000/1001\" is the default for mencoder, so if you start seeing lots of frames dropped
# you might want to change it to 24000/1001. (Nearly all dvd's in the US use 24000/1001)
# What I usually do is issue the command \"mymencodeadvd.sh Some.Movie 99 2100 dvd\", with mymencodeadvd.sh
# being this script, 99 minutes being the length of the movie, 2.1 GB being the desired final mpg size,
# and dvd being the device the disc is in. (hdc or hdd will work also, whatever you've got)
# Then I use DVDStyler to create a dvd with a menu which points to two 2.1 GB movies I've saved.
if [ -z \"$1\" ]; then
echo -e \"Enter arguments as follows: MovieName Minutes FinalsizeMB Devicen\";
else
FILENAME=$1 ;
MINUTES=$2 ;
FINALSIZE=$3 ;
DEVICE=$4 ;
FRAMERATE=\"24000/1001\";
FINALKBSIZE=$(($FINALSIZE*1000)) ;
SECONDS=$(($MINUTES*60)) ;
AUDIOSIZE=$(($SECONDS*24)) ;
DIFFERENCE=$(($FINALKBSIZE - $AUDIOSIZE)) ;
RATE=$((($DIFFERENCE*8) / $SECONDS)) ;
echo -e \"Title: $FILENAME\" ;
echo -e \"Length: $MINUTES\" ;
echo -e \"Number of seconds: $SECONDS\" ;
echo \"Rate is $RATE\" ;
echo -e \"An mpeg of final size $FINALSIZE MB is going to be created in 10 sec.n I hope you know what the f*** you're doing...\" ;
sleep 10 ;
mplayer dvd://`lsdvd -d /dev/$4 | grep Longest | cut -c 16-17` -dvd-device /dev/$4 -dumpstream -dumpfile $1 ;
mencoder $FILENAME -oac lavc -ovc lavc -of mpeg -mpegopts format=dvd -aid 128
-vf scale=720:480,harddup -srate 48000 -lavcopts acodec=ac3:abitrate=192:
vcodec=mpeg2video:keyint=15:trell:mbd=2:mbd=2:precmp=2:subcmp=2:cmp=2:
dia=-10:predia=-10:cbp:mv0:vqmin=1:lmin=1:dc=10:vbitrate=$RATE:aspect=16/9:
threads=2 -ofps $FRAMERATE -o $FILENAME.mpg ;
fi
exit
####################################################### There's been a breakthrough.....
I _really_ like this transcode script. What it does is:
1) Accepts 3 parameters, the desired movie title, the final_size (in MB) desired (I use 2100), and the device the dvd is in. (you can use hdc or whatever).
2) It uses mplayer to dump the biggest chapter on the drive (usually 1). I've found mplayer to be more reliable than tccat for this purpose.
3) Then it collects basic info using tccat and stores it in a file (tcprobe.tempinfo). I then get movie_length and language_track info from it. It reports (for debugging) the track numbers of the english and spanish tracks. I've only done a few dvd's with this script, so I'm SURE it will need further tweaking.
4) Once all the info is collected, it splits the movie into audio and video tracks, and then rejoins them to create a movie of the desired size.
#!/bin/bash
if [ -z \"$1\" ]; then
echo -e \"Enter arguments as follows: MovieName FinalsizeMB Devicen\";
else
FILENAME=$1 ;
FINALSIZE=$2 ;
DEVICE=$3 ;
FRAMERATE=\"24000/1001\";
FINALKBSIZE=$(($FINALSIZE*1000)) ;
tcprobe -i /dev/$3 > tcprobe.tempinfo
SECONDS=`grep sec tcprobe.tempinfo | cut -c 28-32` ;
EN_TRACK=`grep kHz tcprobe.tempinfo | grep -n \"ac3 en\" | head -c1`
ES_TRACK=`grep kHz tcprobe.tempinfo | grep -n \"ac3 es\" | head -c1`
EN_INDEX=$(($EN_TRACK-1)) ;
ES_INDEX=$(($ES_TRACK-1)) ;
AUDIOSIZE=$(($SECONDS*24)) ;
DIFFERENCE=$(($FINALKBSIZE - $AUDIOSIZE)) ;
RATE=$((($DIFFERENCE*8) / $SECONDS)) ;
echo -e \"Title: $FILENAME\" ;
echo -e \"Length: $SECONDS seconds\" ;
echo -e \"Rate is $RATE bps\" ;
echo -e \"English track is: $EN_INDEX $EN_TRACK\"
echo -e \"Spanish track is: $ES_INDEX $ES_TRACK\"
echo -e \"A $FINALSIZE MB mpeg-2 of $FILENAME is going to be created in 10 sec....\" ;
sleep 10 ;
# tccat -i /dev/$4 -T 1,-1 -P > $1 ;
mplayer dvd://`lsdvd -d /dev/$3 | grep Longest | cut -c 16-17` -dvd-device /dev/$3 -dumpstream -dumpfile $1 ;
nice -+19 transcode -i $1 -y ffmpeg -F mpeg2video -N 0x2000 -E 48000 --export_prof
dvd-ntsc --export_asr 3 --encode_fields b -o temp -D0 -s1 -m temp.ac3
-J modfps=clonetype=3 -s on,1,1,1 --export_fps 29.97 -a $EN_INDEX -w $RATE ;
tcmplex -i temp.m2v -p temp.ac3 -m d -o $1.mpg ;
rm temp.m2v temp.ac3 tcprobe.tempinfo
fi
exit
#######################################################
The script I use now uses a few packages like transcode, mplayer, and lsdvd.
Here's the little script that's referred to in the big script...it's called dumpstream.sh (put it on your $PATH somewhere):
#!/bin/bash
if [ -z \"$1\" ]; then
echo -e \"nEnter arguments as follows: MovieName DeviceNamen\";
else
mplayer dvd://`lsdvd -d /dev/$2 | grep Longest | cut -c 16-17` -dvd-device /dev/$2 -dumpstream -dumpfile $1 ;
fi
##################################################
Then you're set to use mytranscode, which is below:
#!/bin/bash
if [ -z \"$3\" ]; then
echo -e \"Enter arguments as follows: MovieName FinalsizeMB Devicen\";
else
FILENAME=$1 ;
FINALSIZE=$2 ;
DEVICE=$3 ;
FRAMERATE=\"24000/1001\";
FINALKBSIZE=$(($FINALSIZE*1000)) ;
tcprobe -i /dev/$DEVICE > tcprobe.tempinfo
SECONDS=`cat tcprobe.tempinfo | sed -e 's/ /n/g' | grep -B 1 sec | head -n 1` ;
SECONDS='5711'
EN_TRACK=`grep kHz tcprobe.tempinfo | grep -n \"ac3 en\" | head -c1`
# ES_TRACK=`grep kHz tcprobe.tempinfo | grep -n \"ac3 es\" | head -c1`
EN_INDEX=$(($EN_TRACK-1)) ;
ES_INDEX=$(($ES_TRACK-1)) ;
AUDIOSIZE=$(($SECONDS*24)) ;
DIFFERENCE=$(($FINALKBSIZE - $AUDIOSIZE)) ;
RATE=$((($DIFFERENCE*8) / $SECONDS)) ;
echo -e \"Title: $FILENAME\" ;
echo -e \"Length: $SECONDS seconds\" ;
echo -e \"Rate is $RATE bps\" ;
echo -e \"English track is: $EN_INDEX $EN_TRACK\"
# echo -e \"Spanish track is: $ES_INDEX $ES_TRACK\"
echo -e \"A $FINALSIZE MB mpeg-2 of $FILENAME is going to be created in 10 sec....\" ;
sleep 10 ;
# tccat -i /dev/$DEVICE -T 1,-1 -P > $FILENAME ;
dumpstream.sh $FILENAME $DEVICE
eject $DEVICE ;
nice -+19 transcode -i $FILENAME -y ffmpeg --export_prof dvd-ntsc --export_asr 3 -F mpeg2video
-o temp -D0 -b224 -N 0x2000 -s2 -u 30,3 -s on,1,1,1 -M 4 -m temp.ac3 -J modfps=clonetype=3
--export_fps 29.97 -a $EN_INDEX -w $RATE ;
mplex -f8 -o $FILENAME.mpg temp.m2v temp.ac3 ;
# rm temp.m2v temp.ac3
fi
exit
If you don't know how to make these scripts runnable or how to install and test the apps don't ask me...look around the net 8)
Remember..this is for us.It took lots of hard times to get it to work....don't go posting it anywhere else, especially for the spoonfed kids on AD.. lol |
_________________

Last edited by janrocks on Wed Feb 07, 2007 5:18 pm; edited 4 times in total |
|
   |
 |
janrocks
The Bad Witch

Joined: 03 Jul 2006
Posts: 148
Location: The dark woods, waiting for you XXX
|
Posted:
Mon Nov 27, 2006 9:41 am |
  |
The basic jist of all that comes down to this script which is what I'm using with mixed success now.
| Code: |
#!/bin/bash
# You need transcode, mplayer, and lsdvd for this script.
# It will not work on all dvd's. You will need to play with it sometimes.
if [ -z "$3" ]; then
echo -e "Enter arguments as follows: MovieName FinalsizeMB Devicen";
else
FILENAME=$1 ;
FINALSIZE=$2 ;
DEVICE=$3 ;
# NTSC output for the U.S.
FRAMERATE="24000/1001";
# Finalsize in kilobytes.
FINALKBSIZE=$(($FINALSIZE*1000)) ;
# Grab the number of the longest title on the dvd.
TITLE=`lsdvd -d /dev/$DEVICE | grep Longest | cut -c 16-17`
# Collect information about the dvd, for use in determining
# the english track number, and the length of the movie.
tcprobe -T $TITLE -i /dev/$DEVICE > tcprobe.tempinfo
# Grab the length of the movie and the index of the first english track.
# I know this is probably a crappy way to do it...but I'm not a programmer, so there! :p
SECONDS=`cat tcprobe.tempinfo | sed -e 's/ /n/g' | grep -B 1 sec | head -n 1` ;
EN_TRACK=`grep kHz tcprobe.tempinfo | grep -n "ac3 en" | head -c1`
EN_INDEX=$(($EN_TRACK-1)) ;
# The following are used for debugging.
# ES_TRACK=`grep kHz tcprobe.tempinfo | grep -n "ac3 es" | head -c1`
# EN_INDEX=0 ;
# ES_INDEX=$(($ES_TRACK-1)) ;
# Calculate the framerate based on desired final size.
AUDIOSIZE=$(($SECONDS*24)) ;
DIFFERENCE=$(($FINALKBSIZE - $AUDIOSIZE)) ;
RATE=$((($DIFFERENCE*8) / $SECONDS)) ;
echo -e "Title: $FILENAME" ;
echo -e "Longest title is: $TITLE"
echo -e "Length: $SECONDS seconds" ;
echo -e "Rate is $RATE bps" ;
echo -e "English track is: $EN_INDEX $EN_TRACK"
# echo -e "Spanish track is: $ES_INDEX $ES_TRACK"
echo -e "A $FINALSIZE MB mpeg-2 of $FILENAME is going to be created in 10 sec...." ;
sleep 10 ;
# These are also used for debugging sometimes...
# tccat -i /dev/$DEVICE -T 1,-1 -P > $FILENAME ;
# dumpstream.sh $FILENAME $DEVICE
mplayer dvd://$TITLE -dvd-device /dev/$DEVICE -dumpstream -dumpfile $FILENAME ;
eject $DEVICE ;
# Here's the beef. The export_asr 3 is widescreen (16:9)
# Get rid of -u 30,3 if you don't have SMP. (not sure it works anyway)
nice -+19 transcode -i $FILENAME -y ffmpeg --export_prof dvd-ntsc --export_asr 3
-F mpeg2video -o temp -D0 -b224 -N 0x2000 -s2 -u 30,3 -s on,1,1,1 -M 4
-m temp.ac3 -J modfps=clonetype=3 --export_fps 29.97 -a $EN_INDEX -w $RATE ;
# Joins the video and audio streams.
mplex -f8 -o $FILENAME.mpg temp.m2v temp.ac3 ;
# I've commented this out because sometimes (1 in 50) the AV sync is bad.
# I'll mplex them by hand using something like
# this: mplex -f8 -o My_Favorite_Movie.mpg -O -6250ms temp.m2v temp.ac3
# which adds a delay of 6.25 seconds to the final movie.
# rm temp.m2v temp.ac3
fi
exit
|
Yup... I need to really get a life  |
_________________

Last edited by janrocks on Tue Nov 28, 2006 10:26 am; edited 1 time in total |
|
   |
 |
ktulu14
The Dogs Danglies

Joined: 07 Mar 2006
Posts: 221
Location: Norn Iron - but lookin in the woods for jan lol
|
Posted:
Mon Nov 27, 2006 10:16 pm |
  |
were not worthy jan. when i get my lin going again (if the pc holds together) i may well give this a go. i take it you have ythe libdvdcss installed for reading the disk in the first place? |
_________________
Free the West Memphis 3 -- http://www.wm3.org |
|
    |
 |
janrocks
The Bad Witch

Joined: 03 Jul 2006
Posts: 148
Location: The dark woods, waiting for you XXX
|
Posted:
Mon Nov 27, 2006 11:05 pm |
  |
t should be included with the totem/xine movie player package..if not it's easy enough to get. The hardest thing is getting mplayer to access the drive. Doesn't help with deb that the drive name assignment is a little on the random side to say the least. |
_________________

Last edited by janrocks on Tue Nov 28, 2006 10:27 am; edited 1 time in total |
|
   |
 |
ktulu14
The Dogs Danglies

Joined: 07 Mar 2006
Posts: 221
Location: Norn Iron - but lookin in the woods for jan lol
|
Posted:
Tue Nov 28, 2006 2:51 am |
  |
will try to remember that. damn that av looks good |
_________________
Free the West Memphis 3 -- http://www.wm3.org |
|
    |
 |
janrocks
The Bad Witch

Joined: 03 Jul 2006
Posts: 148
Location: The dark woods, waiting for you XXX
|
Posted:
Tue Nov 28, 2006 10:30 am |
  |
Very dark..like the skin.
Just when you think you have me tied down I change everything again....  |
_________________

Last edited by janrocks on Tue Nov 28, 2006 9:39 pm; edited 1 time in total |
|
   |
 |
ktulu14
The Dogs Danglies

Joined: 07 Mar 2006
Posts: 221
Location: Norn Iron - but lookin in the woods for jan lol
|
Posted:
Tue Nov 28, 2006 6:43 pm |
  |
u may have changed it, but i think it is even better than the last one  |
_________________
Free the West Memphis 3 -- http://www.wm3.org |
|
    |
 |
janrocks
The Bad Witch

Joined: 03 Jul 2006
Posts: 148
Location: The dark woods, waiting for you XXX
|
Posted:
Sat Jan 27, 2007 3:18 pm |
  |
I came back and had a read through my first big post. Found a glaring typo in one of the scripts which has been giving me problems..
It's this one..
#!/bin/bash
# This script uses a framerate for telecined dvd's that are common in the US. The option
# \"-ofps 30000/1001\" is the default for mencoder, so if you start seeing lots of frames dropped
# you might want to change it to 24000/1001. (Nearly all dvd's in the US use 24000/1001)
# What I usually do is issue the command \"mymencodeadvd.sh Some.Movie 99 2100 dvd\", with mymencodeadvd.sh
# being this script, 99 minutes being the length of the movie, 2.1 GB being the desired final mpg size,
# and dvd being the device the disc is in. (hdc or hdd will work also, whatever you've got)
# Then I use DVDStyler to create a dvd with a menu which points to two 2.1 GB movies I've saved.
if [ -z \"$1\" ]; then
echo -e \"Enter arguments as follows: MovieName Minutes FinalsizeMB Devicen\";
else
FILENAME=$1 ;
MINUTES=$2 ;
FINALSIZE=$3 ;
DEVICE=$4 ;
FRAMERATE=\"24000/1001\";
FINALKBSIZE=$(($FINALSIZE*1000)) ;
SECONDS=$(($MINUTES*60)) ;
AUDIOSIZE=$(($SECONDS*24)) ;
DIFFERENCE=$(($FINALKBSIZE - $AUDIOSIZE)) ;
RATE=$((($DIFFERENCE*8) / $SECONDS)) ;
echo -e \"Title: $FILENAME\" ;
echo -e \"Length: $MINUTES\" ;
echo -e \"Number of seconds: $SECONDS\" ;
echo \"Rate is $RATE\" ;
echo -e \"An mpeg of final size $FINALSIZE MB is going to be created in 10 sec.n I hope you know what the f*** you're doing...\" ;
sleep 10 ;
mplayer dvd://`lsdvd -d /dev/$4 | grep Longest | cut -c 16-17` -dvd-device /dev/$4 -dumpstream -dumpfile $1 ;
mencoder $FILENAME -oac lavc -ovc lavc -of mpeg -mpegopts format=dvd -aid 128
-vf scale=720:480,harddup -srate 48000 -lavcopts acodec=ac3:abitrate=192:
vcodec=mpeg2video:keyint=15:trell:mbd=2:mbd=2:precmp=2:subcmp=2:cmp=2:
dia=-10:predia=-10:cbp:mvO:vqmin=1:lmin=1:dc=10:vbitrate=$RATE:aspect=16/9:
threads=2 -ofps $FRAMERATE -o $FILENAME.mpg ;
fi
exit
which should read..
#!/bin/bash
# This script uses a framerate for telecined dvd's that are common in the US. The option
# \"-ofps 30000/1001\" is the default for mencoder, so if you start seeing lots of frames dropped
# you might want to change it to 24000/1001. (Nearly all dvd's in the US use 24000/1001)
# What I usually do is issue the command \"mymencodeadvd.sh Some.Movie 99 2100 dvd\", with mymencodeadvd.sh
# being this script, 99 minutes being the length of the movie, 2.1 GB being the desired final mpg size,
# and dvd being the device the disc is in. (hdc or hdd will work also, whatever you've got)
# Then I use DVDStyler to create a dvd with a menu which points to two 2.1 GB movies I've saved.
if [ -z \"$1\" ]; then
echo -e \"Enter arguments as follows: MovieName Minutes FinalsizeMB Devicen\";
else
FILENAME=$1 ;
MINUTES=$2 ;
FINALSIZE=$3 ;
DEVICE=$4 ;
FRAMERATE=\"24000/1001\";
FINALKBSIZE=$(($FINALSIZE*1000)) ;
SECONDS=$(($MINUTES*60)) ;
AUDIOSIZE=$(($SECONDS*24)) ;
DIFFERENCE=$(($FINALKBSIZE - $AUDIOSIZE)) ;
RATE=$((($DIFFERENCE*8) / $SECONDS)) ;
echo -e \"Title: $FILENAME\" ;
echo -e \"Length: $MINUTES\" ;
echo -e \"Number of seconds: $SECONDS\" ;
echo \"Rate is $RATE\" ;
echo -e \"An mpeg of final size $FINALSIZE MB is going to be created in 10 sec.n I hope you know what the f*** you're doing...\" ;
sleep 10 ;
mplayer dvd://`lsdvd -d /dev/$4 | grep Longest | cut -c 16-17` -dvd-device /dev/$4 -dumpstream -dumpfile $1 ;
mencoder $FILENAME -oac lavc -ovc lavc -of mpeg -mpegopts format=dvd -aid 128
-vf scale=720:480,harddup -srate 48000 -lavcopts acodec=ac3:abitrate=192:
vcodec=mpeg2video:keyint=15:trell:mbd=2:mbd=2:precmp=2:subcmp=2:cmp=2:
dia=-10:predia=-10:cbp:mv0:vqmin=1:lmin=1:dc=10:vbitrate=$RATE:aspect=16/9:
threads=2 -ofps $FRAMERATE -o $FILENAME.mpg ;
fi
exit
Can you spot it??? Don't forget the warning about removing the dual cpu command "threads=2" If you are not running a twin core/cpu machine. I do because I have one for this stuff..speed ya know, but it still takes absolutely hours and hours to convert an avi to a dvd for me |
_________________
 |
|
   |
 |
janrocks
The Bad Witch

Joined: 03 Jul 2006
Posts: 148
Location: The dark woods, waiting for you XXX
|
Posted:
Mon Feb 05, 2007 8:26 am |
  |
There's more. Here are the PAL numbers and how to find out if the .avi is encoded AC3.
First, you must convert your file to MPEG-2 for the video and to AC3 for the audio, in order to be compliant with the DVD video specifications. If the audio on your file is already encoded in AC3 format, you can use it as is without re-encoding it. Run this command to check the audio format of the file:
| Code: |
| mplayer -vo dummy -ao dummy -identify your_video.avi 2>&1 | grep AUDIO_FORMAT | cut -d '=' -f 2 |
If it returns hwac3, the audio part of your file is encoded in AC3, and you can convert the file to MPEG-2 with the following command:
| Code: |
mencoder -oac copy -ovc lavc -of mpeg -mpegopts format=dvd -vf scale=720:576,harddup
-lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=5000:keyint=15:aspect=16/9
-ofps 25 -o your_video.mpg your_video.avi |
If it isn't encoded in AC3, run this command:
| Code: |
mencoder -oac lavc -ovc lavc -of mpeg -mpegopts format=dvd -vf scale=720:576,harddup
-srate 48000 -af lavcresample=48000
-lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=5000:keyint=15:aspect=16/9:
acodec=ac3:abitrate=192 -ofps 25 -o your_video.mpg your_video.avi |
The previous commands create an MPEG-2 file in PAL format with an aspect ratio of 16:9. PAL is used in most of Europe (except France). If you want to create a NTSC DVD, which is the North American video standard, replace scale=720:576 with scale=720:480, keyint=15 with keyint=18, and -ofps 25 with -ofps 30000/1001. If you don't have a wide-screen TV, you should encode your file with an aspect ratio of 4:3 by replacing aspect=16/9 with aspect=4/3.
For more information, check the MPlayer's man page, which provides detailed explanations about each option used in these commands.
This process should take some time to finish.
If anybody has tried this method please let me know how it goes, because I know there are a few bugs in it that still need working out.
I need to edit this page because the width is getting silly.. I'll get on it tomorrow.. |
_________________
 |
|
   |
 |
janrocks
The Bad Witch

Joined: 03 Jul 2006
Posts: 148
Location: The dark woods, waiting for you XXX
|
Posted:
Mon Mar 12, 2007 4:35 am |
  |
More info about encoding...
Encoding with MEncoder
For the complete list of available MEncoder options and examples, please see the man page.
Encoding 2 or 3-pass MPEG-4 ("DivX")
2-pass encoding: the name comes from the fact that this method encodes the file twice. The first encoding (dubbed pass) creates some temporary files (*.log) with a size of few megabytes, do not delete them yet (you can delete the AVI). In the second pass, the 2-pass output file is created, using the bitrate data from the temporary files. The resulting file will have much better image quality. If this is the first time you heard about this, you should consult some guides available on the Net.
This example shows how to encode a DVD to a 2-pass MPEG-4 ("DIVX") AVI. Just two commands are needed:
rm frameno.avi - remove this file, which can come from a previous 3-pass encoding (it interferes with current one)
mencoder -dvd 2 -ovc lavc -lavcopts vcodec=mpeg4:vpass=1 -oac copy -o movie.avi
mencoder -dvd 2 -ovc lavc -lavcopts vcodec=mpeg4:vpass=2 -oac copy -o movie.avi
3-pass encoding: this is an extension of 2-pass encoding, where the audio encoding takes place in a separate pass. This method enables estimation of recommended video bitrate in order to fit on a CD. Also, the audio is encoded only once, unlike in 2-pass mode. The schematics:
1. Remove conflicting temporary file:
rm frameno.avi
2. First pass:
mencoder <file> -ovc frameno -oac mp3lame -lameopts vbr=3 -o frameno.avi
An audio-only avi file will be created, containing only the requested audio stream. Don't forget -lameopts, if you need to set it. If you were encoding a long movie, MEncoder prints the recommended bitrate values for 650Mb, 700Mb, and 800Mb destination sizes, after this pass finishes.
3. Second pass:
mencoder <file> -oac copy -ovc lavc -lavcopts vcodec=mpeg4:vpass=1:vbitrate=<bitrate>
This is the first pass of video encoding. Optionally specify the video bitrate MEncoder printed at the end of the previous pass.
4. Third pass:
mencoder <file> -oac copy -ovc lavc -lavcopts vcodec=mpeg4:vpass=2:vbitrate=<bitrate>
This is the second pass of video encoding. Specify the same bitrate as in the previous pass unless you really know what you are doing. In this pass, audio from frameno.avi will be inserted into the destination file.. and it's all ready!
Example for 3-pass encoding:
rm frameno.avi - remove this file, which can come from a previous 3-pass encoding (it interferes with current one)
mencoder -dvd 2 -ovc frameno -o frameno.avi -oac mp3lame -lameopts vbr=3
mencoder -dvd 2 -ovc lavc -lavcopts vcodec=mpeg4:vpass=1 -oac copy -o movie.avi
mencoder -dvd 2 -ovc lavc -lavcopts vcodec=mpeg4:vpass=2 -oac copy -o movie.avi
Encoding to MPEG format
MEncoder can create MPEG (MPEG-PS) format output files. It's probably useful only with libavcodec's mpeg1video codec, because players - except MPlayer - expect MPEG1 video, and MPEG1 layer 2 (MP2) audio streams in MPEG files.
This feature is not very useful right now, aside that it probably has many bugs, but the more importantly because MEncoder currently cannot encode MPEG1 layer 2 (MP2) audio, which all other players expect in MPEG files.
To change MEncoder's output file format, use the -of mpeg option.
Example:
mencoder -of mpeg -ovc lavc -lavcopts vcodec=mpeg1video -oac copy <other> media.avi -o output.mpg
Rescaling movies
Often the need to resize movie images' size emerges. Its reasons can be many: decreasing file size, network bandwidth, etc. Most people even do rescaling when converting DVDs or SVCDs to DivX AVI. This is bad. Instead of even you doing so, read the Preserving aspect ratio section.
The scaling process is handled by the 'scale' video filter: -vop scale=width:height. Its quality can be set with the -sws option. If it's not specified, MEncoder will use 0: fast bilinear.
Usage:
mencoder input.mpg -ovc lavc -lavcopts vcodec=mpeg4 -vop scale=640:480 -oac copy -o output.avi
Stream copying
MEncoder can handle input streams in two ways: encode or copy them. This section is about copying.
* Video stream (option -ovc copy): nice stuff can be done :)
Like, putting (not converting) FLI or VIVO or MPEG1 video into an AVI file. Of course only MPlayer can play such files :) And it probably has no real life value at all. Rationally: video stream copying can be useful for example when only the audio stream has to be encoded (like, uncompressed PCM to MP3).
* Audio stream (option -oac copy): straightforward. It is possible to take an external audio file (MP3, Vorbis) and mux it into the output stream. Use the -audiofile <filename> option for this.
Fixing AVIs with broken index or interleaving
Easiest thing. We simply copy the video and audio streams, and MEncoder generates the index. Of course this cannot fix possible bugs in the video and/or audio streams. It also fixes files with broken interleaving, thus the -ni option won't be needed for them anymore.
Command: mencoder -idx input.avi -ovc copy -oac copy -o output.avi
Appending multiple AVI files
As a side-effect, the broken AVI fixer function enables MEncoder to append 2 (or more) AVI files:
Command: cat 1.avi 2.avi | mencoder -noidx -ovc copy -oac copy -o output.avi -
Note: This expects 1.avi and 2.avi to use the same codecs, resolution, stream rate etc, and at least 1.avi must not be broken. You may need to fix your input AVI files first, as described above.
Encoding with the libavcodec codec family
libavcodec provides simple encoding to a lot of interesting video and audio formats (currently its audio codecs are unsupported). You can encode to the following codecs:
* mjpeg - Motion JPEG
* h263 - H263
* h263p - H263 Plus
* mpeg4 - ISO standard MPEG-4 (DivX 5, XVID compatible)
* msmpeg4 - pre-standard MPEG-4 variant by MS, v3 (aka DivX3)
* msmpeg4v2 - pre-standard MPEG-4 by MS, v2 (used in old asf files)
* wmv1 - Windows Media Video, version 1 (aka WMV7)
* rv10 - an old RealVideo codec
* mpeg1video - MPEG1 video :)
* huffyuv - lossless compression
The first column contains the codec names that should be passed after the vcodec config, like: -lavcopts vcodec=msmpeg4
An example, with MJPEG compression:
mencoder -dvd 2 -o title2.avi -ovc lavc -lavcopts vcodec=mjpeg -oac copy
Encoding from multiple input image files (JPEGs, PNGs or TGAs)
MEncoder is capable of creating movies from one or more JPEG, PNG or TGA files. With simple framecopy it can create MJPEG (Motion JPEG), MPNG (Motion PNG) or MTGA (Motion TGA) files.
Explanation of the process:
1. MEncoder decodes the input image(s) with libjpeg (when decoding PNGs, it will use libpng).
2. MEncoder then feeds the decoded image to the chosen video compressor (DivX4, XviD, ffmpeg msmpeg4, etc...).
Examples
The explanation of the -mf option can be found in the man page.
Creating a DivX4 file from all the JPEG files in the current dir:
mencoder -mf on:w=800:h=600:fps=25 -ovc divx4 -o output.avi *.jpg
Creating a DivX4 file from some JPEG files in the current dir:
mencoder -mf on:w=800:h=600:fps=25 -ovc divx4 -o output.avi frame001.jpg,frame002.jpg
Creating a Motion JPEG (MJPEG) file from all the JPEG files in the current dir:
mencoder -mf on:w=800:h=600:fps=25 -ovc copy -o output.avi *.jpg
Creating an uncompressed file from all the PNG files in the current dir:
mencoder -mf on:w=800:h=600:fps=25:type=png -ovc rawrgb -o output.avi *.png
Note: Width must be integer multiple of 4, it's a limitation of the RAW RGB AVI format.
Creating a Motion PNG (MPNG) file from all the PNG files in the current dir:
mencoder -mf on:w=800:h=600:fps=25:type=png -ovc copy -o output.avi *.png
Creating a Motion TGA (MTGA) file from all the TGA files in the current dir:
mencoder -mf on:w=800:h=600:fps=25:type=tga -ovc copy -o output.avi *.tga
Extracting DVD subtitles to a Vobsub file
MEncoder is capable of extracting subtitles from a DVD into Vobsub fomat files. They consist of a pair of files ending in .idx and .sub and are usually packaged in a single .rar archive. MPlayer can play these with the -vobsub and -vobsubid options.
You specify the basename (i.e without the .idx or .sub extension) of the output files with -vobsubout and the index for this subtitle in the resulting files with -vobsuboutindex.
If the input is not from a DVD you should use -ifo to indicate the .ifo file needed to construct the resulting .idx file.
If the input is not from a DVD and you do not have the .ifo file you will need to use the -vobsubid option to let it know what language id to put in the .idx file.
Each run will append the running subtitle if the .idx and .sub files already exist. So you should remove any before starting.
Examples
Copying two subtitles from a DVD while doing 3-pass encoding
rm subtitles.idx subtitles.sub
mencoder -dvd 1 -vobsubout subtitles -vobsuboutindex 0 -sid 2 -o frameno.avi -ovc frameno -oac mp3lame -lameopts vbr=3
mencoder -dvd 1 -oac copy -ovc divx4 -divx4opts pass=1
mencoder -dvd 1 -oac copy -ovc divx4 -divx4opts pass=2 -vobsubout subtitles -vobsuboutindex 1 -sid 5
Copying a french subtitle from an MPEG file
rm subtitles.idx subtitles.sub
mencoder movie.mpg -ifo movie.ifo -vobsubout subtitles -vobsuboutindex 0 -vobsuboutid fr -sid 1
Preserving aspect ratio
DVDs and SVCDs (i.e. MPEG1/2) files contain an aspect ratio value, which describes how should the player scale the video stream, so humans won't have egg heads (ex.: 480x480 + 4:3 = 640x480). However when encoding to AVI (DivX) files, you need to be aware that AVI headers don't store this value. Rescaling the movie is disgusting and time consuming, there must be a better feature!
There is.
MPEG4 has an unique feature: the video stream can contain its needed aspect ratio. Yes, just like MPEG1/2 files (DVD, SVCD). Regretfully, there are no video players outside which support this attribute. Except MPlayer.
This feature can be used only with libavcodec's mpeg4 codec. Keep in mind: although MPlayer will correctly play the created file, other players will use the wrong aspect ratio.
You seriously should crop the black bands over and below the movie image. See the manpage about the usage of the cropdetect and crop filters.
Usage:
$ mencoder sample-svcd.mpg -ovc lavc -lavcopts vcodec=mpeg4:aspect=16.0/9.0 -vop crop=714:548:0:14 -oac copy -o output.avi
|
_________________

Last edited by janrocks on Sun Oct 26, 2008 5:52 pm; edited 1 time in total |
|
   |
 |
janrocks
The Bad Witch

Joined: 03 Jul 2006
Posts: 148
Location: The dark woods, waiting for you XXX
|
Posted:
Fri Apr 06, 2007 2:25 am |
  |
More adventures in DVD pt 3, or Sometimes the weirdest things happen....
Been experimenting with some of the GUI linux dvd ripping applications..
DVDrip seems to have a few issues.. one of the strangest being demanding a dependency which doesn't exist (rar >2.8 or above?? the highest I can find is 2.4) which makes compressed subtitles impossible.... Also seems unable to find the xvix codecs, which are installed.. strange indeed..
It's also very confusing, and hard to use...moving on..
Acidrip.. Nice to use, easy to configure, but has an interesting fault.. It rips the subtitles whether told to or not, and then hard codes them into the resulting .avi... strange, but it does work and rips even heavily protected disks.
Avidemux.. does exactly what it says on the tin.. makes excellent 2 pass mpeg 1,2,3,4 files.. SLOWLY, but they are nice and in sync. You need this step because none of the linux authoring programs can handle raw .avi as yet. It does away with the meed to rip seperate m2v and ac3 files and then rejoin them.
qdvdauthor.. What a nightmare, I gave up and used dvdauthor from the command line.. It seems to work, but I found it impossible to navigate the menu building stuff.. just too confusing for my poor brain...
The resulting vobs all play fine, but then I tried to burn them on a disk... The damn protection came back, the film ran fast and the sound was scrambled... peculiar!
I have started investigating the possibilities of using libdecss, which is capable of ripping a file of all the blank/protected/wrong listed sectors and frames... I still need to find a way to combine this with the authoring application to rip them all out.. It should be possible to use this file to drop the protection.. It does for playback of the original, so there must be a way to use the info to filter all the junk somehow..
I know it's possible to run windows tools and do all this easily, fixvts and vob-blanker, but that's not the point of the exercise. I'm still trying to do this with purely open source free software. My test film is sin_city, so if anybody has a psl file for it a paste would be most useful to my project.
|
_________________
 |
|
   |
 |
janrocks
The Bad Witch

Joined: 03 Jul 2006
Posts: 148
Location: The dark woods, waiting for you XXX
|
Posted:
Fri Apr 06, 2007 7:05 pm |
  |
Breakthrough... Made a copy of a protected dvd.. sin city.
Not exactly sure how I did it, but I'm going to find another and try the same process/method and see what happens.
No cheating.. no windows applications have been used, and this isn't supposed to be possible with open source tools. |
_________________
 |
|
   |
 |
janrocks
The Bad Witch

Joined: 03 Jul 2006
Posts: 148
Location: The dark woods, waiting for you XXX
|
Posted:
Sun Jun 10, 2007 3:49 am |
  |
DVD Authoring with Linux
What You Need
* mjpegtools (http://mjepgtools.sf.net)
* ffmpeg (http://ffmpeg.sf.net)
* dvdauthor (http://dvdauthor.sf.net)
* dvdrtools (http://www.nongnu.org/dvdrtools/)
Audio & Video Formats
DVDs can handle audio & video information in the following formats:
* PAL/NTSC MPEG-2 Video
* PCM Audio
* MPEG-2 Audio
* AC3 Audio (DD 5.1)
* DTS
DVD MPEG-2 streams can have up to 8 different audio streams, 32 different sub-picture tracks (for subtitles or buttons-over-video, currently not supported by dvdauthor), and up to nine video streams, or 'angles' (currently, dvdauthor does not support angles).
Total bitrate of a DVD MPEG-2 stream must not exceed 9.8Mbps for maximum compatibility.
Audio:
# PCM: 48/86kHz, at 16, 20, or 24 bits per sample. Up to eight channels.
# MPEG2: 48kHz, 16/20 bits per sample. Bitrate from 32 to 912kbps. 5.1 channels, plus 7.1 mode (extra left and right channels). Not often used in commercial DVDs, as not required for NTSC DVD specification.
# Dolby Digital (AC-3): 48kHz, 24 bits/sample. Bitrate from 64 to 448kbps. 5.1 channels. Most common commercial offering.
# DTS: 48kHz, 24 bits/sample. Bitrate from 64 to 1536kbps. Requires DTS decoder (not part of DVD spec).
Most commercial DVDs these days include a DTS soundtrack plus a DD/AC-3 track in case the player doesn't have a DTS decoder.
Preparing Audio & Video
Why? DVD MPEG-2 streams need some extra navigational information
mplex - multiplexes audio and video into MPEG streams
e.g.
mplex -f 8 -o film_nosubs.mpg film.m2v english.ac3
french.ac3 german.ac3
In this case:
mplex -f 8 -o film_nosubs.mpg film.m2v film.ac3
mplex works with several other different MPEG formats, including VideoCD.
Use ffmpeg to convert between audio formats (AC3 is the most compatible and efficent format, although it is patent-encumbered).
Subtitles
Subtitles in DVDs are implemented via a sub-picture track
* Up to 32 tracks per title
* Subtitles are stored as images, not text
* Sub-picture tracks can have up to four colours
Sub-picture tracks are also used for menus, as shown in the Menu section. In fact, sub-picture tracks can also be used to create features like the "White Rabbit" option in The Matrix, but this is not supported by dvdauthor at the time of writing.
Subtitles: Using spumux
subs.xml (using TrueType fonts):
<subpictures>
<stream>
<textsub>
</stream>
</subpictures>
dvdauthor can handle most of the common subtitle formats (*.srt, *.ssa, *.sub, etc).
Fonts must be in the directory ~/.spumux for spumux to find them.
Subtitles: Alternative version
subs.xml (using PNG images):
<subpictures>
<stream>
<spu>
</spu>
</stream>
</subpictures>
Subtitles: 4
Example:
<subpictures>
<stream>
<spu>
</spu>
</stream>
</subpictures>
Adding subtitles
spumux subs.xml <film_nosubs> film.mpg
For multiple streams of subtitles, use the -s x switch to insert a subtitle stream (where x runs between 0 and 31 in a title)
Structure of A DVD
DVDs are comprised of units called a Video Title Set (VTS).
* A DVD can have up to 99 VTSs
* A VTS can have up to 99 titles
* A VTS can have its own set of menus
* Optional top-level menu known as the Video Manager Menu (VMGM)
It is possible, of course, to create DVDs without any menus in them at all.
Structure of A DVD: 2
This DVD:
* One titleset containing one title and no menus
* A VMGM to select subtitles/no subs
Making Menus
* Menus are just MPEG-2 streams with extra sub-picture information to place buttons
* Motion menus are easier than static menus!
* Current version of dvdauthor only supports 4:3 menus (aspect ratio 1.066)
* (e.g. in Gimp, use a DPI of 75 for x-axis and 80 for y-axis to get non-square pixels)
Current alpha versions of dvdauthor support 16:9 and anamorphic menus
Making Menus: Static Menus
Create an image with 3 layers:
* Background Layer (the main image): save as JPEG format
* Highlight Layer: save as 3-color PNG
* Select Layer: save as 3-color PNG
Making Menus: 3
menu.xml:
<subpictures>
<stream>
<spu>
</stream>
</subpictures>
For more complex DVDs, button placement can be specified individually; see dvdauthor documentation for details.
Making Menus: 4
Use jpeg2yuv, mpeg2enc, and mplex to create an MPEG-2 stream from the image:
jpeg2yuv -n 1 -f 25 -I p -j menu.jpg |
mpeg2enc -f 8 -o menu_temp.m2v
mplex -f 8 -o menu_temp.mpg menu.m2v menu.ac3
Then, add the button masks using spumux:
spumux menu.xml <menu_temp> menu.mpg
Menus must have an audio track. It can be silence, but it needs to be there.
jpegyuv options: -I (interlace - here using progressive) -f (frame rate) -n 1 (only process one frame - will create a 25-frame sequence (using the -f value)).
DVDAuthor
* Uses an XML format like spumux
<dvdauthor>
<vmgm>
<menus>
<pgc>
<vob>
<button>subtitle=0;jump title 1;</button>
<button>subtitle=64; jump title 1;</button>
</pgc>
</menus>
</vmgm>
DVDAuthor: 2
<titleset>
<titles>
<pgc>
<vob>
<post>call vmgm menu 1;</post>
</pgc>
</titles>
</titleset>
</dvdauthor>
DVDAuthor: 3
<vmgm> tag
* Defines the VMGM
* Must be present
* Can contain a <menu> tag
* Can be empty (<vmgm>)
DVDAuthor: 4
<menus> tag
* Contains the menu definitions
* Can be used in the <vmgm> and <titleset> tags
* Can only be used once inside such a tag
See dvdauthor documentation for further options, such as language codes, aspect ratios, etc.
DVDAuthor: 5
<pgc> tag
* Stands for ProGram Chain
* Basic unit of a DVD
* Container for video data and DVD instructions
* Found in <menu> and <titles> containers
When used in menus. the tag can also have an entry attribute, corresponding to certain special types of button on the DVD controller (such as 'title, 'angle', etc.). When the button is pressed, the player jumps to the menu with the appropriate entry.
DVDAuthor: 6
<vob> tag
* Stands for Video OBject
* Found in <pgc> containers
* Points to an MPEG-2 stream
* pause attribute can vary between 1-254 seconds, or 'inf' to hold on final frame
DVDAuthor: 7
<button> tag
* Specifies a button's function
* Uses a simple syntax, statements terminated with ;
* Most important commands are audio=x, subtitle=x, and jump X
* A titleset cannot jump to another titleset, it must call the VMGM (which can jump to any titleset)
The subtitle=64 command shown in the dvd.xml file forces the subtitles to be displayed. If subtitle=0 was used, only titles with a force="yes" attribute will be display. To force all subtitles, add 64 when selecting the required stream (e.g. 0+64).
DVDAuthor: 8
<titleset> and <titles> tags
* More container tags
* One <titles> container per <titleset>
See dvdauthor documentation for further options, such as language codes, aspect ratios, etc.
DVDAuthor: 9
<pre> and <post> tags
* These tags appear in a <pgc> container
* Used for executing DVD instructions either before or after a PGC is played
DVDAuthor: 10
Creating the DVD:
dvdauthor -o [DIRECTORY] -x dvd.xml
Testing & Burning
Testing the DVD:
xine dvd:/path_to_output_dir/VIDEO_TS/
Making The ISO Image:
mkisofs -o image_name -dvd-video path_to_output_dir
Then burn using dvdrtools, or any other method
DVD players expect to certain certain files on a DVD in particular places. The -dvd-video option makes sure mkisofs places files in the correct order.
Advanced Features
DVD players have registers available:
* 24 system registers
* 16 general purpose registers (dvdauthor uses 3 for its own purposes)
* dvdauthor provides basic C arithmetic operators and if...else... tests
* Can be used to build DVDs with interactivity
Current alpha builds also have a random() function, very useful for interactive apps.
Operators supported: ==, !=, >=, >, <=, <, &&, ||, !, eq, ne, ge, gt, le, lt, and, or, xor, not, +, -, *, /, %, &, |, ^
Not covered in this article, but the <cell> tag is often used in conjunction with registers for seamless branching.
|
_________________
 |
|
   |
 |
|
|
|
View next topic
View previous topic
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|