PDA

View Full Version : Guide: How to Encode using VirtualDub, xvid.


Jeremy Duncan
19th November 2006, 01:38
Link to download folder including: SeeSaw, LSF, Spresso, Restore24, MVBob ( http://rapidshare.de/files/34605949/Avisynth.zip.html)

Step 1.) Rip the DVD. You'll use the .vob's in step 2.
If your going to use the AC3 filter to get sound, your going to need to rip only the movie portion of the DVD.
Or else the sound will be out of sync.

Step 2.)
Unzip the dgmpgdec folder.
Put the DGVfapi.vfp and DGDecode.dll from the dgmpgdec folder into the Avisynth Plugins folder.
Open dgIndex.exe.
Click the File tab.
Click Open.
Go to where you ripped the dvd and open the first .vob, it should be VTS_01_0.VOB
Then, click the Add button and add the other .vob's in numerical order, from 0 to 5 for example, click ok.
You should see a picture of the Movie. If not, move the scroll bar, you should see the movie as you move it.
Now select Audio/Output Method/Demux All Tracks.
Click the File tab.
Click Save Project, Name the file, press Save.
The Indexing will start and you'll see the bar moving. When it's finished, Exit DGIndex.

Step 3.)
Open Notepad.
Copy and Paste into Notepad, save the notepad file in the folder where you ripped the dvd to. This is a sample script.:
LoadPlugin("G:\Program Files\AviSynth 2.5\plugins\DGDecode.dll")
LoadPlugin("G:\Program Files\AviSynth 2.5\plugins\mt_masktools.dll")
LoadPlugin("G:\Program Files\AviSynth 2.5\plugins\masktools.dll")
LoadPlugin("G:\Program Files\AviSynth 2.5\plugins\RemoveGrainSSE2.dll")
LoadPlugin("G:\Program Files\AviSynth 2.5\plugins\Decomb.dll")
LoadPlugin("G:\Program Files\AviSynth 2.5\plugins\MT.dll")
Import("G:\Program Files\AviSynth 2.5\Plugins\LimitedSharpenFaster.avs")
setmtmode(2, 0)
mpeg2source("Archive.d2v")
assumeTFF()
telecide(guide=1, post=0, dthresh=0, vthresh=0, gthresh=0, back=0, bthresh=0, nt=0)
Decimate(cycle=5, threshold2=0, quality=0)
LanczosResize(1280, 720)
LimitedSharpenFaster(ss_x=1.0, ss_y=1.0, Smode=3, strength=80, overshoot=1)

Step 4.) Change the notepad extension from .txt to .avs
To do this, click the Tools tab, Folder options, View, Uncheck Hide Extensions.

Step 5.) Open Virtualdub.exe
Click the File button.
Click the Open Video File button.
Go to where you saved ripped dvd, you saved the notepad file there then changed the notepad extension,
so you should see a avs file, open that.
Click Video, Compression, make sure xvid mpeg 4-fourcc code:'xvid' is selected.
Click the File button.
Click save as avi.

Step 5.) Install the AC3filter, and the AVI-Mux_GUI.
Open the AVI-Mux_GUI and from where the .d2v file is, where you saved the Notepad file and changed the extension to .avs
Drag and drop one .ac3 file into the AVI-Mux_GUI. The first .ac3 file is English, the second ac3 file is usually French.
Now drag and drop the .avi file you just made with Virtual dub into AVI-Mux_GUI.
Now, in AVI-Mux_GUI, highlight the .avi file, then press the "Generate data source from files" button, then press the start button.
Save it to where you want, and it'll start to put sound into the .avi file.
When it's finished. You can open the .avi file with Media Player Classic, or Zoomplayer. Just register the xvid video decoder in
either frontend first.

Your done.

Xvid setup instructions

xvid encoder codec setupsetup
Leave everything Default, only change the settings below.

- Main Settings
Profile @ Level: (Unrestricted)
Encoding type: Single pass
Target bitrate: 3000
(Uses a bitrate of 6000 if your going to resize to 1980x1020)
Zones options: Quantizer checked: 1.00
Quality Preset: (User defined)

- Quality preset user defined sub tab, Motion tab
Motion search precision: 6 - Ultra High
VHQ mode: 1 - Mode Decision
Use VHQ for bframes too: checked
Use chroma motion: checked
Turbo: checked

Quantization tab
Everything left default.
Only uncheck "Trellis quantization"

- Profile @ Level sub tab, Profile tab
Profile @ Level: Unrestricted
Quantization type: MPEG
B-VOPs: unchecked, everything else: unchecked

AVI-Mux_GUI (http://www.doom9.org/Soft21/Editing/AVI-Mux_GUI-1.17.7.zip)
ac3filter (http://www.doom9.org/Soft21/Filters/ac3filter_1_11.exe)
xvid video codec (http://www.doom9.org/Soft21/Codecs/XviD-1.1.2-01112006.exe)
dgmpgdec Quickstart guide (http://neuron2.net/dgmpgdec/QuickStart.html)
dgmpgdec.exe (http://neuron2.net/dgmpgdec/dgmpgdec148.zip)
Virtualdub.exe (http://prdownloads.sourceforge.net/virtualdub/VirtualDub-1.6.17.zip?download)

http://img209.imageshack.us/img209/36/encodingdq9.jpg

Link to Walkthrough Picture (http://img209.imageshack.us/img209/36/encodingdq9.jpg)

- LSF Thread (http://forum.doom9.org/showthread.php?s=&threadid=84196)

MaskTools-v1.5.8.zip (http://manao4.free.fr/MaskTools-v1.5.8.zip) Use the Masktools.dll
masktools-v2.0a30.zip (http://manao4.free.fr/masktools-v2.0a30.zip) Use the MT_Masktools.dll, LimitedSharpenFaster is in a sub folder.

Put version 0.9 in the plugins folder first, then put the 1.0 version in to copy over the previous version.
RemoveGrain 0.9. Use RemoveGrainSSE. The SSE version that you use is the SSE your cpu supports.
RemoveGrain 0.9 (http://home.pages.at/kassandro/RemoveGrain/RemoveGrain.zip)
Removegrain 1.0 prerelease. Use RemovegrainSSE. The SSE version that you use is the SSE your cpu supports.
RemoveGrain 1.0 Prerelease (http://home.arcor.de/kassandro/RemoveGrain/RemoveGrain.rar)

Warpsharp (http://translate.google.com/translate?hl=en&sl=ja&u=http://www.avisynth.info/%3Fwarpsharp%25A5%25D1%25A5%25C3%25A5%25B1%25A1%25BC%25A5%25B8&sa=X&oi=translate&resnum=3&ct=result&prev=/search%3Fq%3Dwarpsharp.dll%26hl%3Den%26hs%3D8ym%26lr%3D%26client%3Dfirefox-a%26rls%3Dorg.mozilla:en-US:official%26sa%3DG)

- Spresso Thread (http://forum.doom9.org/showthread.php?t=103299)

MaskTools-v1.5.8.zip (http://manao4.free.fr/MaskTools-v1.5.8.zip) Use the Masktools.dll
Removegrain 1.0 prerelease. Use RemovegrainSSE. The SSE version that you use is the SSE your cpu supports.
RemoveGrain 1.0 Prerelease (http://home.arcor.de/kassandro/RemoveGrain/RemoveGrain.rar)

- SeeSaw Thread (http://forum.doom9.org/showthread.php?t=104701)

masktools-v2.0a30.zip (http://manao4.free.fr/masktools-v2.0a30.zip)
Removegrain 1.0 Prerelease (http://home.arcor.de/kassandro/RemoveGrain/RemoveGrain.rar)
You'll need removegrain and repairgrain.

- MVBob Thread (http://forum.doom9.org/showpost.php?p=606487&postcount=73)

corrector.dll (http://avisynth.org.ru/mvtools/corrector.html)
EEDI2v092.zip (http://bengal.missouri.edu/~kes25c/EEDI2v092.zip)
http://bengal.missouri.edu/~kes25c/
LeakKernelDeint/ (http://leak.no-ip.org/AviSynth/LeakKernelDeint/)
MVTools.dll (http://manao4.free.fr/MVTools.dll)
medianblur.dll (http://www.avisynth.org/tsp/)
SangNom.dll (http://mf.creations.nl/avs/filters/)
TomsMoComp.zip (http://www.trbarry.com/TomsMoComp.zip)

-
Restore24 Thread 1 (http://forum.doom9.org/showthread.php?s=&threadid=75432)
Restore24 Thread 2 (http://forum.doom9.org/showthread.php?s=&threadid=61792)

restore24_RC1_WIP (http://home.arcor.de/dhanselmann/_stuff/LostSwordship_test_scripts.rar)
smartdecimate.dll (http://kevin.atkinson.dhs.org/tel/)
avisynth_c (http://kevin.atkinson.dhs.org/avisynth_c/)
ibob/ (http://kevin.atkinson.dhs.org/ibob/)
LeakKernelDeint/ (http://leak.no-ip.org/AviSynth/LeakKernelDeint/)
MaskTools-v1.5.8.zip (http://manao4.free.fr/MaskTools-v1.5.8.zip)
TDeintv1RC7.zip (http://bengal.missouri.edu/~kes25c/TDeintv1RC7.zip)
dgdecode (http://www.neuron2.net/dgmpgdec/dgmpgdec148b7.zip)
ReduceFlicker (http://translate.google.com/translate?hl=en&sl=ja&u=http://www.avisynth.info/%3F%25A5%25D5%25A5%25EA%25A5%25C3%25A5%25AB%25C4%25E3%25B8%25BA&sa=X&oi=translate&resnum=3&ct=result&prev=/search%3Fq%3Dreduceflicker.dll%26hl%3Den%26hs%3DqAp%26lr%3D%26client%3Dfirefox-a%26rls%3Dorg.mozilla:en-US:official)
Warpsharp (http://translate.google.com/translate?hl=en&sl=ja&u=http://www.avisynth.info/%3Fwarpsharp%25A5%25D1%25A5%25C3%25A5%25B1%25A1%25BC%25A5%25B8&sa=X&oi=translate&resnum=3&ct=result&prev=/search%3Fq%3Dwarpsharp.dll%26hl%3Den%26hs%3D8ym%26lr%3D%26client%3Dfirefox-a%26rls%3Dorg.mozilla:en-US:official%26sa%3DG)
RemoveGrain.dll, repair.dll (http://home.arcor.de/kassandro/RemoveGrain/RemoveGrain.rar)

AviSynth Code.
Copy and paste it into the FFDShow Avisynth text box.
You need to install the plugins in order to use Avisynth in FFdshow.

Code I use to Deinterlace.
LoadPlugin("G:\Program Files\AviSynth 2.5\plugins\DGDecode.dll")
LoadPlugin("G:\Program Files\AviSynth 2.5\plugins\mt_masktools.dll")
LoadPlugin("G:\Program Files\AviSynth 2.5\plugins\masktools.dll")
LoadPlugin("G:\Program Files\AviSynth 2.5\plugins\RemoveGrainSSE2.dll")
LoadPlugin("G:\Program Files\AviSynth 2.5\plugins\Decomb.dll")
LoadPlugin("G:\Program Files\AviSynth 2.5\plugins\MT.dll")
Import("G:\Program Files\AviSynth 2.5\Plugins\LimitedSharpenFaster.avs")
setmtmode(2, 0)
mpeg2source("Archive.d2v")
assumeTFF()
telecide(guide=1, post=0, dthresh=0, vthresh=0, gthresh=0, back=0, bthresh=0, nt=0)
Decimate(cycle=5, threshold2=0, quality=0)
LanczosResize(1280, 720)
LimitedSharpenFaster(ss_x=1.0, ss_y=1.0, Smode=3, strength=80, overshoot=1)

Denoisers:
SPresso(limit=8, limitC=8, bias=100, biasC=100, RGmode=1, RGmodeC=17)
or
DeGrainMedian(limitY=0,limitUV=4,mode=1)
or
HQDN3D(0.0,2.0,0.0,4.0)

These are settings for sharpeners:
LimitedSharpenFaster(ss_x=1.0, ss_y=1.0, Smode=3, strength=80, overshoot=1)
or
SeeSaw(NRlimit=2, NRlimit2=2, Sstr=1.0, Slimit=7, Spower=2, Sdamplo=8, Szp=10, bias=1)
or
SeeSaw(NRlimit=2, NRlimit2=1, Sstr=1.0, Slimit=7, Spower=2, Sdamplo=8, SdampHi=10, Szp=10, bias=1, sootheT=30)
or
SeeSaw(NRlimit=2, NRlimit2=1, Sstr=1.4, Slimit=7, Spower=2, Sdamplo=8, SdampHi=10, Szp=10, bias=1, sootheT=30)

These are settings for both denoisers and sharpeners:
a = last
b = a.SPresso(limit=8, limitC=8, bias=100, biasC=100, RGmode=1, RGmodeC=17)
SeeSaw(a, b,NRlimit=2, NRlimit2=2, Sstr=1.0, Slimit=7, Spower=2, Sdamplo=8, Szp=10, bias=1)
or
a = last
b = a.SPresso(limit=8, limitC=8, bias=100, biasC=100, RGmode=1, RGmodeC=17)
SeeSaw(a, b, NRlimit=2, NRlimit2=1, Sstr=1.0, Slimit=7, Spower=2, Sdamplo=8, SdampHi=10, Szp=10, bias=1, sootheT=30)
or
a = last
b = a.SPresso(limit=8, limitC=8, bias=100, biasC=100, RGmode=1, RGmodeC=17)
SeeSaw(a, b, NRlimit=2, NRlimit2=1, Sstr=1.4, Slimit=7, Spower=2, Sdamplo=8, SdampHi=10, Szp=10, bias=1, sootheT=30)
or
SPresso(limit=8, limitC=8, bias=100, biasC=100, RGmode=1, RGmodeC=17)
LimitedSharpenFaster(ss_x=1.0, ss_y=1.0, Smode=3, strength=80, overshoot=1)
or
DeGrainMedian(limitY=0,limitUV=4,mode=1)
LimitedSharpenFaster(ss_x=1.0, ss_y=1.0, Smode=3, strength=80, overshoot=1)
or
HQDN3D(0.0,2.0,0.0,4.0)
LimitedSharpenFaster(ss_x=1.0, ss_y=1.0, Smode=3, strength=80, overshoot=1)

These are settings for a deinterlacer. You need the decomb.dll
fieldDeinterlace(full=true, blend=true, dthreshold=10)

assumeTFF()
telecide(guide=1, post=0, dthresh=0, vthresh=0, gthresh=0, back=0, bthresh=0, nt=0)
Decimate(cycle=5, threshold2=0, quality=0)

Jeremy Duncan
19th November 2006, 01:43
A 2 hour movie takes about 5 hours for virtualdub to encode to xvid and 15GB of HDD space using the script in the guide.

This is my pc I used to get the figures:
Intel 845pe motherboard
Pentium 4 Northwood 3.06 cpu, using hyperthreading.
Rage 128 ultra, agp 4x
1 stick 512 ddr-sdram
7200 rpm hdd
integrated sound

Dams
19th November 2006, 13:57
You forget Colormatrix in AVS Code, as your source is DVD..

sysKin
19th November 2006, 14:44
Congratulations, you found the most complex and convoluted way to get a quant 1 xvid file.

But why?

chilledoutuk
21st November 2006, 01:51
Congratulations, you found the most complex and convoluted way to get a quant 1 xvid file.

But why?

I didn't want to comment but if syskin says its rubbish i am inclined to agree as i think posting a guide like this now is a little behind the times people might have found this useful say 4 years ago but now there are so many guides and much simpler ones at that.

You see i agree with syskin if you made a quick easy guide which didn't mess about with filters noobs wont understand and used the generally accepted settings of minimum quant 2 people might find it useful.

However there are programs such as autogk megui etc that do all this automatically and probably better than your method.

I remember people used to keep going on about gordian knot to encode when i first started i was put off massively by its over complexity.
and when i realised it was basically a load of crap and that you can do the same thing just using vdubmod and avisynth script i ignored it and have never looked at it again.

I personally think that Gordian knot is incredibly daunting to newbies in comparison to a simple script in avisynth which is quite easy to understand and logical.

Edit:

In short you have written a guide for people who dont know what there doing using features and filters they shouldn't be using unless they know what there doing.

Jeremy Duncan
21st November 2006, 22:27
why?

It's so I can use filters and see a difference.
I use filters like Limitedsharpenfaster, and using quant 2 would compress the effect.

Blue_MiSfit
22nd November 2006, 06:14
Dude, Q1 is... gigantic. I mean seriously, it can make an output file bigger than the input file depending on which matrix you use.

Also, the XviD settings aren't really in line with generating a max quality encode.

1 pass VBR? Come on.

CQ2 with a high bitrate matrix would surely produce better results. No qpel? No bvops at all? Sometimes this can produce better results, but most of the time QPel and bvops @ 1/1/1, and CERTAINLY not 1 pass VBR.

Seriously, I totally appreciate the effort you put into this, but it's a bit misguided. Also, I tend to frown on blindly copying and pasting denoiser and sharpener AVS scripts. Still, a good collection of suggested parameters for those big filters.

Also, why would you resize to 1080p? Unless you dedicate huge amounts of time tweaking denoisers and sharpeners, the result isn't going to be any better than just using ffdshow and lanczos on playback - not to mention many gigabytes too large. Maybe if you're Didee and are the alpha and the omega behind iip :)...

No reason to load AviSynth plugins if they're already in your plugins folder. That's what it's there for :)


In short you have written a guide for people who dont know what there doing using features and filters they shouldn't be using unless they know what there doing.


This totally sums up my feelings. Again, thank you for the efforts, but let the noobs use AutoGK. When they're good and ready they can step up to manual encoding :D.

~MiSfit

Caspar
24th November 2006, 06:13
Most guides are a show of concept and people shouldn't be following it blindly. Right? :rolleyes:

Anyhow, the avs script in this guide doesn't work for every source, neither will the codec settings.

As far as content goes, I don't see a reason why to use this while there's a far more informative XviD encode guide/FAQ right here at doom9.