PDA

View Full Version : DVD Main Movie -> MKV Batch File (completely unattended)


l3pyr
23rd October 2006, 22:39
I made this batch file to rip, fix, demux, and remux (with proper audio sync) the main movie of a DVD. Figured someone else might get some use out of it too, so here it is...

@echo off

REM DVD Decrypter Path
set DECRYPT_PATH=C:\Program Files\DVD Decrypter

REM DGIndex Path
set DGINDEX_PATH=C:\Documents and Settings\All Users\Documents\Applications\Video Encoding\dgmpgdec148

REM MKVMerge Path
set MKVMERGE_PATH=C:\Program Files\MKVtoolnix

REM FixVTS Path
set FIXVTS_PATH=C:\Documents and Settings\All Users\Documents\Applications\Video Encoding

REM Output Location (cannot be the same as the temp folder or the output gets deleted!)
set OUTPUT_PATH=C:\Documents and Settings\John\Desktop

REM Temp Folder
set TEMP_PATH=C:\RM_TEMP

echo %TIME% - Project Started.

if exist %TEMP_PATH% rmdir %TEMP_PATH% /S /Q
mkdir %TEMP_PATH%
cd %TEMP_PATH%

echo %TIME% - Ripping DVD Contents to HDD...

"%DECRYPT_PATH%\DVDDecrypter.exe" /MODE FILE /START /FILES MOVIE /CLOSE /VERIFY NO /DEST %TEMP_PATH%

echo %TIME% - DVD Contents Ripped to HDD!

echo %TIME% - Locating Main Movie...

dir | find "_1.VOB" > VTS.txt
for /F "tokens=5" %%i in (VTS.txt) do set firstvob=%%i

echo %TIME% - Main Movie Found in %firstvob%!

echo %TIME% - Correcting Any VOB Errors...

"%FIXVTS_PATH%\fixvts.exe" -s -i -u %firstvob%

echo %TIME% - VOB Files Ready for Demuxing!

echo %TIME% - Demuxing Main Movie...

"%DGINDEX_PATH%\DGIndex.exe" -TN=1 -OM=1 -AIF=[%firstvob%] -OFD=[RM_Project] -EXIT

echo %TIME% - DVD Movie Demuxed!
echo:

echo MKV Project Details
echo -------------------

dir d: | find "Volume in drive" > name.txt
for /F "tokens=6" %%i in (name.txt) do set name=%%i
del name.txt

for %%f in (*.ac3) do set audio=%%f
for %%f in (*.m2v) do set video=%%f

echo %audio% > delay.txt
for /F "tokens=6 delims=. " %%i in (delay.txt) do echo %%i > delay.txt
for /F "tokens=1 delims=m " %%i in (delay.txt) do set delay=%%i
del delay.txt

echo Project Name: %name%
echo Audio Input: %audio%
echo Audio Delay: %delay%ms
echo Video Input: %video%

echo:
echo %TIME% Remuxing Movie...
echo:

"%MKVMERGE_PATH%\mkvmerge.exe" -o "%OUTPUT_PATH%\%name%.mkv" --sync 0:%delay% -a 0 -D -S "%audio%" -d 0 -A -S "%video%" --track-order 0:0,1:0

echo:
echo %TIME% - Project finished!
echo:

pause

cd c:\
rmdir %TEMP_PATH% /S /Q

l3pyr
23rd October 2006, 22:49
Sample Output

16:13:49.82 - Project Started.
16:13:49.82 - Ripping DVD Contents to HDD...
16:27:30.06 - DVD Contents Ripped to HDD!
16:27:30.06 - Locating Main Movie...
16:27:30.29 - Main Movie Found in VTS_01_1.VOB!
16:27:30.29 - Correcting Any VOB Errors...
16:33:04.10 - VOB Files Ready for Demuxing!
16:33:04.10 - Demuxing Main Movie...
16:40:27.68 - DVD Movie Demuxed!

MKV Project Details
-------------------
Project Name: STAY_ALIVE
Audio Input: RM_Project T01 3_2ch 384Kbps DELAY 0ms.ac3
Audio Delay: 0ms
Video Input: RM_Project.demuxed.m2v

16:40:27.98 Remuxing Movie...

mkvmerge v1.7.0 ('What Do You Take Me For') built on Apr 28 2006 17:19:57
'RM_Project T01 3_2ch 384Kbps DELAY 0ms.ac3': Using the AC3 demultiplexer.
'RM_Project.demuxed.m2v': Using the MPEG ES demultiplexer.
'RM_Project T01 3_2ch 384Kbps DELAY 0ms.ac3' track 0: Using the AC3 output modul
e.
'RM_Project.demuxed.m2v' track 0: Using the MPEG-1/2 video output module.
The file 'C:\Documents and Settings\John\Desktop\STAY_ALIVE.mkv' has been opened
for writing.
progress: 100%
The cue entries (the index) are being written...
Muxing took 420 seconds.

16:47:28.35 - Project finished!

Press any key to continue . . .

setarip_old
24th October 2006, 00:21
Hi!

Looks great!

You are, however, aware that many of the more recent DVD releases cannot be properly ripped using only DVD Decrypter, aren't, you?