Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: XviD / DivX guide? (Read 15101 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

XviD / DivX guide?

Can anyone recommend good Xvid and DivX settings for
a 1-CD-rip and 2-CD-rip, or at least recommend a site where
I can find such settings?

I have the latest versions of DivX and Xvid and have installed both
GK and AutoGK, but haven't encoded ripped any movies yet, cos I'm
a total newbie as far as video codec settings are concerned.

I just need some good settings, so please don't point me to a site
where I'll have to read through hundreds of pages explaining every
mode...

Thanx in advance!
Wanna buy a monkey?

XviD / DivX guide?

Reply #1
Quote
Can anyone recommend good Xvid...

Use defaults
And all advanced features on. 
BTW, if you use XViD GMC, you will not be able to play resulting files on standalones period, becasue no one chip supports 3 warp point GMC now...

XviD / DivX guide?

Reply #2
Quote
Can anyone recommend good Xvid...


Try this:  http://www.vslcatena.nl/~ronald/docs/xvidfaq.html

Here's some rule of thumb tips (although they do vary depending on the movie).

H.263 for 1CD
MPEG for 2CD

Use Motion Search 6.

VHQ4 is recommended.

Don't bother with GMC (yet).
QPEL can be useful, but you'll have to experiment with the source.

Always do 2 pass encodes.  Discard the first pass always.

Use Chroma motion.

Cartoon mode is for stuff like the Simpsons, not stuff like Shrek.

Trellis is good, and pretty much safe to always use.

You're still better off limiting the min quants to 2, as quant 1 is pointless (unless you want a bloated file).

Use B frames.  Use closed GOV always.  Don't use packed bitstream ever (DivX hack that breaks MPEG4 specs).
Adaptive Quantization can work well.  Try it and see.

Under Zone Options you can turn on the Chroma Optimizer as well.

XviD / DivX guide?

Reply #3
Quote
Can anyone recommend good Xvid and DivX settings for
a 1-CD-rip and 2-CD-rip, or at least recommend a site where
I can find such settings?
[{POST_SNAPBACK}][/a]


This seems like a good and regularly updated guide to me on first glance: [a href="http://neap0litan.home.comcast.net/]http://neap0litan.home.comcast.net/[/url]

XviD / DivX guide?

Reply #4
yourtallness, if you haven't already, check out the Doom9 fora (forum.doom9.org) That's where most of the Xvid/DivX people hang out.

Quote
VHQ4 is recommended.
[a href="index.php?act=findpost&pid=226525"][{POST_SNAPBACK}][/a]

Last I heard, VHQ4 didn't improve quality much, but makes encoding go REALLY slow. I suggest trying one at VHQ1 and one at VHQ4 (nobody seems to use the ones in the middle...) and seeing for yourself.

I agree with all JJ180's other settings.

But I should add that sometimes B-frames don't work so well on anime, where motion occurs on every second or third frame. For 'real' movies, though, it should be on.

(Hee hee... I was just about to hit 'add reply' on the orig. thread when I noticed the posts had been swiped out from under my feet. Glad I found where they went...  )
"We demand rigidly defined areas of doubt and uncertainty!" - Vroomfondel, H2G2

XviD / DivX guide?

Reply #5
My recommend settings for XviD:

For near D1 (1:1 aspect ratio) resolution (e.g. 672x384) but you should do compressibility test for the encode before select the resolution (read more about compressiblity test concept at doom9.org)

Very High Bitrate (> 1500kps)

Ouant. Matrix: MPEG or High Quality Custom Matrix (e.g. HVS Best)
Adaptive Quant.: Off
Q-Pel: On
GMC: Off
BVOBs: Not Use
Motion Search Precision: 6 - Ultra High
VHQ Mode: 4 - Wide Search
Chroma Motion: On
Trellis: On



Medium-High Bitrate (> 900kps)

Ouant. Matrix: MPEG
Adaptive Quant.: Off
Q-Pel: On
GMC: Off
BVOBs (max consecutive frame : quant. ratio : quant. offeset): 1.0 : 1.5 : 0
Motion Search Precision: 6 - Ultra High
VHQ Mode: 4 - Wide Search
Chroma Motion: On
Trellis: On



Low Bitrate (< 900kps)

Ouant. Matrix: H.263 (or Jawor 1 CD matrix if you like sharp image)
Adaptive Quant.:  Off but if bitrate is very low (<700kbps) turn it On
Q-Pel: Off
GMC: Off
BVOBs (max consecutive frame : quant. ratio : quant. offeset): 2.0 : 1.5 : 1
Motion Search Precision: 6 - Ultra High
VHQ Mode: 4 - Wide Search
Chroma Motion: On
Trellis: On

Always use 2-passes, everything else use deault setting


Notes:
1. These setting is just a guideline you SHOULD do compressibility test for your specific video source.
2. If you got unfavorable comp. test (and your source video is noisy) try improving the source video by using appropriate noise filter (I recomend using Avisynth frameserving for the source video)
3. If your source is NTSC video that was telecined from film (24fps) always do Inverse Telecine (IVTC). (by using forcefilm in DGIndex or using donald garft's decomp filter, I assume your source is DVD)
4. G-Knot + some manual encodings is the best ways to do DVD -> XviD conversion (for convenience, quality and flexibility tradeoff)

XviD / DivX guide?

Reply #6
I must add that the goal of my settings is "Quality", encoding time is not my consideration. (I always use Job Control in V-Dub Mod to batched encode during my sleep)

If encoding speed is your concern, I recomend using VHQ=1 + Turbo on the first pass (but VHQ-4 and Turbo off for 2nd pass). This will significantly speed up the 1st pass but leave minimal impact on the quality.

XviD / DivX guide?

Reply #7
Quote
If encoding speed is your concern, I recomend using VHQ=1 + Turbo on the first pass (but VHQ-4 and Turbo off for 2nd pass). This will significantly speed up the 1st pass but leave minimal impact on the quality.
[{POST_SNAPBACK}][/a]

i thought VHQ settings were ignored during first pass?

[a href="http://forum.doom9.org/showthread.php?s=&threadid=76974]http://forum.doom9.org/showthread.php?s=&threadid=76974[/url] (syskins post)
"We cannot win against obsession. They care, we don't. They win."

XviD / DivX guide?

Reply #8
Quote
Last I heard, VHQ4 didn't improve quality much, but makes encoding go REALLY slow. I suggest trying one at VHQ1 and one at VHQ4 (nobody seems to use the ones in the middle...) and seeing for yourself.

i found that this setting makes the most quality difference - from my limited testing - , even for example usage of b-frames would not improve quality more for 1cd rip.
PANIC: CPU 1: Cache Error (unrecoverable - dcache data) Eframe = 0x90000000208cf3b8
NOTICE - cpu 0 didn't dump TLB, may be hung

XviD / DivX guide?

Reply #9
Quote
Don't use packed bitstream ever (DivX hack that breaks MPEG4 specs).
[{POST_SNAPBACK}][/a]


i heard packed bitstream was "ok" to use now, as of 1.0, or the RC just before 1.0... or is that wrong?

Quote
For near D1 (1:1 aspect ratio) resolution (e.g. 672x384) but you should do compressibility test for the encode before select the resolution (read more about compressiblity test concept at doom9.org)
[a href="index.php?act=findpost&pid=226564"][{POST_SNAPBACK}][/a]


i use 640x[whatever] as it's closest to the resolution i use on my computer (1280x960), and 640 wide seems to be what's most suggested on doom9 forums anyway.

640x480 for academy/fs (4:3) movies/shows (although you might want to shrink it down if you're hurting for bits) ... and beware of that lovely thing called interlacing/telecine if it's anime or musicvideos or TV related
640x352 for flat (1.85:1) movies
640x272 for scope (2.35:1) movies

there are more resolutions @ [a href="http://www.doom9.org/bitrate_guide.htm]http://www.doom9.org/bitrate_guide.htm[/url] but i stick to 640x[whatever] unless i'm going for extremely low bitrate stuff.

i also try to keep away from custom mpeg-matricies (and mpeg quantization as a whole) since i like to convert encodes to MP4 files so i could play them back on a Mac if i'm bored and one happens to be around (and they're locked down like at a university campus and couldn't load 3ivx to play xvid AVIs)

XviD / DivX guide?

Reply #10
My fav DivX XviD site.  Only tells you things you need to know

www.everwicked.com

XviD / DivX guide?

Reply #11
Quote
Quote
Last I heard, VHQ4 didn't improve quality much, but makes encoding go REALLY slow. I suggest trying one at VHQ1 and one at VHQ4 (nobody seems to use the ones in the middle...) and seeing for yourself.

i found that this setting makes the most quality difference - from my limited testing - , even for example usage of b-frames would not improve quality more for 1cd rip.
[a href="index.php?act=findpost&pid=226576"][{POST_SNAPBACK}][/a]
Sorry, are you saying that VHQ4 is much better than 1, or that VHQ is better than no VHQ, or both?

I have to admit that I don't have any experience with 1cd rips. I tend to use higher quality settings (~1.2GiB, usually)

[edit]
I just did a little low-bitrate test, and indeed VHQ4 is noticably better than VHQ1, although it took longer to encode (1:34 vs. 2:40).
"We demand rigidly defined areas of doubt and uncertainty!" - Vroomfondel, H2G2

XviD / DivX guide?

Reply #12
Visit Doom9. This is THE definitive site on video encoding. Nothing else will do.

XviD / DivX guide?

Reply #13
Quote
[edit]
I just did a little low-bitrate test, and indeed VHQ4 is noticeably better than VHQ1, although it took longer to encode (1:34 vs. 2:40).
I'am glad we came to the same conclusion, there should be noticeable difference even on higher bitrates. also, for my eyes Ouant. Matrix: H.263 is always the best choice, even for higher bitrates (but this could be related to the final viewing device - in my case that is mostly my 15,2 inch laptop lcd).
PANIC: CPU 1: Cache Error (unrecoverable - dcache data) Eframe = 0x90000000208cf3b8
NOTICE - cpu 0 didn't dump TLB, may be hung

XviD / DivX guide?

Reply #14
Ok lets see if I can answer some questions and hopefully clarify some things.

Quote
Notes:
1. These setting is just a guideline you SHOULD do compressibility test for your specific video source.
2. If you got unfavorable comp. test (and your source video is noisy) try improving the source video by using appropriate noise filter (I recomend using Avisynth frameserving for the source video)
[{POST_SNAPBACK}][/a]


I don't think compressibility tests are any longer valid.  For instance, if your compressibility test says 80% compressible.  And you end up with a average quant of 2.5 for the entire movie, can you say from that that it will look good?  What if you got 50% compressiblity and average quant of 8?  This information doesn't tell you much if anything.  I have seen plently of movies which looked nice with a average quant of 8 and probably compressibility of probably < 50%.  Then again I have seen some encodes with a average quant of 2.5 that look ugly.

I would also caution against filtering.  Way too many people filter their movies like crazy because they think it is going to help.  Usually, it doesn't help at all.  Most codecs can deal with some noise.  If you filter all that noise you are going to end up filtering out lots of detail and creating artifacts with the filters you are using.  I can't remember the last time I have actually used a denoiser.  My encodes nowadays are just crop+resize.  But a denoiser, which is used in the codec could be useful since a video codec has much more information which it can make use of than most avisynth filters. 

I have played around with a experimental version of XviD which uses coring to denoise the video see [a href="http://ieeexplore.ieee.org/xpl/abs_free.jsp?arNumber=993441]http://ieeexplore.ieee.org/xpl/abs_free.jsp?arNumber=993441[/url]  It is very effective at removing noise without harming details too much and reducing bitrate.  BTW I think it gives a PSNR increase too.

Quote
Quote
If encoding speed is your concern, I recomend using VHQ=1 + Turbo on the first pass (but VHQ-4 and Turbo off for 2nd pass). This will significantly speed up the 1st pass but leave minimal impact on the quality.
[{POST_SNAPBACK}][/a]

i thought VHQ settings were ignored during first pass?

[a href="http://forum.doom9.org/showthread.php?s=&threadid=76974]http://forum.doom9.org/showthread.php?s=&threadid=76974[/url] (syskins post)
[a href="index.php?act=findpost&pid=226575"][{POST_SNAPBACK}][/a]


They are disabled in the first pass by default, enable full quality first pass to be able to enable VHQ in first pass and qpel and other slower features.

Quote
I'am glad we came to the same conclusion, there should be noticeable difference even on higher bitrates. also, for my eyes Ouant. Matrix: H.263 is always the best choice, even for higher bitrates (but this could be related to the final viewing device - in my case that is mostly my 15,2 inch laptop lcd).
[a href="index.php?act=findpost&pid=226715"][{POST_SNAPBACK}][/a]


Yes, I use H.263 quant almost exclusively.  At really low bitrates it begins to block more than a mpeg matrix like HVS good.  That would be the only time I would switch to a mpeg matrix.

BTW there usually isn't much need to change settings too much from XviD's defaults.  Here is what settings I usually use:

H.263 Quantization
Qpel // I use this on all movies except cartoons or anime.
B-frames 1, 1.5, 1.0
Packed bitstream off // only use it if you don't want decoder lag or want maximum standalone compatibility.
Chroma motion // if you use VHQ4 probably you may not need to enable this.
Turbo // give a nice speedup w/ qpel with very minimal quality loss.
VHQ 4
I-frame interval 240 // 10x the fps is a good rule of thumb.
All min quantizers to 2
Trellis quantization

I don't want to say these are the best settings because it varies obviously from movie to movie and from person to person.  But they have worked well for me.  I would caution against enabling things like AQ or GMC.  AQ may harm quality as it is still a little buggy and GMC likely will not increase quality much and will slow things down a lot.

XviD / DivX guide?

Reply #15
Quote
Quote
Don't use packed bitstream ever (DivX hack that breaks MPEG4 specs).
[{POST_SNAPBACK}][/a]


i heard packed bitstream was "ok" to use now, as of 1.0, or the RC just before 1.0... or is that wrong?

Quote
For near D1 (1:1 aspect ratio) resolution (e.g. 672x384) but you should do compressibility test for the encode before select the resolution (read more about compressiblity test concept at doom9.org)
[a href="index.php?act=findpost&pid=226564"][{POST_SNAPBACK}][/a]


i use 640x[whatever] as it's closest to the resolution i use on my computer (1280x960), and 640 wide seems to be what's most suggested on doom9 forums anyway.

640x480 for academy/fs (4:3) movies/shows (although you might want to shrink it down if you're hurting for bits) ... and beware of that lovely thing called interlacing/telecine if it's anime or musicvideos or TV related
640x352 for flat (1.85:1) movies
640x272 for scope (2.35:1) movies

there are more resolutions @ [a href="http://www.doom9.org/bitrate_guide.htm]http://www.doom9.org/bitrate_guide.htm[/url] but i stick to 640x[whatever] unless i'm going for extremely low bitrate stuff.

i also try to keep away from custom mpeg-matricies (and mpeg quantization as a whole) since i like to convert encodes to MP4 files so i could play them back on a Mac if i'm bored and one happens to be around (and they're locked down like at a university campus and couldn't load 3ivx to play xvid AVIs)
[a href="index.php?act=findpost&pid=226586"][{POST_SNAPBACK}][/a]


For the resolution no need to stick with 640 width.

For DVD rip (NTSC DVD is 720x480) you should use maximum resolution possible (taken into account bitrate thing) that not exceed the soure resolution (720x480 minus any crop) I mean the framesize is determine with bitrate (higher res. is better if you have enough bitrate, do compressibility test) and capped with source resolution. When you playback the player will resize it  to fit the screen for you, higher res. mean more information for upscalling.

Yes MPEG matrix and custom matrix break mpeg-4 advanced simple profile and should not be used in your case. But I think most player (include hardware mpeg-4 player) can playback video encoded using custom matrix fine.

My recommended mpeg4 decoding filter is ffdshow. (3ivx is buggy)

XviD / DivX guide?

Reply #16
Quote
Yes MPEG matrix and custom matrix break mpeg-4 advanced simple profile and should not be used in your case. But I think most player (include hardware mpeg-4 player) can playback video encoded using custom matrix fine.
[a href="index.php?act=findpost&pid=226774"][{POST_SNAPBACK}][/a]

MPEG and custom MPEG matrices dont break MPEG4 ASP specs AFAIK... thought they were part of it.  hardware DivX players will normally not (or shoudlnt have to) play them as they are not in the DivX profiles...
"We cannot win against obsession. They care, we don't. They win."

XviD / DivX guide?

Reply #17
Quote
Ok lets see if I can answer some questions and hopefully clarify some things.

I don't think compressibility tests are any longer valid.  For instance, if your compressibility test says 80% compressible.  And you end up with a average quant of 2.5 for the entire movie, can you say from that that it will look good?  What if you got 50% compressiblity and average quant of 8?  This information doesn't tell you much if anything.  I have seen plently of movies which looked nice with a average quant of 8 and probably compressibility of probably < 50%.  Then again I have seen some encodes with a average quant of 2.5 that look ugly.

I would also caution against filtering.  Way too many people filter their movies like crazy because they think it is going to help.  Usually, it doesn't help at all.  Most codecs can deal with some noise.  If you filter all that noise you are going to end up filtering out lots of detail and creating artifacts with the filters you are using.  I can't remember the last time I have actually used a denoiser.  My encodes nowadays are just crop+resize.  But a denoiser, which is used in the codec could be useful since a video codec has much more information which it can make use of than most avisynth filters. 

I have played around with a experimental version of XviD which uses coring to denoise the video see http://ieeexplore.ieee.org/xpl/abs_free.jsp?arNumber=993441  It is very effective at removing noise without harming details too much and reducing bitrate.  BTW I think it gives a PSNR increase too.


I think compressibility test is useful, you compare bit/pixel of your setting with thoes of q=2 reference encode. As my rules of thumb I always use 50%-60% bit/pixel of reference encode. this will give me average quant of 4-6 (if you use b-frame quant ratio 1.5, offest 1) Without comp. test how could I choose appropriate framesize?

I don't know how the encode with average quant of 2.5 can look ugly, could you please elaborate on this?

About filtering, for low bitrate encode of noisy source, I think it will do more help than harm.  I don't know that XviD have its own noise filter, but I think the idea of denoise filter inside the codec is good, codec will have more information for the motion estimate and after that it can filter out the noise and save some space on the texture part.

About the VHQ=1 for 1st pass, sorry for spreading wrong info.
but for "Turbo" in first pass, does it improve first pass speed?

XviD / DivX guide?

Reply #18
Quote
I think compressibility test is useful, you compare bit/pixel of your setting with thoes of q=2 reference encode. As my rules of thumb I always use 50%-60% bit/pixel of reference encode. this will give me average quant of 4-6 (if you use b-frame quant ratio 1.5, offest 1) Without comp. test how could I choose appropriate framesize?

I don't know how the encode with average quant of 2.5 can look ugly, could you please elaborate on this?
[a href="index.php?act=findpost&pid=226783"][{POST_SNAPBACK}][/a]


It is simple, knowing the average quantizer of the encode tells you nothing about the quality.  For example, I like to encode lots of simpsons episodes.  Using your method of compressibility tests and bit-pixel would suggest that I should resize down to like 512x384 so that my compressibility would be about 50-60%.  However, they still look better at higher resolution like 640x480 with no visible quality problems and with much lower compressibility. 

So, how do you figure out your framesize and how big your final size you should be?  Honestly it is a little bit of intuition but mostly I tend to redo my encodes several times to get everything the way I like.  I prefer encoding at the highest resolution possible and don't mind some blocking.  This is really a personal call though whether you would prefer more artifacts and more detail or less artifacts and less detail.

Quote
About filtering, for low bitrate encode of noisy source, I think it will do more help than harm.  I don't know that XviD have its own noise filter, but I think the idea of denoise filter inside the codec is good, codec will have more information for the motion estimate and after that it can filter out the noise and save some space on the texture part.

About the VHQ=1 for 1st pass, sorry for spreading wrong info.
but for "Turbo" in first pass, does it improve first pass speed?
[a href="index.php?act=findpost&pid=226783"][{POST_SNAPBACK}][/a]


XviD doesn't have its own denoising filter this was just an experiment.  VHQ1 can be used for first pass just enable full quality first pass and then turn it on.  Turbo isn't going to speed up 1st pass if you don't have full quality first pass enabled.  Turbo speeds up the encode when qpel and or b-frames are turned on.

XviD / DivX guide?

Reply #19
Is the source preprocessing option in DivX a denoising filter?

XviD / DivX guide?

Reply #20
Quote
Is the source preprocessing option in DivX a denoising filter?
[a href="index.php?act=findpost&pid=226867"][{POST_SNAPBACK}][/a]


Yes, but I am not sure how it works or how well it works.

XviD / DivX guide?

Reply #21
Thank you guys for all your suggestions!
I will check out all of them.

Video compression is so much more complex than audio compression,
and for the time being I don't have the time to sit down and read about
it. I just want some sure-fire settings to start encoding with. I'll try to read
up on video compression when I get round to it!

Quote
I must add that the goal of my settings is "Quality", encoding time is not my consideration.


Same here! I never go for speed, always for optimal quality.

Quote
But I should add that sometimes B-frames don't work so well on anime, where motion occurs on every second or third frame. For 'real' movies, though, it should be on.


I'll keep that in mind, since I'm planning on ripping some anime movies.

BTW, is keeping the original resolution not advisable?
Wanna buy a monkey?

XviD / DivX guide?

Reply #22
Quote
Quote
But I should add that sometimes B-frames don't work so well on anime, where motion occurs on every second or third frame. For 'real' movies, though, it should be on.


I'll keep that in mind, since I'm planning on ripping some anime movies.

BTW, is keeping the original resolution not advisable?
[a href="index.php?act=findpost&pid=226953"][{POST_SNAPBACK}][/a]


I don't know how this started but it is simply wrong.  There is no reason why b-frames would not work well on anime.  In fact they work very very well on anime.  Take a look at a lot of the best quality anime floating around on BT, all of them use b-frames, I can assure you.  Also keep in mind that many of the XviD developers are anime addicts.  B-frames are very well tweaked for anime as well as regular footage.

XviD / DivX guide?

Reply #23
Quote
It is simple, knowing the average quantizer of the encode tells you nothing about the quality.  For example, I like to encode lots of simpsons episodes.  Using your method of compressibility tests and bit-pixel would suggest that I should resize down to like 512x384 so that my compressibility would be about 50-60%.  However, they still look better at higher resolution like 640x480 with no visible quality problems and with much lower compressibility. 

So, how do you figure out your framesize and how big your final size you should be?  Honestly it is a little bit of intuition but mostly I tend to redo my encodes several times to get everything the way I like.  I prefer encoding at the highest resolution possible and don't mind some blocking.  This is really a personal call though whether you would prefer more artifacts and more detail or less artifacts and less detail.


I got your point. You mean reduce framesize (resolution) to keep bit/pixel higher sometime sacrified quality more than just keeping the framesize large and have some block.

I agree on this, sometime keep the resolution (and more artifact) is better. But on low bitrate encode (e.g. 2 hours movie on 1 cd rip), if you ignor bit/pixel thing and use large framesize, the resulting video looks very bad.

On more thing from my observation I want to share:
If I watch my xvid/divx on TV (using XBOX as the player), I found that low res video (with less artifact) look better than higer res video (with more artifact). But if I watch the same clip on my laptop (with UXGA screen), I think the high res looks better.  So I think the upscalling factor plays important role on this. On TV playback the video is upscaled with factor around 1.2-1.4) but on PC the video was upscale 2-3 times its original size.

XviD / DivX guide?

Reply #24
I a have a problem with Gordian Knot.
I've been following the Xvid-Ogg-Mkv guide and
after decoding with DGIndex, the d2v file cannot
be opened with Gordian Knot.
It claims that:
"File is not a valid d2v project, avi, or avs file."

Any solutions?

Also, I noticed that there are some differences between
GK and the guide as far as DGIndex settings are concerned.
According to the guide, field operation should always be
"forced FILM" and iDCT Algorithm set to 64bit, whereas
GK stresses that "forced FILM" should be selected only
for NTSC movies, and does not mention changing the
iDCT algo.
Btw, audio streams demuxed with different DGIndex settings
for video have different delay values...

The guide also suggests using MPEG quantization instead
of H.263, among other differences...
Wanna buy a monkey?