Log in

View Full Version : My first XviD encode


Raithmir
15th June 2004, 20:56
Was a rip of the Underworld DVD. Now I'm new to XviD (been using DivX since the start) and didn't really mess with the settings but I'm very impressed with the results! I made an 800MB file to fit a 90 minute CD, 128MB VBR MP3, video bitrate ~840k. Brief rundown of my settings used...

XviD 1.0.1
Quant type H.263
Quarter Pixel
Max B-VOPS 2
motion search 6
VHQ 1
Use chroma motion


Now of course I'd like to try and get the best quality possible out of my encodes but I'm not familiar with all the XviD options or their current stability. If it's not being too cheeky (I'm preparing myself to be told to use the search button! lol) I'd like to ask a few questions and get peoples opinions on the following...


Profile settings
----------------

Quant type : I had thought of trying HVS-Better or Best next, recommendations of which one or any others for this bitrate?

Adaptive quantization (lumi masking?) : Recommended?

GMC : I seem to remember reading that this was "experimental" is it deemed stable enough in XviD now? Should I use it?

B-VOPS : Would max of 3 improve quality? Leave quant settings default?

Packed bitstream : Are issues with this now resolved and presumably this should be left enabled?


Encoding settings
-----------------

2nd pass Intra-frames tuning : leave as default settings?


Zone options
------------

Anything in here worth enabling? Chroma opt?


Advanced options
----------------

VHQ mode : will using one of the higher modes help? what is the encoding time impact?

Turbo : Does enabling this have an impact on quality?

Quantizer restrictions : leave as defaults? (min 1, max 31)

Trellis : are previous problems with this truely fixed, is it worth using?



I welcome anyone's comments, recommendations or suggestions on these or any other settings. Oh and which of these settings would break H/W player compatability? (B-VOP 3? Custom quant type?) I have an Elta 8883 by the way. I realise I'm probably asking a lot but thanks for anyone's input in advance.

From what little I've seen so far I'm definately switching to XviD!

Regards,

Michael.

Teegedeck
15th June 2004, 21:02
Hello and welcome! :)

You can imagine that you're not the first to ask 'what's safe, what's good?'. Please have a good search. Gee, you can even see a thread about good 2-CD-settings at the bottom of this very page. :cool:

Raithmir
15th June 2004, 21:20
Originally posted by Teegedeck
Hello and welcome! :)

You can imagine that you're not the first to ask 'what's safe, what's good?'. Please have a good search. Gee, you can even see a thread about good 2-CD-settings at the bottom of this very page. :cool:

Ah yes I had read that thread but I was tired at the time and when it deviated onto talking about custom quantizers and whether it should be 10, 12, or 16 inter matrix (WTF?) I switched off! lol. I'm reading the various custom quant threads now to try and get my head around it.

Ok so I see now that you recommended the highest VHQ, b-frames 2/1.5/1, trellis, gmc, adaptive quant, and qpel, so I guess that answers most of my questions! (in your recommendations anyway, I'd still be interested in anyone elses ;)).

I'd still like to know if I should enable chroma opt in the zone settings? What the impact on encoding time is with the highest VHQ (is it about 50% longer?), and does turbo mode reduce quality? I'll look into SixOfNine too.

Regards,

Michael.

Raithmir
15th June 2004, 23:34
Well I've had a lot more time tonight to read a few threads and for anyone else with similar questions to me http://forum.doom9.org/showthread.php?s=&threadid=76454 is a useful thread. :p

I think I'll try encoding The Usual Suspects DVD tomorrow with HVS-Best and trying out different settings (things take a while with a Celeron 800 though!).

Mnl
16th June 2004, 07:53
Hi Raithmir

If your processor is a 800 MHz Celeron, I think you would be better off using VHQ 1 instead of VHQ 4. It really makes a difference in encoding speed - just try with a small sample for yourself - the quality with VHQ 1 is still outstanding. Also the Turbo option would help you as it speeds up first pass quite a bit without having any real impact on quality (if there is, I can't see it :)). Otherwise the settings you mentioned seem fine to me.

Have fun testing ;)

Koepi
16th June 2004, 08:01
The "Turbo ;-)" switch has nothing to do with "fast first pass", this is a common misbelieve!

Turbo ;-) enables a faster (and less precise) bframe- and qpel- motion estimation, so it sacrifices quality for speed. You won't notice that on (fast) first pass but in 2nd pass.

Regards
Koepi

AsTimeGoesBy
25th November 2004, 01:50
Hi - I have a little conflict about the 2nd pass file name:

Afterdawn.com DVD to Xvid Guide (http://www.afterdawn.com/guides/archive/copy_dvd_to_xvid.cfm)
...
Also remember that you can't save this in same name as the first pass file, so we recommend to name it something like 'movie-2nd_pass'. Then simply click Save and you're back into the main window.
...

(Remark: found at the last quarter of the page)

Videohelp.com DVD to XviD Conversion (http://www.videohelp.com/forum/viewtopic.php?t=221896)
...
Step 6: VirtualDub (2nd Pass)
...
Select FILE -> SAVE AVI, using the exact same filename, path, and checkbox option (i.e. ensure that the 'do not run this job now' option is CHECKED). and click SAVE.
...

(Remark: found at the middle of the page, just after bitrate calculator section)


Now please, how should the file name look like of the 2nd Xvid pass when encoding with VirtualDub?

Indeed also the Doom9.org Xvid Guide (http://www.doom9.org/index.html?/xvid.htm) (see Step 3 => VirtualDub) takes another file name.
So will i waste my (current) encoding jobs if i take the same name for the 1st and 2nd pass?

Tommy B.
25th November 2004, 19:07
Don't get too excited about the results. Underworld is pretty well
compressible. The real deal is when it comes to diffcult (rain, snow)
to compress material.

You should check out some of the 1CD matrices (Jawor for example).
They perform better than h263.

Teegedeck
25th November 2004, 21:04
That is the question. Sharktooth's ULR matrix scored only slightly better than H.263 in the first round of Soulhunter's matrix blindtest, H.263 and Javor's matrix were on par - but that was first round of blindtests was testing some really extreme compession, below 1-CD-quality. Soulhunter's series of matrix blindtests is the first attempt at testing matrices to be taken seriously. Still, one must say it is based upon only one movie.

The results of round 2 of Soulhunter's tests will tell us, with at least some certainty, which matrix 'is best' for 1-CD encodes, I guess. Let me be precise, for compressibility values that are most common for 1-CD encodes.

You are welcome to take part in it if you like! :)
http://forum.doom9.org/showthread.php?s=&threadid=85455

AsTimeGoesBy
26th November 2004, 05:51
Thanks for joining this dusty thread. But please note, i'm still reading newbie guides about Xvid...

So i would be very happy for a little reply first on my very basic question:
Must the filename for saving the 2nd pass the same or the diffrent as the filename i have used for the 1st pass?
The guides are saying contradictory things... Belong my presonal test it doesn't matter if the filename is the same or not (Xvid v1.02).


Originally posted by Tommy B.
Don't get too excited about the results. Underworld is pretty well
compressible. The real deal is when it comes to diffcult (rain, snow)
to compress material.
...'Underworld' i don't know. But i intend to compare a Xvid version of 'Van Helsing' to the DivX version. This movie has some nice scenes of water, rain, snow but also fire. And 'Ice Age' contains also some snowy scenes as i remeber.
Accidentally i have found yesterday a rainy scene in Shrek 2 (http://forums.divx.com/viewtopic.php?topic=62750&forum=6) i am not happy with as DivX.


Originally posted by Tommy B.
...
You should check out some of the 1CD matrices (Jawor for example).
They perform better than h263.
This thing with the matrices i will keep in mind. But for now i haven't yet any idea how to setup or implement these things in the Xvid configuration... :(

Ark
26th November 2004, 09:34
Yes, it doesn't matter if 1st-pass file name is equal or not to 2nd-pass.

The only important thing is to load the correct *.pass file on 2nd-pass...

I think Shrek 2, Ice ace and in general all digital movies are the most compressible sources, both for their short playtime (about 1 and half hour) and total absence of noise due to their digital nature.

I remember a friend of mine who encoded (log time ago) Monsters Inc., in DivX 5, at full resolution (and without cropping, as this was one of his first encode and he didn't know how to crop...), in one pass at fixed bitrate, and the result was still watchable!

For the matrices thing, all you have to do is select "MPEG-Custom", just below H.263 and MPEG in the Quantization Type dialog, then hit the Edit Matrix... button and load a matrix (you can try with the matrices already included in XviD package)

AsTimeGoesBy
26th November 2004, 21:11
Thanks for replying on the filename trouble.

Originally posted by Ark
...
For the matrices thing, all you have to do is select "MPEG-Custom", just below H.263 and MPEG in the Quantization Type dialog, then hit the Edit Matrix... button and load a matrix (you can try with the matrices already included in XviD package)

Ah i see. I also have found a pages about the 'Jawor matrix' you have mentioned:
http://forum.doom9.org/showthread.php?s=&threadid=74463&perpage=20&pagenumber=3


I will try once this 1-CD-matrix, for the beginning i'm more interested in something like a 2-CD- or 3-CD-matrix to be able to compare the new Xvid encodings to my existing DivX files.

Actually i'm using Xvid v1.0.2-29082004. Is there any 'established' (proven and better as the default) matrix for about 2Mbit/s ?
What about those HVS-matrices...?

Ark
26th November 2004, 23:07
Well, the 3 HVS matrices (Good-Better-Best), are very nice, they are designed in order to give the "impression" of more detail without hurt compressibility to much.

HVS-Good is "good" :) for 1-cd encodes
HVS-Better still for 1-2 cd's
HVS-Best is from 2 cd's

I can tell you better on a matrix well suited for 2 mbits if you specify your 1)source lenght, 2)resolution, 3)Avisynth script/filtering used (if present).

I can suggest you to try sixofnine or EQM_v3HR (just do a search) at Q2-3...

AsTimeGoesBy
27th November 2004, 03:35
Thanks, i rip some of my DVDs and make some vob-samples to test these matrices with.

Originally posted by Ark
...
I can tell you better on a matrix well suited for 2 mbits if you specify your 1)source lenght, 2)resolution, 3)Avisynth script/filtering used (if present).

1) 90-150 minutes (How far is that important for the matrices?)*

2) Mostly 720x320 or 720x408, at 25fps*

3) I'm only using simple VirtualDubMod. Filters i use generally none, in rare cases i use DivX's 'Light Pre-Processing' or 2D-cleaner or a complicate box-blur-procedure.
Of course all my encoding are initially cropped slightly and at the end resized on 720x### with 'precise bicubic (-0.75)'.

(*: Not to let you make calculations for nothing, the final size of my encodings doesn't really matter. My 'target-quality' is anywhere between 0.25 and 0.35 bits/pixel strongly depending on the content of the film.)


Originally posted by Ark
I can suggest you to try sixofnine or EQM_v3HR (just do a search) at Q2-3...
What means 'at Q2-3'? - I can't remember such a seeting in the Xvid dialogue.

Ark
27th November 2004, 09:45
1)It's important for evaluate the movie compressibility-ratio "range", because many matrices are aimed at certain resolution/bitrate situations. Remember that bitrate alone means absolutely nothing (as said many times before), so for a 2 hour movie at 720x576, 2 mbits is far too low (without filtering), but for a 640x272, 1 hour movie it is quite high (given the same compressibility of the source...).

...mmmh, so it's 720x320 at 2 mbits... it's not much bitrate, expecially if you don't denoise in any way...

I strongly suggest you to start using Avisynth, as it can dramatically increase quality of your encodes:

- You avoid colorspace conversion (with VDub filters you have to do YV12 > RGB > YV12, which is lossy and slow down encoding speed)
- It has maaaaaany more filters (expecially denoising ones)
- With a little pratice you'll find that is very simple to use

With "Q2-3" i mean quantizer 2 - 3. You can do this doing a single pass encode at fixed quantizer, or setting it in the "zone" settings.

Start with something light such as:

Mpeg2source("your_movie.d2v")
crop(0,80,720,544) #i assumed a 2.35:1 source
bicubicresize(720,320,0,0.5)
temporalsoften(2,2,4,15,2)
undot()

This will increase compressibility quite a bit, try encode 5 minutes with your old method and with this script(with same settings), compare the results...

AsTimeGoesBy
27th November 2004, 18:53
Originally posted by Ark

I strongly suggest you to start using Avisynth, as it can dramatically increase quality of your encodes:

- You avoid colorspace conversion (with VDub filters you have to do YV12 > RGB > YV12, which is lossy and slow down encoding speed)
- It has maaaaaany more filters (expecially denoising ones)
- With a little pratice you'll find that is very simple to use

With "Q2-3" i mean quantizer 2 - 3. You can do this doing a single pass encode at fixed quantizer, or setting it in the "zone" settings.

This 'YV12 > RGB > YV12' transformation doesn't sound good...

About Xvid, indeed the quantizier setting is below the 'weight' slider of the in the zone options.
I'm not so familar with quantisizers, no idea how do why work, in loarhythmic or exponential relation?
Or are they simply inversed-linear, so a quatizier of 7 will spend twice as much bits for a scene as the quantisizer of 14 would do?


Originally posted by Ark

Start with something light such as:

Mpeg2source("your_movie.d2v")
crop(0,80,720,544) #i assumed a 2.35:1 source
bicubicresize(720,320,0,0.5)
temporalsoften(2,2,4,15,2)
undot()


Well, i had no luck opening one of my *.m2v or *.vob files. Also the command DirectShowSource() (of the AviSynth guide (http://www.avisynth.org/index.php?page=YourFirstScript)) didn't work. However, i was able to open a 'normal' AVI file successfully.

Maybe i need any additional DLL of that AviSynth plugin list (http://www.avisynth.org/warpenterprises/)...!?

_____
Edit:
I guess i must spend some time in the AviSynth Thread (http://forum.doom9.org/forumdisplay.php?s=&forumid=33)... ;)

SeeMoreDigital
28th November 2004, 00:58
Originally posted by Ark
Remember that bitrate alone means absolutely nothing (as said many times before), so for a 2 hour movie at 720x576, 2 mbits is far too low (without filtering), but for a 640x272, 1 hour movie it is quite high (given the same compressibility of the source...). I would not say that at all...

Depending on the source, a 2 hour encode at 720x576 can be generated at a lot less than 2Mbps... as long at it's been done using a minimum of two passes!


Cheers

Soulhunter
28th November 2004, 06:59
Originally posted by AsTimeGoesBy

I'm not so familar with quantisizers, no idea how do why work, in loarhythmic or exponential relation?
Or are they simply inversed-linear, so a quatizier of 7 will spend twice as much bits for a scene as the quantisizer of 14 would do?


Hey, I'm not familiar with terms like exponential !!!

But this inversed-linear thing should be right... :D


Originally posted by AsTimeGoesBy

Well, i had no luck opening one of my *.m2v or *.vob files...

You have to make a DVD2AVI project from the vob !!!

Thats this "your_movie.d2v" file in your script... ;)


Bye

AsTimeGoesBy
29th November 2004, 05:25
Originally posted by SeeMoreDigital

... as long at it's been done using a minimum of two passes!

'...minimum of two passes'? - Hmm, so where is the maximum please?
Does this mean, Xvid supports multi-pass encoding (and really gets quality benefits from 3 or more passes)?

That would be new to me... - However i have made a search, but all about 'multi-pass' and 'xvid' stays unclear like in:
http://forum.doom9.org/showthread.php?s=&threadid=69130&highlight=multipass+AND+xvid

Ark
29th November 2004, 15:01
Originally posted by SeeMoreDigital
I would not say that at all...

Depending on the source, a 2 hour encode at 720x576 can be generated at a lot less than 2Mbps... as long at it's been done using a minimum of two passes!


Cheers

Well, i was referring to the same source, so (IMHO) if a source is encoded with good quality at 640x272 at, say 1Mbps, the same result is difficult to achieve without any resizing/filtering and only double of bitrate!

However, there are incredibly compressible movies like 2001 a Space Odissey that are long but clean and with low motion and a lot of "bitrate saving" scenes...

AsTimeGoesBy
29th November 2004, 22:32
For me and all the others Xvid newbies...:

Originally posted by AsTimeGoesBy
...
Does this mean, Xvid supports multi-pass encoding (and really gets quality benefits from 3 or more passes)?
...

Originally mentioned in Crusty's FAQ (http://ronald.vslcatena.nl/docs/xvidfaq.html)
Note that DivX 5 nowadays has a 'multi-pass' option, allowing for more than two-passes. This is meant to tweak the bit-distribution even more (sort of by averaging between a large number of passes), but many users report nearly zero benefit after the third pass. XviD really doesn't need a technique like this because the bit-distribution-decision it makes is more intelligent and produces better results.
Sometimes people should go one step further to know they are on the right way. ;)