DVD9 to DVD5
DVD9 to DVD5 guide
This guide lets you rip a DVD (all titles or just the main movie) and burn it on a DVD-R (4.7) that will play on your standalone player.
Tools needed: DVD:Rip or vobcopy / dvdauthor / transcode / mjpegtools / k3b
Optional: Kavi2svcd / AviDemux2 / QDVDAuthor / DVDStyler or Klvemkdvd
Rip the DVD title(s) to harddisk with DVD:RIP or vobcopy. This will create VOB files of the chosen title containing the movie and the soundtrack you picked.
If using vobcopy, first mount your dvd, then you can issue this command by itself
# vobcopy
Most of the time you will get around 5 or 6 numbered VOB's from a ripped title in your project folder.
If you ended up with multiple vob files, concatenate them into one by running in a console:
# cat *.vob > movie.vob
You now have 1 VOB file. We need to demutliplex it and get the M2V and AC3 files out of there. From the folder, again using the console run:
# tcextract -i movie.vob -t vob -x mpeg2 > movie.m2v # tcextract -i movie.vob -a 0 -x ac3 -t vob > movie.ac3
They will run one after the other, don't worry and will produce an M2V and an AC3 file. To requantize (shrink like DVDShrink on Windows) your movie so it will fit on a single DVD-R (4.7) do as such:
# tcrequant -i movie.m2v -o shrink.m2v -f 1.5
The 1.5 at the end is the shrink factor if you like. 1 keeps the movie the same (just a reference) and 2.0 would reduce it to 50% of its size. So 1.5 seems reasonable as it equals 75% of the original size once processed.
If you prefer you can calculate the exact factor yourself with this formula:
requant_factor = (video_size / (4700000000 - audio_size)) * 1.04
If you are including more than one audio stream or a subtitle stream, those file sizes must also be subtracted from the maximum dvd image size.
All sizes are in bits. Now we need to re multiplex those 2 files into a compliant DVDauthor file:
# mplex -f 8 -o final.mpg shrinked.m2v movie.ac3
Note: mplex will detect if a pulldown is necessary and do it.
After multiplexing, always test your mpg by playing it in XINE or other. Navigate the movie file and watch dialog to see if audio and video are in sync.
If we see that the audio is out of sync a good way of finding the exact value is opening the mpg with AviDemux2. Using tcprobe -i final.mpg also outputs the shift values for video and audio , you have to add them up.
To fix audio sync problems we would add the -O option to mplex with a value in milliseconds. (A / V sync is a large issue that I will not analyze here, this is for reference only if ever you would have sync issues with a DVD.)
For example, if tcprobe -i or Avidemux2 upon opening the mpg file, informed us that an audio/ video shift of 66ms existed in between the streams we would add the "-O 66ms" like so: You can now add the mpg to QDVDAuthor or Klvemkdvd authoring programs and create your DVD or use dvdauthor from the command line as such:
- Notice the -c "00:00:00.000,00:00:38.066" These are chapter markers. 00:00:00.000 is HH:MM:SS.SSS
To get file length in seconds, run this:
# mplayer -vo dummy -identify gump.mpg 2> /dev/null | grep ID_LENGTH | gawk -F= {'print $2'}
- Populate the filesystem like so:
# dvdauthor -c "00:00:00.000,00:00:38.066,00:02:40.699,00:08:39.865,00:10:40.465"\ -o newdvd final.mpg
- Create DVD information (IFO) files:
# dvdauthor -o newdvd -T
More info on dvdauthor Burn the Video_TS and Audio_TS created with K3B DVD Video mode.
Happy authoring!
Testing cd /lots/of/space/ $ vobcopy -t MOVIENAME -m -- This mirrors the entire dvd to your hard disk minus copy protection $ mplayer dvd://$title -dvd-device MOVIENAME -dumpvideo -dumpfile video.m2v $ mplayer dvd://$title -dvd-device MOVIENAME -dumpaudio -dumpfile audio.mpa -- These dump the raw audio and video streams out of the title you want to keep $ tcrequant -i video.m2v -o newvideo.m2v -f 1.3 -- this shrinks the video stream in a way that is almost unnoticable except with very large video streams. 1.3 is the video requantization factor. I've gotten good results with values up to 1.5. $ mplex -f 8 -o moviename.mpg newvideo.m2v audio.mpa -- this re-muxes the audio with the new shrunk video stream $ dvdauthor -o SHRUNKMOVIE -x mymovie.xml -- this creates a new dvd-video compatable file structure from the new mpg file containing just the specified title. One can read up on the dvdauthor website about how to do menus and multiple titles. I prefer to get rid of those so I can keep as much quality as possible for the title I'm "backing up". $ growisofs -dvd-compat -Z /dev/sd0 -dvd-video SHRUNKMOVIE -- This burns the new dvd. One must use scsi emulation for atapi cdrws with growisofs
contents of mymovie.xml
<dvdauthor> <vmgm /> <titleset> <titles> <pgc> <vob file="moviename.mpg" chapters="00:00:00.000,00:00:38.066,00:02:40.699,00:08:39.865,00:10:40.465, 00:15:49.898,00:21:25.632,00:28:02.032,00:30:05.298,00:35:14.398,00:37:04.031, 00:39:18.531,00:41:44.465,00:45:12.998,00:47:18.098,00:50:51.398,00:52:15.698, 01:02:54.731,01:11:01.131,01:12:43.131,01:18:07.431,01:25:30.998,01:40:09.298, 01:46:16.931,01:52:48.131" /> </pgc> </titles> </titleset> </dvdauthor>