Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > MPEG-4 ASP

Reply
 
Thread Tools Display Modes
Old 24th May 2004, 16:38   #1  |  Link
Brazil
Registered User
 
Join Date: Jun 2003
Posts: 28
Divx 5.11 V Xvid 1

Hello all,

I've been encoding with Divx for the past few years and now that Xvid 1 has been released I decided to give it a go. I encode my films for the greatest quality regardless of size so I do always do a 1 pass quality pass in Divx. I use GKnot to create an AviSynth Script file and then use VDubMod to encode with.

I wanted to see the difference in quality between a DivX rip and an Xvid rip of the same film using similar settings for each codec. This is what I found and have a couple of questions regarding the results.

DivX 5.11 (free codec)
LanczosResize
1 Pass quality based. Quantizer = 2
No Psychovisual Enhancements

The file output size was 1,615 MB
The bitrate was 1993 kb/s
Qf = 0.487 bits/pixel

Xvid 1
LanczosResize
Profile @ Level = AS @ L5
Quantization type = Mpeg
B-Vops on as codec default
Packed Bitsteam on and Closed GOV on
Target Quantizer = 2
Motion search precision = 6 Ultra High
VHQ Mode = 1 Mode decision
Use Chroma Detection on
Everything else as default.

The file output size was 1,061 MB
The bitrate was 1264 kb/s
Qf = 0.309 bits/pixel

Basically I could not really see any difference between the two encodes, although I am sure there are differences at some point.

My question is that there is over half a Gig difference between the file sizes and about 600 kb/s difference in the bitrate. Is it therefore the case that Xvid is more capable of compressing a file and able to use a smaller bitrate than DivX to achieve similar looking results?

Also this is my first time using Xvid so are the settings that I have used sensible in order to achieve "the best quality" looking rip (without going under Q2)? Or is the fact that the bitrate of the Xvid rip being far lower than the DivX rip indicative that I have not achieved "the highest possible quality?"

Finally as an observation, My Xvid rip playback was stuttering until I uninstalled FFDshow. The FFDshow was the version in the latest GKnot installation package. I assume therefore that this version FFDshow is not the latest version.

Thanks for any responses,
Ben.
Brazil is offline   Reply With Quote
Old 24th May 2004, 16:47   #2  |  Link
Teegedeck
Moderator, Ex(viD)-Mascot
 
Teegedeck's Avatar
 
Join Date: Oct 2001
Posts: 2,564
Welcome to our little place here, Ben!

I'm afraid if you wanted to compare quality you'd better have used two pass to encode to the same filesize with XviD and DivX.

But if you are content with XviD's result and save a good deal of space, then it's probably fine! And yes, 'better compression without visible quality-loss' can usually be translated into 'same filesize but better quality'. In this case, you could for example use a high-bitrate custom-matrix and get better quality than DivX at about the same filesize.
__________________
It's a man's life in Doom9's 52nd MPEG division.
"The cat sat on the mat."
ATM I'm thoroughly enjoying the Banshee - a fantastic music player/ripper for Linux. Give it a whirl!
Teegedeck is offline   Reply With Quote
Old 24th May 2004, 17:09   #3  |  Link
Sagittaire
Testeur de codecs
 
Sagittaire's Avatar
 
Join Date: May 2003
Location: France
Posts: 2,065
Use slowest and bframe for DivX 5.1.1 but XviD is slightly better and especially much faster.

But the profiles of Hardware encoding are not active function with XviD I believe.

XviD is the best MPEG4 ASP codeur for me, a slightly better than DivX 5.1.1, really better than ND MPEG4 or 3ivX.
__________________
Le Sagittaire ... ;-)

1- Ateme AVC or x264
2- VP7 or RV10 only for anime
3- XviD, DivX or WMV9

Last edited by Sagittaire; 24th May 2004 at 17:12.
Sagittaire is offline   Reply With Quote
Old 24th May 2004, 17:14   #4  |  Link
Brazil
Registered User
 
Join Date: Jun 2003
Posts: 28
Hi Teegedeck

That was a quick reply!

Are you saying then from the Xvid settings I have used I could have achieved a better looking rip?

From what I know about DivX, to achieve the best possible rip, a 1 pass quality based encode will give the rip as high a bitrate as it needs, therefore producing the best quality it is able to achieve. Is this not what happens with Xvid when you do a 1 pass encode with a quantizer of 2, not counting a quantizer of 1 as I have been led to believe that this would be going a bit too far?

Its not really that I was after a side by side comparison of Xvid against DivX, I just wanted to see the best of what each could do and then have a little comparison. I see what you mean though for it to be a fair comparison it should be done against files of the same size.

Also could you point me in the right direction to find information about using a high-bitrate custom-matrix. So using this will improve the quality of the Xvid rips? (Not that I could see how it could visually have been much better.) This sounds quite involved.

Thanks again,
Ben.
Brazil is offline   Reply With Quote
Old 24th May 2004, 17:47   #5  |  Link
Tommy Carrot
Registered User
 
Tommy Carrot's Avatar
 
Join Date: Mar 2002
Posts: 747
Re: Divx 5.11 V Xvid 1

Quote:
Originally posted by Brazil

My question is that there is over half a Gig difference between the file sizes and about 600 kb/s difference in the bitrate. Is it therefore the case that Xvid is more capable of compressing a file and able to use a smaller bitrate than DivX to achieve similar looking results?
I think the b-frames are the reason of the bitrate difference. B-frames are there for saving bitrate, but they are also decreasing the quality a bit. If you want to get max quality, do not use b-frames.
Tommy Carrot is offline   Reply With Quote
Old 24th May 2004, 18:39   #6  |  Link
tedgo
Registered User
 
Join Date: Apr 2004
Location: Germany
Posts: 112
I think the difference between the filesizes caused by the b-frame-settings.
Divx only uses 1 "consecutive b-frame" whereas xvid's default settings uses 2 "consecutive b-frames".
You also should set xvid to 1 consecutive b-frame, if you wants to compare it with divx. But if there is no visible difference between them with default settings, there is no really need to

Btw. The version of ffdshow used in gknot seems to have problems with more than 1 consecutive b-vop and activated packed bitstream. This may cause the stuttering playback of the xvid-file.
Try a newer version of ffdshow

Last edited by tedgo; 24th May 2004 at 18:49.
tedgo is offline   Reply With Quote
Old 24th May 2004, 20:11   #7  |  Link
Teegedeck
Moderator, Ex(viD)-Mascot
 
Teegedeck's Avatar
 
Join Date: Oct 2001
Posts: 2,564
Re: Re: Divx 5.11 V Xvid 1

Quote:
Originally posted by Tommy Carrot
I think the b-frames are the reason of the bitrate difference. B-frames are there for saving bitrate, but they are also decreasing the quality a bit. If you want to get max quality, do not use b-frames.
That's a poorly founded belief IMHO.

Especially when dealing with restricted filesizes I would strongly advise to use B-frames.
__________________
It's a man's life in Doom9's 52nd MPEG division.
"The cat sat on the mat."
ATM I'm thoroughly enjoying the Banshee - a fantastic music player/ripper for Linux. Give it a whirl!
Teegedeck is offline   Reply With Quote
Old 24th May 2004, 22:13   #8  |  Link
Tommy Carrot
Registered User
 
Tommy Carrot's Avatar
 
Join Date: Mar 2002
Posts: 747
Re: Re: Re: Divx 5.11 V Xvid 1

Quote:
Originally posted by Teegedeck
That's a poorly founded belief IMHO.

Especially when dealing with restricted filesizes I would strongly advise to use B-frames.
We wont disagree about this, but i'm talking about the max reachable quality, and since the b-frames are more quantized, they can just hurt the quality, even if minimally. For general use, they are obviously very useful.
Tommy Carrot is offline   Reply With Quote
Old 24th May 2004, 23:19   #9  |  Link
Pen-Pen
Misato's Penguin
 
Pen-Pen's Avatar
 
Join Date: Jul 2002
Location: Tokyo-3
Posts: 110
If you want to be even more amazed of XViD's power, go for VHQ-4

And I agree with tedgo : compare what's comparable... set the same B-VOPS settings for both codecs

anyway, I'm pretty sure of the result ^^

EDIT : as for the quant matrices, if you want to achieve high quality, give hvs-best a try (that's one matrix, there are lots of others, and surely as many threads about them in this forum ) I personaly *HATE* MPEG matrix, since it introduces *heavy* (and ugly for my sweet eyes) "mosquito noise"

Last edited by Pen-Pen; 24th May 2004 at 23:22.
Pen-Pen is offline   Reply With Quote
Old 25th May 2004, 00:42   #10  |  Link
tripnotik
Registered User
 
Join Date: Mar 2002
Location: Québec, Canada
Posts: 47
Re: Re: Re: Re: Divx 5.11 V Xvid 1

Quote:
Originally posted by Tommy Carrot
We wont disagree about this, but i'm talking about the max reachable quality, and since the b-frames are more quantized, they can just hurt the quality, even if minimally. For general use, they are obviously very useful.
B-frames are more quantized only if you want to. Just set the ratio to 1 and the offset to 0 and you will get b-frames that are the same quality as p-frames.
tripnotik is offline   Reply With Quote
Old 25th May 2004, 01:13   #11  |  Link
Manao
Registered User
 
Join Date: Jan 2002
Location: France
Posts: 2,760
tripnotik : have a look here

B-frames will have a lower objective quality ( meaning PSNR ) than p-frames, even at quant 2.
Manao is offline   Reply With Quote
Old 25th May 2004, 01:19   #12  |  Link
Tommy Carrot
Registered User
 
Tommy Carrot's Avatar
 
Join Date: Mar 2002
Posts: 747
Re: Re: Re: Re: Re: Divx 5.11 V Xvid 1

Quote:
Originally posted by tripnotik
B-frames are more quantized only if you want to. Just set the ratio to 1 and the offset to 0 and you will get b-frames that are the same quality as p-frames.
But doing that doesn't make too much sense, cuz the main benefit of the b-frames, the bitrate-saving is not in effect then, in some cases it's even increasing the bitrate.
Tommy Carrot is offline   Reply With Quote
Old 25th May 2004, 02:13   #13  |  Link
Brazil
Registered User
 
Join Date: Jun 2003
Posts: 28
In response to everything that has been covered so far I have a couple of questions.

I'm using Koepi's Xvid build and have the selection of quant matrices to choose from. Mostly the titles of the matrices are self explanatory.

Out of all of these on offer is the hvs-best-picture going to give me the best resutlts? Will there be situations where using such a matrix will not be appropriate and a different matrix would be better suited?

Does the use of a custom matrix slow down encoding and produce a larger file size?

Finally if I use VHQ mode 4 how much longer will it take to do an encode compared to a VHQ mode of 1 and will that increase the file size?

Thanks again,
Ben.
Brazil is offline   Reply With Quote
Old 25th May 2004, 02:26   #14  |  Link
Manao
Registered User
 
Join Date: Jan 2002
Location: France
Posts: 2,760
Quote:
Will there be situations where using such a matrix will not be appropriate and a different matrix would be better suited?
Yes, but at quant 2, you won't notice the difference in such cases.
Quote:
Does the use of a custom matrix slow down encoding
No
Quote:
and produce a larger file size?
It depends of the matrix, and of the movie. Generally, at quant 2, you can expect :

Size(HVS_GOOD) < Size(H263) < Size(HVS_BEST) < Size(MPEG)
Quote:
will vhq4 that increase the file size?
No, it will reduce it. For the slow down, try yourself on a small clip.
Manao is offline   Reply With Quote
Old 25th May 2004, 07:33   #15  |  Link
Pen-Pen
Misato's Penguin
 
Pen-Pen's Avatar
 
Join Date: Jul 2002
Location: Tokyo-3
Posts: 110
Quote:
Originally posted by Manao
Yes, but at quant 2, you won't notice the difference in such cases.
I don't agree... whatever the quant, there IS a noticeable difference...
Pen-Pen is offline   Reply With Quote
Old 25th May 2004, 11:18   #16  |  Link
stephanV
gone
 
Join Date: Apr 2004
Posts: 1,709
I'm not getting any of this...

1. using b-frames with a constant quant encoding is in a way contradicting. B-frames increase compressibility and decrease quality, not in a 1:1 relationship but still. But why increase compressibility if the file size with a quant-based encoding is unpredictable anyway? if you're aiming at a certain filesize: use multipass.

2.
Quote:
If you want to be even more amazed of XViD's power, go for VHQ-4
why? it does only affect compressibility as far as i can understand it and does not improve image quality and on top of that slows down encoding. i could bring up the same argument for the b-frames here but I'm at a loss here... everything i read about VHQ seems contradicting:

Quote:
from Crusty's FAQ:
VHQ is more intensive search and takes a wider approach. Higher settings will slow down encoding significantly. Setting 1 has a relatively small impact and it is recommended for all encodes. Using higher values will give you better quality at the cost of encoding speed.
Quote:
from doom9's XviD guide:
VHQ mode enables an even more accurate motion search. Setting it to more than level 1 usually only cripples speed but won't increase image quality.
then there is this thread where people report a decrease in quality with higher VHQ-modes.

but having read all this I certainly wouldn't use VHQ-4 but only VHQ-1.

3.
Quote:
anyway, I'm pretty sure of the result ^^
that's trolling. unless you can provide me with a *good* test where constant quant encodes are compared with each other, this has no basis at all.
stephanV is offline   Reply With Quote
Old 25th May 2004, 12:12   #17  |  Link
Koepi
Moderator
 
Koepi's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 4,453
At fixed filesize (2nd pass, anyone? ), VHQ4 vs VHQ1 _will_ increase quality.
Koepi is offline   Reply With Quote
Old 25th May 2004, 13:01   #18  |  Link
Nic
Moderator
 
Join Date: Oct 2001
Location: England
Posts: 3,260
@StephanV: I can see why it's confusing. To begin with VHQ wasn't perfect and VHQ=1 did seem to produce better results. But things have changed alot since early last year (as is always the case with XviD )

As a general rule with XviD, always take the most recent information to be the most up to date and accurate. In this case Crusty's FAQ is the most recent.

As you wrote at divx.com;
Quote:
sometimes it seems XviD-people (BTW - i mean users, not developers)try to make DivX look worse than good old MPEG1, not the least influenced by their own misinterpretation of the codec-test at doom9
I hope that's not what you feel is happening here, although a certain amount of bias will probably exist in the XviD Forum as you can imagine. Perhaps people on both forums can make their own encoding comparisons and compare results...

Take Care,
-Nic
Nic is offline   Reply With Quote
Old 25th May 2004, 17:26   #19  |  Link
stephanV
gone
 
Join Date: Apr 2004
Posts: 1,709
My comment belonged in that thread and nowhere else. People there started to make quality comparisons by the file sizes of the XviD/DivX.dll's. This is, as I stated there, not only silly, but they got it wrong as well. Also, to make things clear, my comment was not an attack on the codec-test of doom9 or XviD but on how sometimes the test is used/interpret by some people. I am not biased to either DivX or XviD (or ffvfw, 3ivx, etc. for that matter), but I will not put up with unfair comments (either way). But enough OT-talk now.

What my point was is that B-frames and VHQ are bit rate saving techniques that IMO have no place in quant-based encodings. The bits saved by the B-frames are not beneficially used elsewhere during such an encoding if I'm right. Since B-frames (and perhaps VHQ too, I still don't know*) decrease the quality of that particular frame (be it not always noticable) it is best to avoid them. In any case, doing a fixed quantizer encode at quant 2 and then end up with B-frames at a higher quant is at least a bit weird concept IMO

BTW
Quote:
a certain amount of bias will probably exist in the XviD Forum as you can imagine.
but it is still the XviD-forum right? not the XviD-fan-page

*note that Crusty's FAQ provides a link to the sysKin-thread, which does not prevent any confusion. other than that, the FAQ is quite good i must say
stephanV is offline   Reply With Quote
Old 25th May 2004, 19:25   #20  |  Link
Soulhunter
Leaker!
 
Soulhunter's Avatar
 
Join Date: Apr 2003
Location: Unknown
Posts: 2,773
Re: Re: Re: Re: Re: Re: Divx 5.11 V Xvid 1

Quote:
Originally posted by Tommy Carrot
But doing that doesn't make too much sense, cuz the main benefit of the b-frames, the bitrate-saving is not in effect then, in some cases it's even increasing the bitrate.
Hmm...

Im using Q2 B-VOP's often (without QPel...), but the filesize was always smaller than without them !!!

IIRC Ive also posted some examples for this, but I cant remind where/when this was...


Bye
__________________

For my stuff: My crappy Website (back online) - or - #Videots-United



Last edited by Soulhunter; 25th May 2004 at 19:37.
Soulhunter is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:03.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.