Log in

View Full Version : Hellsing undersized files


Nemesis7
9th September 2003, 23:42
Hey guys,

I have been trying to encode The Hellsing series (Region 1 DVD), the picture quality is superb (so I dont use any denoise or smoothening filters) and I IVTC them using TMPGEnc (works like a charm).
I encode them like this:

Episode 2 for example


Resolution: 640x480
Audio: Dual OGG @ 96kbps (~25 MB)
Container: OGM
+subs

3 episodes a CD (XCD that is)


which gets me about 265 MB per (20 minute) episode (but I removed the intro and outro and encoded them seperately, so I need them only once) So that leaves me about 211 MB per (20 min) episode VIDEO ONLY.

But when I encode episode 2 (other ones too) I get a size of 146 MB! That's 65 MB too small.

XviD settings:

6-Ultra Precision
MPEG
XVID
1 - Mode Decision
300
1
Use Chroma Motion
No BFrames (-1)


So can any1 help me out?

Btw when I try to encode at quant 1 its way oversized(duh), so cant I 'tell' xvid to use more quant=1 ?

Thnx,

Neme.

Nemesis7
10th September 2003, 01:07
Hmm, I might have the solution.
Encode at Constant Bitrate without Bframes, that hits the target exactly. Still open for ideas/suggestions though.

Thnx.

Asmodian
10th September 2003, 01:25
What is wrong with it being too small? encoding with more quant 1s would not make the video look better, just harder to play (kbps increased) and larger. The way I would get a bigger and better encode is to use higher quality audio, why try to give bits to the video and save bits on the audio when they will help if given to the audio but not the video.

If your video does have problems (like blocking in dark areas) you could try adding a small amount of noise (there was a filter for this, but I forgot what it was called – shouldn’t be too hard to find). A small amount of noise helps xvid not over-compress dark areas because it thinks there isn't any important information there.

If you really like the audio and can't see why one would want higher quality audio (higher quality audio won't get all the extra bits used anyway) you could try a sharper resize (if you aren't already using lanczos) like lanczos.

You should just setup the first pass with discard first pass unchecked and not do a second pass unless the first pass is oversized (the first pass just makes a constant quant 2 encode and writes the stat file, which you want incase the first pass if oversized). A constant bit-rate encode will use quant 1 (I guess - since it was larger then the 2pass file) which really is pointless. Of course you don’t want to use B-frames as they don’t help quality unless your first pass is over the target size (and then their benefits, even then, are debatable when encoding high bit-rate anime). Make sure the minimum quants are set to 2 (not higher – and I really don’t think quant 1 is at all useful, but maybe you should do a comparison to see for yourself).

ps. If you have the time VHQ=4 is nice :)

Nemesis7
10th September 2003, 02:11
Thnx for the reply.

Well using noise will only make the overall picture noisier, right? And the source is pretty clean already, so I think I wanna keep it like that.
And using a higher bitrate for audio is kinda useless for me since I really dont hear the diffrence (tested it)(my ears are ok for the record );)

And VHQ=4, isn't that just for better compression results? Or does it increase picture quality as well?

Well the Constant Bitrate is working nicely for now.

Neme.

Asmodian
10th September 2003, 05:41
Does it look better with constant bit-rate?

I only suggested you try VHQ=4 if you let it run overnight and it finishes before you get up. I have heard that it does add some to image quality but I should probably do a comparison as I am not sure what the improvement is.

The point of adding noise isn't to make the picture nosier, it is to 'trick' xvid into compressing dark areas less to avoid the blocking problem in dark areas. The amount of noise added is almost undetectable after the encode but it helps reduce blocking and increases the size of the video. If you want to make your video larger you should do so with a technique that increases quality rather then just wastes bits.

frodoontop
10th September 2003, 08:01
Put the files on a normal CD then. XCD is only if you need the extra space. It's got a big disadvantage IMHO that you can get errors in the picture quality.

If you insist on getting a higher resulting filesize you could also adjust the MPEG matrix in a custom matrix. Run a search to find other matrixes.

mf
10th September 2003, 09:57
Heh. You want bigger size? I'll give you bigger size.
Instead of LanczosResize, get mfToon and its needed DLLs (http://mf.creations.nl/avs/). It'll auto-resize to 640x480 for you, darken lines if need be, and sharpen it to look very nice. If you encounter artifacts and you find that lines don't need to be darkened very much, try reducing the strength parameter (default strength is 255). This should pump up the size of your vid pretty much.

sysKin
10th September 2003, 12:49
The best way to increase filesize/quality is to use high-bitrate quantizer matrix. With it, you might even want b-frames again - especially with XCD, because b-frames make the stream more error resistant.

Radek

mf
10th September 2003, 13:01
Originally posted by sysKin
The best way to increase filesize/quality is to use high-bitrate quantizer matrix. With it, you might even want b-frames again - especially with XCD, because b-frames make the stream more error resistant.

Radek
Anime usually doesn't have enough detail to benefit from an MPEG-type quantizer. If the input is sharp enough (mfToon or SSXSharpen), there is also no visible sharpness gain. H.263 usually is the best, cause at high bitrates you can have almost no ringing with it (almost invisible ringing without postprocessing, amd NO ringing at all with postprocessing on).
Oh and another tip, if you still have undersizes with mfToon-v0.4, try mfToon-v0.4-768 (http://mf.creations.nl/avs/functions/mfToon-v0.4-768.avs). It'll resize your video to 768x576, and boy does it look nice :) :).

sysKin
10th September 2003, 14:24
Originally posted by mf
Anime usually doesn't have enough detail to benefit from an MPEG-type quantizer.Default MPEG matrix might be sharp, but it doesn't mean that the custom matrix is also sharp. Just enter the same value to all fields and you have an eqivalent of h263 quantization. Enter small numbers, and you have high-bitrate h263-like quantization :)

If I remember correctly, "professional" quant matrix was giving smoother results than h263 (at 'regular' bitrate). You might like it for high bitrates like here.

mf
10th September 2003, 14:51
Originally posted by sysKin
Just enter the same value to all fields and you have an eqivalent of h263 quantization. Enter small numbers, and you have high-bitrate h263-like quantization :)
AH! I did know that H.263 was doing an equal scale-thing to all coefficients, but I actually thought it worked slightly different. You've just given me inspiration for a new "Animatrix"! :) I'll talk it over on IRC.

ProfDrMorph
10th September 2003, 16:13
Nemesis7, are you using capped quants? You could try setting all quant limits to 1(min)-31(max).

Aside from that I suggest that you shouldn't use XCD if your rips are undersized but still look fine. ;)

mf
10th September 2003, 18:59
Originally posted by ProfDrMorph
Nemesis7, are you using capped quants? You could try setting all quant limits to 1(min)-31(max).
Min quant 2 is pretty much hardcoded, so quant 1 will only work in your disadvantage.

Nemesis7
10th September 2003, 23:09
Thnx for all ur replies,

I will do some more testing with your settings.

@Asmodian:
What addnoise filters do u suggest?

@frodoontop & sysKin
What kinda matrix should I use? Because I tried the avalable matrices (XviD_Quant_Matrices availabe on the forum) and they didnt provide better results.
So u guys have any custom ones which use more bitrate than MPEG?

@ProfDrMorph
I always use XCD, I just love it. :) And I use ogg+ogm and usually xvid, so that gives me some extra protection.
And why should I set the quant to 1-31? It will only make pic look worse than 1-2.

@mf
Min quant 2 is pretty much hardcoded, so quant 1 will only work in your disadvantage.
How come? The video is already undersized with quants at 1-2. What do u exactly mean by hardcoded?
Ooh yea, I'm gunna try MFToon, but I dont want to change the picture, coz the quality is already great as it is, but I will give it a shot.

And I already encoded the first 3 eps with CBR @ 1480kbps and it hit the filesize exactly (no bframes of course). I will run more test later on, now I gotta go sleep, little examn tomorrow. :)

Peace.

Selur
11th September 2003, 08:34
"What do u exactly mean by hardcoded?"
Like koepi posted some time before: in 2 pass encoding quant 1 will not be used.

Personally I prefer a custom mpeg matrix againt undersized files. ;)
(you can find a bunch of them by using the forum search)

Cu Selur

Ps.: Got a little question myself: Does anyone have an idea why my custom matrices get 'broken' (turn unusable) if I mail them to a friend of mine and I didn't zip/rar them before sending? (never had a problem that mailing a fiel kind of breaks it)

mf
11th September 2003, 09:21
Originally posted by Nemesis7
Ooh yea, I'm gunna try MFToon, but I dont want to change the picture, coz the quality is already great as it is, but I will give it a shot.
Well, take a look at this (http://mf.onthanet.nl/linedarkening/practice-5.png) and this (http://mf.onthanet.nl/linedarkening/practice-4.png). As you can see, the quality is already very good, but mfToon is only enhancing it more :). (Left picture is processed, right is original)

Shalcker
11th September 2003, 14:47
I also encoded Hellsing and had to resort to quant 1 too... since i aimed at even higher bitrate.

For a quick comparison now i encoded opening of "Hellsing" with all-8 custom matrix at constant quant 2 and with H263 matrix at constant quant 1 (720x480, 1900 frames total).

Results are (Chroma Motion, everything else at default settings):

All8 q2 VHQ0 PSNR 51.7976, Filesize 98725888 bytes
All8 q2 VHQ4 PSNR 51.9305, Filesize 87339008 bytes
H263 q1 VHQ0 PSNR 52.1189, Filesize 84613120 bytes
H263 q1 VHQ4 PSNR 52.2094, Filesize 85864448 bytes


I also compared them frame-by-frame and with exception of a few frames (mostly those containing "static noise"-like picture) local PSNR was in the same order as average.

H263 at quant 1 has both higher psnr and lower filesize, so it's obviously better in this case.

It looks better too. There is a lot of color gradients there and a lot of red too, so you can notice certain flaws in image at quant 2 while they are perfectly smooth at quant 1. Maybe there is a bit better DC precision for H263 at quant 1 which outweights somewhat better preservation of higher frequencies for All-8 matrix.

Also, FFDShow has problems with Custom matrices having top-left values for P-Frames below 16 - and it has no visible problems with quant 1 (All8 clips failed to play properly with FFDShow (enormous smearing everywhere) while H263 quant 1 played perfectly).

Nemesis7
12th September 2003, 00:01
Wow Schalker, that actually helped a lot! I mean the picture is way better. Did u encoded it with b frames (if so what settings) or with CBR ?

Shalcker
12th September 2003, 04:21
Originally posted by Nemesis7
Wow Shalcker, that actually helped a lot! I mean the picture is way better. Did u encoded it with b frames (if so what settings) or with CBR ?
In actual encoding i used H263 CBR with quantizers capped to I:1/1 P:1/3, Chroma motion, VHQ0, Maximum I-Frame interval 50, no B-Frames.

It's interesting to note that Maximum I-Frame interval 50 increased PSNR by 0.0245 in opening test (H263 VHQ0) compared to default I-Frame distance of 300 while only increasing final filesize by 112kb (out of 84MB). And it managed to get infinite local PSNR at pitch-black image at the end too :)

I repeated opening test with H263 constant quant 1 and 2 consecutive B-Frames at quant 2 (PSNR 49.8906, Filesize 50552832) and, just in case, with 2 consecutive B-Frames at quant 1 (PSNR 51.3082, Filesize 85544960).