Comparing final encode quality

If you have questions about compression/encoding/converting look here.
trythil
is
Joined: Tue Jul 23, 2002 5:54 am
Status: N͋̀͒̆ͣ͋ͤ̍ͮ͌ͭ̔̊͒ͧ̿
Location: N????????????????
Org Profile

Post by trythil » Fri Mar 02, 2007 6:23 pm

Kariudo wrote:about the best thing I can think of is make an avisynth script to load the mp4s (directshowsource) and load those into avsp.

you can't really play them back side by side
Not true. See StackHorizontal and StackVertical.

User avatar
BasharOfTheAges
Just zis guy, you know?
Joined: Tue Sep 14, 2004 11:32 pm
Status: Breathing
Location: Merrimack, NH
Org Profile

Post by BasharOfTheAges » Fri Mar 02, 2007 6:31 pm

Holy shit! That was amazingly detailed. Thanks a ton Zero1. I'm going to set several test encodes up now and let them run for a few hours and see how i feel about the results.

User avatar
BasharOfTheAges
Just zis guy, you know?
Joined: Tue Sep 14, 2004 11:32 pm
Status: Breathing
Location: Merrimack, NH
Org Profile

Post by BasharOfTheAges » Fri Mar 02, 2007 11:20 pm

I modified a little comparison i found on doom9... it crashes Vdub on startup though :(

Code: Select all

clip1 = AVIsource("E:\Bleach VOBs\Project Squick--default.avs")
clip2 = DirectShowSource("C:\Documents and Settings\Administrator\Desktop\ProjectSquick compressed 

exports\Project Squick BETA 4 (45MB).mp4", audio=false)
clip3 = DirectShowSource("C:\Documents and Settings\Administrator\Desktop\ProjectSquick compressed 

exports\Project Squick Final EncodeTest 1.mp4", audio=false)

clip5 = SUBTRACT(clip1, clip2).LEVELS(107,1,149,0,255)
clip6 = SUBTRACT(clip1, clip3).LEVELS(107,1,149,0,255)
clip7 = SUBTRACT(clip2, clip3).LEVELS(107,1,149,0,255)

desc_clip1 = "Uncompressed"
desc_clip2 = "TargetSize"
desc_clip3 = "ComplexEncode"
desc_clip5 = "Difference Uncompressed - Target"
desc_clip6 = "Difference Uncompressed - Complex"
desc_clip7 = "Difference Target - Complex"

vertclip1 = STACKVERTICAL(clip1.SUBTITLE(desc_clip1), clip5.SUBTITLE(desc_clip5))
vertclip2 = STACKVERTICAL(clip6.SUBTITLE(desc_clip6), clip7.SUBTITLE(desc_clip7))

STACKHORIZONTAL(vertclip1,vertclip2)
Any idea why i may be experiencing a crash? i tried setmemorymax() values of 32 and 16 and there was no difference in the result so i took it out.

I seem really clueless right now, don't i?

User avatar
Zero1
Joined: Fri Jan 02, 2004 12:51 pm
Location: Sheffield, United Kingdom
Contact:
Org Profile

Post by Zero1 » Sat Mar 03, 2007 10:58 am

You don't really need to mess around with AVISynth, as long as the final encode averages at Q18 give or take, it will look fine. Now that I have explained and given examples of what settings to change and improve (or simply follow the screenshots), I'd change those settings to what they are in the screenshots (or better, eg 16 reference frames if you want), and then do the Q18 encode. Since all the frames are stored at the same quantizer, you won't get blocking or that blurred effect. If the filesize is still too large, then try for Q19, and gradually work down until you get to a more reasonable filesize.

Currently you are working blind, you are altering the filesize to find a quality that suits you, and it's hard to know how much space a video will take to be a certain quality. The way I suggest is encoding the video at Q18 to begin with. You know the quality will be awesome, but you don't know the filesize until the encode is finished. If it's still too big, then do an encode at Q19 and so on until you reach a reasonable filesize (I'd say stay between Q18-20). This way you are decreasing the quality in steps rather than guessing at numbers which can have a little or huge difference in quality.

Judging by the encode you sent me, I see no reason why a Q18 shouldn't reach 55Mb or better with those settings.

The Q18 that was 154MB would have been mainly due to no B-frames and pretty lax settings. Also encoding to this known quality level only requires one pass so it's actually higher quality (no blocking/blurring at good quantizers) and faster than just guessing at the correct bitrate. It also eliminates the problems on the complex areas where the quantizers went as high as Q30; they will all be encoded at the same quality so everything will be nice and consistant.

The mode you need in MeGUI (where you normally enter bitrate) is Const. Quantizer, and set it to 18, run and encode and see how big that turns out. If you have no joy trying Q18, Q19 and Q20, then as a last resort change the mode to Const. Quality (this mode is actually badly termed, it's the CRF mode and is more like a nominal quantizer) and try 18-20 there. Const. Quality or CRF tends to have fairly smaller files than Const. Quantizer because they fluctuate (and so not true constant quality), but it tends to be a nice tradeoff between filesize and the Const. Quantizer mode. Preferably use Const. Quantizer first.

User avatar
Zero1
Joined: Fri Jan 02, 2004 12:51 pm
Location: Sheffield, United Kingdom
Contact:
Org Profile

Post by Zero1 » Sat Mar 03, 2007 11:01 am

I'm sure I don't need to post this but I will do just in case. This is where you choose const. quantizer.

Image

User avatar
BasharOfTheAges
Just zis guy, you know?
Joined: Tue Sep 14, 2004 11:32 pm
Status: Breathing
Location: Merrimack, NH
Org Profile

Post by BasharOfTheAges » Sat Mar 03, 2007 11:18 am

Right. I completely understand your previous posts and have done a few encodes at different qualities using your method. I just still want to compare them to one another for my own benefit - I started on an idea path and i want to follow through, even though i have a different metric to measure against than size. I feel it may be nice to compare 2 or video encodes to each other and to the uncompressed version no matter what the method that produced them was - especially since the first settings i tried ended up not looking much different in a few parts as the first settings you suggested (i.e. i'm having problem with significant blocking on the the black background near the beginning) so it would be nice to have a simple script like the one i posted above to actually compare the quality amongst any of the encodes i make to see for myself the result of a changed value here or there.

User avatar
BasharOfTheAges
Just zis guy, you know?
Joined: Tue Sep 14, 2004 11:32 pm
Status: Breathing
Location: Merrimack, NH
Org Profile

Post by BasharOfTheAges » Mon Mar 05, 2007 9:15 am

I'm still looking for the fatal flaw in that script. Anyone?

Locked

Return to “Conversion / Encoding Help”