Log in

View Full Version : XviD Encoding Help Please


warath
13th March 2005, 04:45
Hi, first, I have read many many posts here, and the FAQ, and followed many many of the suggestions found. However, I still have the same issue no matter what I do.

The Story:
I'm trying to make XviD (duh ;) ) of my star trek DVDs so that i can leave them on my server to watch in my room/tv room where i have computers hooked to TVs.
My Process
1) Rip DVD with DVD Decrypter 3.5.2.0
2) Create AviSynth scripts for each episode with DGIndex 1.2.1
- settings:
-- Video: Field Operation -to- force FILM
-- Video: YUV -> RGB -to- PC Scale (tried TV Scale, no dif in results)
-- Audio: Decode to WAVE (AC3, LPCM)
-- Audio: 48 -> 44.1 KHz set OFF
3) Using Virtual Dub 1.5.10
3.1) Add filter to resize from 720x480 to 576x432 (any divisible 4:3 res has same result :(
http://img211.exs.cx/img211/2990/vdub01resize4nn.jpg (http://www.imageshack.us)

3.2) XviD (currently 1.1, but same results with 1.0.3 from http://www.koepi.org/xvid.shtml)
First Pass settings and defaults left for 2nd pass are:
http://img211.exs.cx/img211/276/vdub02pass1defaults6pg.jpg (http://www.imageshack.us)
-- no audio, and using Full Processing because of the Resize Filter

3.3) Second Pass
http://img211.exs.cx/img211/9729/vdub032pass0sg.jpg (http://www.imageshack.us)
audio
http://img211.exs.cx/img211/7241/vdub04audio3rr.jpg (http://www.imageshack.us)
Lame 3.96.1 (but get same results with no audio :( )

This gets me GREAT results, with the following exception!
Some panning, and most "space scenes" (the star ships moving on a spotted black background) shudder/jolt or just look slightly "slow". Not very noticeable in most parts, but can still detect it, and can be annoying for someone sensitive to it like me :(

This I’ve tried:
1) I have tried turning off “packed bitstream”, doesn’t help 
2) Set Quantization type to MPEG
3) Turn off Quarter Pixel
4) QPxel & Packed Bitstream off, and alternate each setting
5) VHQ Mode to 4 – Wide Search (no diff that I can see, even in quality of image)
6) Turbo :-) on and off
7) Use VHQ for bframes too (on and off)
8) In Quantization change 1’s to 2’s. no dif.

And probably other things!

Any Ideas? Please!

Thanks

warath
13th March 2005, 04:50
Oh and for encoding I've tried on several machines, all result in the same.

Decoding, using FFDShow, as well as setting it to use XviD's decoder, doesn't make a difference :(

Thanks for your help!

ChronoCross
13th March 2005, 07:11
don't use force film in dgindex unless the source is 95% film material. Else your going to have to filter it with decomb using telcide and decimate to give you smoothness. that's is pretty much the only reason it wouldn't pan correctly.

Leak
13th March 2005, 12:36
Originally posted by ChronoCross
don't use force film in dgindex unless the source is 95% film material. Else your going to have to filter it with decomb using telcide and decimate to give you smoothness. that's is pretty much the only reason it wouldn't pan correctly.

Well, AFAIK the newer Star Trek series are a mixture of 23.976 and 29.94 FPS material, so using "Force Film" in DGIndex will make a mess of them.

@Warath:
Your only good option probably is using Decomb or TIVTC to bring the 29.94 FPS stream down to 23.976 in AviSynth, with the 29.94 parts blended down to 23.976, which looks smoother than whole frames getting dropped as "Force Film" will do...

np: Jean Michel - A Completly Normal Improbability ([THN070-3] Crossways)

tigerman8u
13th March 2005, 20:28
I would lower the audio to 128kbps also. This will allow a little more bitrate for the video.

warath
13th March 2005, 21:50
Originally posted by ChronoCross
don't use force film in dgindex unless the source is 95% film material. Else your going to have to filter it with decomb using telcide and decimate to give you smoothness. that's is pretty much the only reason it wouldn't pan correctly.

If i don't use force film, when encoding, what do i do about fps? do i need to have vdub reduce to 23 fps? Or just encode and vdub will alter its fps as needed?

Thanks,

[edit]
here is my script that i'm trying now, will let you know how this works

loadplugin("C:\dgmpgdec\DGDecode.dll")
LoadPlugin("C:\dgmpgdec\decomb521.dll")
mpeg2source("D:\DVDRip\VOYAGER_S2D5\VIDEO_TS\ep1.d2v",cpu=6)
Telecide(order=1)
Decimate(cycle=5)
BicubicResize(576,432,0,0.5)

Leak
13th March 2005, 22:13
Originally posted by warath
If i don't use force film, when encoding, what do i do about fps? do i need to have vdub reduce to 23 fps? Or just encode and vdub will alter its fps as needed?

You need to set "Field Operation" to "None" in DGIndex and add "mode=3" to your Decimate call. That will decimate the 23.976 FPS material and blend the 29.94 FPS parts giving a 23.976 FPS only result, which is probably the smoothest result you can get short of going variable framerate...

np: Periskop - Horizontal ([THN039] Silent Season Dub)

warath
13th March 2005, 22:24
Scratch that, found i missed a parameter in Telecide: Now using:
loadplugin("C:\dgmpgdec1012\DGDecode.dll")
LoadPlugin("C:\dgmpgdec1012\decomb521.dll")
mpeg2source("D:\DVDRip\VOYAGER_S2D5\VIDEO_TS\ep1.d2v",cpu=6)
Telecide(order=1,guide=1)
Decimate(cycle=5)
BicubicResize(576,432,0,0.5)

let you know my results later tonight when i get back home and its done.
Thanks again for the help.

Leak
14th March 2005, 00:03
Originally posted by warath
Scratch that, found i missed a parameter in Telecide: Now using:
loadplugin("C:\dgmpgdec1012\DGDecode.dll")
LoadPlugin("C:\dgmpgdec1012\decomb521.dll")
mpeg2source("D:\DVDRip\VOYAGER_S2D5\VIDEO_TS\ep1.d2v",cpu=6)
Telecide(order=1,guide=1)
Decimate(cycle=5)
BicubicResize(576,432,0,0.5)

let you know my results later tonight when i get back home and its done.
Thanks again for the help.

Sigh.

Is there a reason you don't believe me when I say that newer Star Trek series episodes are a mixture of 23.976 FPS parts with 3:2 pulldown (the scenes with actual actors) *AND* 29.94 FPS parts (all space shots and similar computer generated scenes) where you can't treat everything the same like you do now? :rolleyes:

np: Digitalis - Rentrer (Snarecrisp Mix) (Silent Season Dub)

warath
14th March 2005, 03:41
Originally posted by Leak
Sigh.

Is there a reason you don't believe me when I say that newer Star Trek series episodes are a mixture of 23.976 FPS parts with 3:2 pulldown (the scenes with actual actors) *AND* 29.94 FPS parts (all space shots and similar computer generated scenes) where you can't treat everything the same like you do now? :rolleyes:

np: Digitalis - Rentrer (Snarecrisp Mix) (Silent Season Dub)

Sorry i missed that, however, without the mode=3 it turned out GREAT! so can't wait to see it improve with mode=3!

Thank you for your help!!

warath
14th March 2005, 03:43
Sorry, 1 more question, would it give even better results mixing to 29 FPS? can you even "up-mix"? or is it not even worth it?

Thanks,

warath
14th March 2005, 03:46
and another post, the help file that comes with Decomb doesn't give me options for Decimate, so do i remove the cycle=5 and add mode=3, or just add mode=3 ? The help file just says to use Decimate().

Thanks once again :)

Leak
14th March 2005, 08:15
Originally posted by warath
Sorry, 1 more question, would it give even better results mixing to 29 FPS? can you even "up-mix"? or is it not even worth it?

No, you can't "up-mix" to 29.976 FPS because the material you get from DGIndex *is* already 29.976 FPS - it's just that the pulldown that was applied to the 23.976 FPS parts produces jerks and combs if it's not removed when you play the video on a computer or other progressive display.

Also, I don't know which version of Decomb you're using, but the version I've got from http://www.neuron2.net/decomb/decombnew.html contains a DecombReferenceManual.html that has a chapter titled "Decimate(parameter_list)" that explains every parameter of Decimate - of course you can drop the "cycle=5" part because it's the default value, but you need to use at least "mode=3" and maybe play with the thresholds a bit...

warath
14th March 2005, 17:46
Again THANK YOU! :)

Now you've got me hooked on asking questions ;)

Any tips on how to check sources before encoding? or just do one from a specific source and if there is "jerks" in it, then do the tests that Decomb had me do to test 3:2, IFF/BFF etc.

I got the newest version of Decomb and trying to read the manual to "tweek" setting, threshold, etc, however, most of the stuff i'm very unsure of what it means, and if i should use :scared: ! any other suggestions for other options??

Scarfac3
17th March 2005, 21:33
yeah...
BicubicResize=shit
SharpResize=good
Lanczos4Resize=good
check it out for yourself.....

Ark
17th March 2005, 21:54
It depends on the source quality, sometimes Bicubic is better... (or even Bilinear... the only awful is Pointresize())

warath
17th March 2005, 22:25
Originally posted by Scarfac3
yeah...
BicubicResize=shit
SharpResize=good
Lanczos4Resize=good
check it out for yourself.....

Really? BicubicResize=shit? I've used it for a long time within VirtualDub and always liked the results. Its also the one recommended in the guides on doom9!

I'll look more into the other two, any sources for reading up on those that i should check out specificaly?

Thanks

jon.schaffer
17th March 2005, 23:19
The different resizing algorithms lead to different sharpening strength.
One could not say that one is better than another: it's a matter of taste.
Neutral bicubic produces images near to the original (few modicications).
Sharper methods (Lanczos) produces sharper images by increasing the contrast around the edges: it's a non natural way to produce sharpness. It may be more pleasing to the eyes but modifies more the image (and in a way degrades it).

Remember also that sharper image = more details for the codec --> higher bitrate needed...

warath
18th March 2005, 02:26
Well this seems to be the best options for what i'm trying. However, there are still occations where some scences look "jumpy" :(

loadplugin("C:\dgmpgdec1012\DGDecode.dll")
loadplugin("C:\dgmpgdec1012\decomb521.dll")
mpeg2source("",cpu=6)
Telecide(order=1,guide=1,vthresh=60,blend=true)
Decimate(mode=3,threshold=2.0,quality=3)
BicubicResize(576,432,0,0.75)

I'm use to the BicubicResize, so I've left it. Though I did try the others, with no real liking of either. I'm using MPEG now instead of the H.263, which will sharpen the image some anyways.

Leak
18th March 2005, 08:50
Originally posted by warath
Well this seems to be the best options for what i'm trying. However, there are still occations where some scences look "jumpy" :(

loadplugin("C:\dgmpgdec1012\DGDecode.dll")
loadplugin("C:\dgmpgdec1012\decomb521.dll")
mpeg2source("",cpu=6)
Telecide(order=1,guide=1,vthresh=60,blend=true)
Decimate(mode=3,threshold=2.0,quality=3)
BicubicResize(576,432,0,0.75)

I'm use to the BicubicResize, so I've left it. Though I did try the others, with no real liking of either. I'm using MPEG now instead of the H.263, which will sharpen the image some anyways.

Maybe try out TIVTC (look at the last post) (http://forum.doom9.org/showthread.php?s=&threadid=82264&perpage=40&highlight=TIVTC&pagenumber=5), it might work better than Decomb.

warath
18th March 2005, 18:15
Well, it seems to work better on the test scene i'm using, however, its a HUGE pain in the ass to have two different avs files for 2-pass encoding. Trying to use just one, with single pass options as suggested in the readme's crashes VDUB :(

Leak
18th March 2005, 23:30
Originally posted by warath
Well, it seems to work better on the test scene i'm using, however, its a HUGE pain in the ass to have two different avs files for 2-pass encoding. Trying to use just one, with single pass options as suggested in the readme's crashes VDUB :(

:confused:

I've never, ever had to use more than one AVS file with TIVTC, even when doing a 2-pass XviD encode - what exactly are you doing, and what's the difference between the files?

np: Chronolux - Fractional (Silent Season Dub)

warath
18th March 2005, 23:49
I was trying the variable rate method, that required two different avs files, that's why :)

I've subsequently found the single pass method down to 23fps to be very good, and am now trying a full episode pack with this method.

loadplugin("C:\dgmpgdec1012\DGDecode.dll")
loadplugin("C:\dgmpgdec1012\TIVTC\TIVTC.dll")
mpeg2source("D:\DVDRip\VOYAGER_S4D2\VIDEO_TS\ep2.d2v",cpu=6)
tfm(d2v="D:\DVDRip\VOYAGER_S4D2\VIDEO_TS\ep2.d2v",order=1)
tdecimate(hybrid=1)
BicubicResize(576,432,0,0.75)

Let ya know how it turns out, from the test scene looks just a tad better than the Decomb method i've used.

Leak
19th March 2005, 20:05
Originally posted by warath
I was trying the variable rate method, that required two different avs files, that's why :)

Oh, okay then. :)

I don't really like VFR files since a) they need a 120 FPS refresh rate to be displayed correctly (which my TFT can't handle with it's 60-75 Hz range), and b) they surely won't play properly on any standalone I can think of.

If you play those VFR files at a refresh rate that can't be evenly divided by 24 and 30, you'll get jerks from that...

np: Martin Jarl ft. Jon Ericsson - Inidimman (Crossways Part 1)

warath
19th March 2005, 22:30
Well, my last posted script with TIVTC worked very well. For the most part the episodes came out identical to the Dcombe ones, however, one in particlar that was giving me trouble came out much better. Still a few jumps here and there, but not bad for trying to "blend" (or whatever it really does ;) ) frames together!

I find with TIVTC encoding takes about 30min longer, so it must do more searching; thus the slightly better results.

Now to go back and re-encode my first attempts before everyones great help here at doom9!

Thanks all!

Ark
22nd March 2005, 01:02
Originally posted by warath
loadplugin("C:\dgmpgdec1012\DGDecode.dll")
loadplugin("C:\dgmpgdec1012\TIVTC\TIVTC.dll")
mpeg2source("D:\DVDRip\VOYAGER_S4D2\VIDEO_TS\ep2.d2v",cpu=6)
tfm(d2v="D:\DVDRip\VOYAGER_S4D2\VIDEO_TS\ep2.d2v",order=1)
tdecimate(hybrid=1)
BicubicResize(576,432,0,0.75)


Just a note...isn't cpu=6 waaay too strong pp? Your source is dvd right? I don't know how they are quality-wise but i've tested many different sources and cpu=6 was toooo strong for my taste, washing out too much detail for me.
Some people use pp as a denoiser, but i'll use some filter like removegrain(), temporalcleaner() or the mighty (and heavy) pixiedust() :D (if the problem isn't excessive macroblocking).

Just my 2 cents...

pelle412
22nd March 2005, 17:00
I've encoded 100s of TNG, DS9, and VOY episodes to XviD and I've found that these settings have worked very well for me.

AviSynth:

SetWorkingDir("D:\AviSynth\")
LoadPlugin("DGDecode.dll")
LoadPlugin("UnDot.dll")
LoadPlugin("Decomb521.dll")

# 2.0 plugins
LoadPlugin("LoadPluginEx.dll")
LoadPlugin("Old\DustV5.dll")

function FOrder(clip c) {
fo= GetParity(c)? 1:0
return fo
}

mpeg2source("E:\Movie\x.d2v",iPP=true,cpu=4)
Telecide(FOrder(),guide=1,post=4).Decimate(mode=3,quality=3)
LumaFilter()
Undot()
ConvertToYUY2().PixieDust(limit=2)
crop(20,0,692,476)
BicubicResize(640,480,0,0.5)
Undot()




XviD (default exceptions):
Quantizers 2-32
AQ
VHQ 4
VHQ bframes
Max I-frame interval 240
Chroma Optimizer (in zone)
End credits zone fixed Q 10 (can't see anything if use Q 31)
H263 quantization

Two-pass encoding, aiming for 70% compressibility. The average size episode including VBR MP3 sound (lame -v) is 225MB and they look just fine.

warath
22nd March 2005, 17:11
wow, that small of a file, I'd think you would lose a lot. And "just fine" is a very subjective statement :)

I love the 348MB files that i've been getting with the TIVTC script. However, I may try your script just for fun. Not sure what half of it means/is doing, but worth a try, thanks. :)

pelle412
22nd March 2005, 21:52
Here's a sample screen shot. What I meant by "just fine" is watching this on a large screen TV at ~ 10 - 12 ft distance and have multiple people compare the encoded movie to the source DVD and not finding any noticeable difference. I generally don't watch movies 1 - 2 ft away from a LCD computer monitor so I don't need that "perfect encode".

EDIT: It seems my attachment didn't work.

http://files.bighosting.net/on10658.png