jdlk
1st September 2009, 12:47
As others in this forum have done, I'm about to start the rather scary task of ripping all my DVDs to my media server.
One thing I have learned over the years is that, unless I automate the process as much as possible, it will never happen. Which means developing a script that requires little or no human intervention.
So here's where I've reached: I rip the DVD to disk, ensuring the rip contains only one audio track and one subtitle track. Then I run the following script:
1. SET DGINDEX="C:\Program Files\megui\tools\dgindex\DGIndex.exe"
2. SET X264="C:\Program Files\x264\x264.exe"
3. SET MKVMERGE="C:\Program Files\MKVtoolnix\mkvmerge.exe"
4. SET HOME=C:\DVD_Convert
5. SET PGCDEMUX="C:\Program Files\PGCDemux\PgcDemux.exe"
6. SET SUBTITLECREATOR="C:\Program Files\SubtitleCreator\SubtitleCreator.exe"
7. FOR /D %%A IN ("%HOME%\*.* ") DO (
8. %PGCDEMUX% "%%A\VTS_01_0.IFO" %HOME%
9. REN "%HOME%\*.sup" index.sup
10. %SUBTITLECREATOR% %HOME%\index.sup -ven -aIndex.idx
11. DIR "%%A\*.VOB" /s/b > "%HOME%\filelist.lst"
12. %DGINDEX% -HIDE -IA=5 -FO=0 -OM=0 -YR=1 -DRC=0 -DSA=0 -BF=[%HOME%\filelist.lst] -OF=[%HOME%\index]
-AT=[C:\Program Files\AviSynth 2.5\templates\film with autocrop.avs] -EXIT
13. REN "%HOME%\*.ac3" index.ac3
14. %X264% --crf 21 --bframes 3 --sar 16:11 --weightb --subme 7 --ref 3 --me umh --mixed-refs --b-adapt 2
--vbv-maxrate 10000 --vbv-bufsize 10000 -o "%HOME%\video.264" %HOME%\Index.avs
15. %MKVMERGE% --output "%%~nA".mkv --title "%%~nA".mkv "%HOME%\video.264" %HOME%\index.ac3 %HOME%\Index.idx
--chapters "C:\chapters.txt"
16. REN %HOME%\LogFile.txt LogFile"%%~nA".txt
17. DEL "%HOME%\video.264" %HOME%\filelist.lst "%HOME%\index.ac3" %HOME%\Celltimes.txt %HOME%\index.avs
%HOME%\index.d2v %HOME%\Index.idx %HOME%\Index.sub %HOME%\*.sup "%HOME%\filelist.lst" AutoCrop.log
18. MOVE "%%A" "%HOMEPATH%\My Documents\Video\Finished VIDEO_TS folders"
19. MOVE "%%~nA".mkv "%HOMEPATH%\My Documents\Video\Finished MKV movies"
20. )
The AVS script is:
mpeg2source("__vid__")
AutoCrop(mode=3, wMultOf=4, hMultOf=4)
assumefps(25)
Chapters.txt just adds a chapter mark every five minutes. Different versions of the script are used for different SAR values.
The one thing I have not managed to automate is checking the VOBS to find out if a delay is reported -- I do open PCGDemux to check that manually. I'd like to add a line that says "if delay not equal to zero, put message on screen", but that's beyond my abilities.
I am considering changing the script to run the VOBs through Quickstream Fix in VideoRedo, which would sort out any sync issues, and then change the script to process the resulting MPG (while still taking the subtitles from the original VOBS). Any views on this?
I've run this script on two discs, and it's been successful on both, which is great. But my knowledge of scripting is dodgy and I'm new to using MKV, so I thought I'd ask the old hands in this forum to glance at the script if they have a moment, and tell me about any weaknesses they see. I'd be grateful for any views.
One thing I have learned over the years is that, unless I automate the process as much as possible, it will never happen. Which means developing a script that requires little or no human intervention.
So here's where I've reached: I rip the DVD to disk, ensuring the rip contains only one audio track and one subtitle track. Then I run the following script:
1. SET DGINDEX="C:\Program Files\megui\tools\dgindex\DGIndex.exe"
2. SET X264="C:\Program Files\x264\x264.exe"
3. SET MKVMERGE="C:\Program Files\MKVtoolnix\mkvmerge.exe"
4. SET HOME=C:\DVD_Convert
5. SET PGCDEMUX="C:\Program Files\PGCDemux\PgcDemux.exe"
6. SET SUBTITLECREATOR="C:\Program Files\SubtitleCreator\SubtitleCreator.exe"
7. FOR /D %%A IN ("%HOME%\*.* ") DO (
8. %PGCDEMUX% "%%A\VTS_01_0.IFO" %HOME%
9. REN "%HOME%\*.sup" index.sup
10. %SUBTITLECREATOR% %HOME%\index.sup -ven -aIndex.idx
11. DIR "%%A\*.VOB" /s/b > "%HOME%\filelist.lst"
12. %DGINDEX% -HIDE -IA=5 -FO=0 -OM=0 -YR=1 -DRC=0 -DSA=0 -BF=[%HOME%\filelist.lst] -OF=[%HOME%\index]
-AT=[C:\Program Files\AviSynth 2.5\templates\film with autocrop.avs] -EXIT
13. REN "%HOME%\*.ac3" index.ac3
14. %X264% --crf 21 --bframes 3 --sar 16:11 --weightb --subme 7 --ref 3 --me umh --mixed-refs --b-adapt 2
--vbv-maxrate 10000 --vbv-bufsize 10000 -o "%HOME%\video.264" %HOME%\Index.avs
15. %MKVMERGE% --output "%%~nA".mkv --title "%%~nA".mkv "%HOME%\video.264" %HOME%\index.ac3 %HOME%\Index.idx
--chapters "C:\chapters.txt"
16. REN %HOME%\LogFile.txt LogFile"%%~nA".txt
17. DEL "%HOME%\video.264" %HOME%\filelist.lst "%HOME%\index.ac3" %HOME%\Celltimes.txt %HOME%\index.avs
%HOME%\index.d2v %HOME%\Index.idx %HOME%\Index.sub %HOME%\*.sup "%HOME%\filelist.lst" AutoCrop.log
18. MOVE "%%A" "%HOMEPATH%\My Documents\Video\Finished VIDEO_TS folders"
19. MOVE "%%~nA".mkv "%HOMEPATH%\My Documents\Video\Finished MKV movies"
20. )
The AVS script is:
mpeg2source("__vid__")
AutoCrop(mode=3, wMultOf=4, hMultOf=4)
assumefps(25)
Chapters.txt just adds a chapter mark every five minutes. Different versions of the script are used for different SAR values.
The one thing I have not managed to automate is checking the VOBS to find out if a delay is reported -- I do open PCGDemux to check that manually. I'd like to add a line that says "if delay not equal to zero, put message on screen", but that's beyond my abilities.
I am considering changing the script to run the VOBs through Quickstream Fix in VideoRedo, which would sort out any sync issues, and then change the script to process the resulting MPG (while still taking the subtitles from the original VOBS). Any views on this?
I've run this script on two discs, and it's been successful on both, which is great. But my knowledge of scripting is dodgy and I'm new to using MKV, so I thought I'd ask the old hands in this forum to glance at the script if they have a moment, and tell me about any weaknesses they see. I'd be grateful for any views.