PDA

View Full Version : Need good quality with low bitrates


Holomatrix
14th October 2002, 22:34
Hello All, I've been away from the scene for a while and I'm seeing allot of new filters and resizers about. I was just wondering if I could get some reply's including scripts for getting the best quality with low bitrates converting NTSC DVD to SVCD.(something that will give me a crisp picture, no macroblock and no masquito)
Thanks

serbersan
14th October 2002, 23:29
I think this it's all that all we want.

Try using convolution3D, I thinks it's the more complete filter or at least a very very good filter preserving details and removing noise.

search about it in the forum. Maybe it's the only filter you have to use or at least you couldn't improve your encode using more filter much more.

SansGrip
15th October 2002, 00:38
the best quality with low bitrates converting NTSC DVD to SVCD.

Good luck ;)

I've yet to achieve total absence of macroblocks with SVCD. The bitrate is just too low for the resolution (2500 should be the average, not the maximum, and I think the designers screwed up there. I guess if that's the fastest they could spin it at the time then they must be forgiven).

IMO you get better quality from high bitrate (I use min 500 with padding max 2564 CQ quality 100) "VCDs". You lose some resolution (and theoretically compatibility, though I've yet to find a whitebook-compatible DVD player that can't handle them) of course, but I honestly don't think it makes much of a difference, and would rather see a softer high quality picture than a sharper low quality one.

(Incidentally, the fact that you get better quality at lower resolutions is undeniable if you're talking about how much of the original material gets retained, i.e. the quantization level. The encoder has to throw out more information at higher resolutions, which reduces the quality. No way around that. Perceived quality is where people start to disagree ;))

Another option is MPEG-1 2500 at 352x480 (the resolution is almost indistinguishable from SVCD), but that halves the quality you'll get and you'll notice some over-sharp diagonals. You also might have compatibility problems using non-standard resolutions.

I just discovered my standalone can play PAL VCDs without any problem (I've only done NTSC so far), so I'm considering encoding a few PAL discs to see what difference the 48 extra horizontal lines makes. I'm undecided whether I should use 24 fps or 25 though. The latter would probably work on more players.

The most important encoding variable, in my experience, is TMPGEnc's motion search setting. Normal and below produce major macroblocks. I always use highest quality (though I've read recently that for some sources it can actually be worse than high - don't know if this is true or not), and experiments with the motion estimate setting have given good results. I'd like to know what algorithm it is based on before I use it for anything critical, though.

The problem is that you want the impossible. Sharp picture = higher Q level = more macroblocks. Also, the sharper the picture the more mosquito noise you'll see. That's just the nature of MPEG. There's no way of getting what you're asking for at low bitrates, unfortunately (heck, even DVDs have some mosquito noise). Or if there is a way I wish someone would tell me how ;)

There's a lot you can do with the right combination of filters, though. I usually stick to 24 fps because it gives me more bits per frame in a given second. I also tend to keep the picture a little soft (especially with high-motion sources) because this improves the macroblock problem significantly. With low-motion sources you can get away with a slightly sharper picture, but not much.

(Another tangent: I find most DVDs over-sharp. The blur-followed-by-edge-enhancement they usually apply during transfer may make some people go "wow", but these are generally the same people who prefer fullscreen to letterboxed. I always get superbit versions when I can, since they cut out or move to another disc the extra crap you watch once if at all and thus can ramp up the bitrate. Ask someone who owns a high quality projection TV what they think about artificially sharpened images...)

WRT new filters, one nice thing recently is the addition of LanczosResize to Avisynth. It works about the same as a sharp bicubic but without the ringing. Also take a look at Convolution3D - it can work wonders with compressibility. Temporal smoothing is your friend.

Anyway, hope that helps. Let me know when you come up with some settings you like. I'm always keen to hear how others do it.

SansGrip
15th October 2002, 01:04
It just occurred to me that it's possible to obtain a fairly objective measure of quality with the following extremely complicated formula (henceforth known as SansGrip's Conjecture):

Bits per second / (width * height * fps) = bps per pixel

Using the theoretical maximum bitrate for each format gives us:

NTSC VCD: 1177600 / (352 * 240 * 23.976) = 0.58
NTSC VCD: 1177600 / (352 * 240 * 29.97) = 0.47
PAL VCD: 1177600 / (352 * 288 * 25) = 0.46
NTSC SVCD: 2580480 / (480 * 480 * 23.976) = 0.47
NTSC SVCD: 2580480 / (480 * 480 * 29.97) = 0.37
PAL SVCD: 2580480 / (480 * 576 * 25) = 0.37
NTSC DVD: 8192000 / (720 * 480 * 23.976) = 0.99
NTSC DVD: 8192000 / (720 * 480 * 29.97) = 0.79
PAL DVD: 8192000 / (720 * 576 * 25) = 0.79
My XVCD*: 2625536 / (352 * 240 * 23.976) = 1.30

*MPEG-1 23.976 fps max 2564 kbps at 352x240, 160 kbps joint-stereo layer-II audio

Of course this doesn't account for the quality difference between MPEG-1 and MPEG-2 (for example, I find MPEG-2 I-frames to be much superior, but see little difference in P- and B-frames). Doing so would probably even out the difference between VCD and SVCD.

Based on this I would argue that PAL folks who want highest quality should get a player that can show NTSC discs... (Yes, I'm wearing my flame-proof suit :D)

Of course the subjective quality of each format is another matter entirely. But it's at least some justification for my contention that high bitrate "VCDs" made with decent source material and judicious filtering can produce very good results. Some of my friends think my best encodes are DVDs...

Anyway, I thought it was interesting. YMMV ;)

[Edited to take frame rate into account]

Holomatrix
15th October 2002, 13:25
Thanks for the input. I was reading some good things about LanczosResize + Convolution3D, I think I will try somthing with these. Can you tell me what setting to use with Convolution3D and were to download? Thanks, I will also try SansGrip's XVCD but I always thought going to a smaller resoulution would give more macroblocks when viewing it on the TV due to the streatching of the video, sort of like taking a 40X40 bitmap compared to a 100X100 bitmap and enlarging them on your monitor. The 40X40 is going to look real bad, maybe this is different with VCD and SVCD? please clarify.
Thanks again.

edit: oh yeah, why is it better to use MPEG1 with the lower resolution? I also do mostly CVD's now, so that there is more bitrate to go around.

iago
15th October 2002, 13:32
Originally posted by Holomatrix
Can you tell me what setting to use with Convolution3D and were to download?@Holomatrix

Look at this thread please: http://forum.doom9.org/showthread.php?s=&threadid=35617

regards,
iago

Holomatrix
15th October 2002, 13:36
Thanks, I'll check it out :)

SansGrip
15th October 2002, 15:57
I always thought going to a smaller resoulution would give more macroblocks when viewing it on the TV due to the streatching of the video

That wouldn't give you more macroblocks. Just bigger ones ;)

But the point is that at a lower resolution (for a given bitrate) you get fewer macroblocks, not more. Macroblocks are caused by a lack of bits to describe the picture.

What you might be thinking of are DCT blocks which are sometimes visible in low-light, static areas (such as a blank wall). These are a consequence of MPEG encoding and there's no way to get rid of them (believe me, I've tried). Higher bitrates reduce, but not eliminate, them, and higher resolutions make them less noticable. MPEG-2 seems to suffer less from this problem than MPEG-1, but they're still visible on digital TV and DVDs if you look closely.

sort of like taking a 40X40 bitmap compared to a 100X100 bitmap and enlarging them on your monitor. The 40X40 is going to look real bad, maybe this is different with VCD and SVCD?

If you watch these movies on your monitor in full-screen mode you'll notice a big difference between the two. But a TV isn't a monitor, and the similarity between the two pretty much ends at the large amount of glass and wires. A regular (non-HDTV) television set is analogue, and doesn't really have a "resolution" per se. The best you can say about a TV set is that it *should* display 480 horizontal lines and anywhere from 250 to 500 vertical "lines" depending on the quality of the set.

When you play a disc in your standalone box it's converted to an analogue signal. It's this analogue signal that gets sent to the TV, which samples it into an image to display on the tube. The analogue signal has no "resolution", just a frequency and period and all that stuff I didn't pay attention to in my physics classes, along with a guarantee that there's enough information to fill up 480 horizontal lines (along with some extra for syncing and stuff).

This process alone is enough to introduce some softness - not to say randomness - into the image (you're going from separate numbers for each pixel representing brightness and colour to a wave that represents the whole thing, which is kinda spooky if you think about it too long), and then you have the fact that TVs are generally much larger than a monitor, and so the picture is more "spread out". This softens again. Finally, a TV has lower contrast and higher brightness than a monitor; it isn't designed to be sharp and crisp. This is the reason most DVDs are oversharpened when they're authored.

All this taken together, along with the fact that you don't sit about a foot away from your TV if you have any sense, and probably some other stuff I've forgotten, adds up to the scenario where you can take a 352x240 image, which looks stupidly small on a monitor, and fill up a 52" screen and it looks pretty damn good (depending on the quality of the source and encoding, of course).

The best thing to do is try it. Do an encoding (high quality source, a mix of fast motion and static scenes, same bitrate for each) at 352x240, 352x480, 480x480 and 720x480 (DVD resolution). Play them all on your standalone. You'll notice a big difference in resolution between the 352x240 and the 352x480, and a slight difference between the others (at least, I did). But you'll also notice the macroblocks in the high-motion scenes are much more visible at 352x480, even more visible at 480x480, and completely unacceptable at 720x480.

I must've encoded and watched (again and again) over 200 clips at various settings before I settled on the format I use now. The key is experimentation and determining if in your opinion the increase in resolution is worth the noticable macroblocks. Some think so, others don't.

why is it better to use MPEG1 with the lower resolution?

MPEG-1 was designed for lower bitrates. But really the only reason I use MPEG-1 is that it's what you're supposed to use to make VCDs. I know mine aren't standard, but they're a lot more standard than if I used MPEG-2 at 352x240. From my tests I also believe that 352x240 at ~2500kpbs looks better with MPEG-1 than MPEG-2. But that's another subjective thing you need to discover.

This is the opinion I've reached after months of experimenting. Again, YMMV :)

Holomatrix
15th October 2002, 16:51
Ok, thanks, that clears some things up :) Have you had a chance to test with LanczosResize + Convolution3D? I did a few small tests and the video seems to look pretty good (TEST= CVD @ 1000 bitrate w/CCE) Real sloooow though :( I was usually using SimpleResize + TemporalSmoother at these low bitrates.

Ookami
15th October 2002, 19:16
First, why is this in General discussion? What program do you use for SVCD encoding (I'm not sure that is TMPGEnc)? I will move it in the appropriate forum when you answer that one...

As for 1 CD SVCD or similar, search for mb1's postings, he has posted a 1 CD matrix from Angel (if I remember well).

I don't know if this has been discussed on this board, I just remember the discussion between the SVCD pros on Ultimate Board.

A few quick notes (didn't read the whole thread, so I'll reply only to the things I read, actually :) ):

- Motion estimation, yes in some cases the "highest" setting can "find" motion where there is none, but, I think this has been answered by the TMPGEnc pros

- NTSC vs. PAL SVCD et all, I think in 99,99% such discussions are useless, because most of the people don't even tune their encoders for max. quality, why then mess with standard settings?

Cheers,

Mijo.

Holomatrix
15th October 2002, 19:39
I had origianally posted this in the AVISYNTH forum but it was moved. I'm using CCE with Andrea's matrix.

SansGrip
15th October 2002, 22:58
Holomatrix: Have you had a chance to test with LanczosResize + Convolution3D?

Yep. I usually use that combination (possibly with MSharpen too if necessary). I find that the recommended Convolution3D(0, 4, 4, 4, 4, 2.8, 0) is great for DVD rips, but tend to use Convolution3D(1, 8, 16, 8, 10, 3, 0) for TV caps. VHS caps are even more noisy and seem to require stronger settings still.

Holomatrix: I was usually using SimpleResize + TemporalSmoother at these low bitrates.

SimpleResize introduces too many artifacts for my liking. I never really experimented with TemporalSmoother. TemporalSoften seemes to work just as well and is a bit faster. Take a look at Cnr2 as well.

SansGrip
15th October 2002, 23:04
Ookami: Motion estimation, yes in some cases the "highest" setting can "find" motion where there is none, but, I think this has been answered by the TMPGEnc pros

Do you mean that the TMPGEnc guys fixed it, or that the issue is discussed in the TMPG forum?

Ookami: NTSC vs. PAL SVCD et all, I think in 99,99% such discussions are useless, because most of the people don't even tune their encoders for max. quality, why then mess with standard settings?

Ah, but for us who do tune (obsessively, without any regard to cost-benefit ;)) making NTSC discs instead of PAL ones is a possible way to squeeze a little more into the bitstream.

I'm actually thinking of trying the reverse (making PAL discs even though I'm in NTSC land) because I wanna see what those 48 extra vertical lines can do for the resolution on my TV. Should I stick to 25fps, or would 23.976 be better for TV display? Or is the whole idea stupid? :D

Holomatrix
16th October 2002, 04:37
Originally posted by SansGrip
Holomatrix: Have you had a chance to test with LanczosResize + Convolution3D?

Yep. I usually use that combination (possibly with MSharpen too if

Thanks, I'll try MSharpen to :) I guess I just have to change the .VDF to .DLL? or does avisynth accept both? and what setting would you use for DVD encodes?

Bonzo
16th October 2002, 12:55
SansGrip:
I'm actually thinking of trying the reverse (making PAL discs even though I'm in NTSC land) because I wanna see what those 48 extra vertical lines can do for the resolution on my TV. Should I stick to 25fps, or would 23.976 be better for TV display? Or is the whole idea stupid?

First: PAL SVCD resolution is 480x576 - NTSC SVCD = 480x480, so 576-480=96 extra vertical lines (not 48 as i've seen 2 times in this thread)

I'm in the PAL region and my DVD player can player both PAL & NTSC (not sure if it does a NTSC to PAL conversion, 'cause my TV set works in NTSC too). I've downloaded a lot of NTSC SVCDs (anime, mostly iVTCed with 3:2 pulldown). My player CAN'T play smoothly 23.976fps SVCDs, it plays fast-slow-fast-slow all the time, but works fine with 29.997fps (native or via 3:2 pulldown), and as long as PAL franerate is ONLY 25fps, I wouldn't recommend you to make 24fps PAL SVCDs (you might want to try with a sample using a CD-RW). Anyway, if you really want to make PAL SVCD from NTSC, you will have to convert the video to 25fps (easy if you have 23.976fps or 29.997fps not badly telecined) and convert the audio with BeSweet (23.976fps to 25fps conversion).

I suppose you want to convert cinema stuff or anime at native 23.976fps (or properly iVTCed), because fully interlaced 29.997 it's almost impossible to do it right (you'll get LOTS of blended fields, as the ones present in many PAL anime DVDs).

Bonzo.

SansGrip
16th October 2002, 16:12
Bonzo: First: PAL SVCD resolution is 480x576 - NTSC SVCD = 480x480, so 576-480=96 extra vertical lines (not 48 as i've seen 2 times in this thread)

I was talking about VCD resolution, 352x240 as opposed to 352x288.

Bonzo: My player CAN'T play smoothly 23.976fps SVCDs, it plays fast-slow-fast-slow all the time, but works fine with 29.997fps (native or via 3:2 pulldown)

Interesting, I'll have to try that with mine. I'm guessing that 25fps would play properly on (possibly signficantly) more standalones than 23.976.

Bonzo: Anyway, if you really want to make PAL SVCD from NTSC, you will have to convert the video to 25fps (easy if you have 23.976fps or 29.997fps not badly telecined) and convert the audio with BeSweet (23.976fps to 25fps conversion).

Yep, I've got frame rate conversion down. What I'd probably do with telecined material is Telecide.Decimate to 23.976 and then AssumeFPS to 25. Apparently this is what broadcasters in PAL land usually do when they show movies on TV, so I'm assuming the speed-up won't be noticible.

As far as pure interlaced stuff goes, I do handle some of this from TV captures and footage from my camcorder. I think the first thing I'd try is a simple ConvertFPS. I do this regularly with 29.97 pure interlaced to 23.976 and it works remarkably well, at least to my unsophisticated eye :)

SansGrip
16th October 2002, 16:14
Holomatrix: Thanks, I'll try MSharpen to :) I guess I just have to change the .VDF to .DLL? or does avisynth accept both? and what setting would you use for DVD encodes?

Get the native Avisynth version from http://shelob.mordor.net/dgraft/.

As far as settings go, it really depends on the source. Sometimes I have to use the defaults (which are pretty aggressive on live action material), sometimes I turn it down a lot, but often I don't use it at all. Half an hour playing with various settings will give you a better idea of its use than I could with words :)

Ookami
16th October 2002, 16:42
>> Ookami: Motion estimation, yes in some cases the "highest" setting can "find" motion where there is none, but, I think this has been answered by the TMPGEnc pros
> Do you mean that the TMPGEnc guys fixed it, or that the issue is discussed in the TMPG forum?

This has been discussed. For SVCD I suggest you to read mb1's postings. He is one of the most knowledgeable person in this area. Of course there are too many others to mention them all :) .

>> Ookami: NTSC vs. PAL SVCD et all, I think in 99,99% such discussions are useless, because most of the people don't even tune their encoders for max. quality, why then mess with standard settings?
> Ah, but for us who do tune (obsessively, without any regard to cost-benefit ) making NTSC discs instead of PAL ones is a possible way to squeeze a little more into the bitstream.

Well, many things are possible, you can even try to make non-standard SVCD or standard CVDs etc. It all depends on your taste in the end (you'll probably hate this "answer"). Personally, I have gained more in tuning the encoders, filters etc. than messing with the standards. A good program that can help you for max. SVCD quality is FitCD.

> I'm actually thinking of trying the reverse (making PAL discs even though I'm in NTSC land) because I wanna see what those 48 extra vertical lines can do for the resolution on my TV. Should I stick to 25fps, or would 23.976 be better for TV display? Or is the whole idea stupid?

Well, I have refused to mess with FPS (after some testings, of course) even with AVIs where I am not bound to a standard, so you can imagine that I will not even touch it with standards like SVCD.

IMO, you have done it correctly, make test clips and compare them by yourself; also a good way of testing is to call your girlfriend, friends, roommate, mother, anyone who doesn't look for encoding errors all the time and ask them for their opinion. :)

Er, BTW, isn't NTSC VCD 320x240? Or is my memory so bad that I haven't remembered it correctly?

Cheers,

Mijo.

Holomatrix
16th October 2002, 18:21
Originally posted by Ookami
[B}

Er, BTW, isn't NTSC VCD 320x240? Or is my memory so bad that I haven't remembered it correctly?

Cheers,

Mijo. [/B]

NTSC VCD is 352x240 23.976fps


Ok, I've got all my filters working and running some tests (Sloooow :))
Here is my script, thanks for all the help :)

LoadPlugin("C:\PROGRA~1\DVD2SVCD\MPEG2Dec\mpeg2dec.dll")
LoadPlugin("C:\PROGRA~1\DVD2SVCD\convol~1\convol~1.dll")
LoadPlugin("C:\PROGRA~1\DVD2SVCD\msharpen.dll")
mpeg2source("D:\MovieRip\DVD2AV~1.D2V")
LanczosResize (352,480)
Convolution3D (0,4,4,4,4,3,0)
MSharpen

SansGrip
16th October 2002, 20:00
Holomatrix: NTSC VCD is 352x240 23.976fps

...or 29.97 :)

Holomatrix: Here is my script, thanks for all the help :)

You might find it's worth comparing the results of using Convolution3D before and after the resize.

SansGrip
16th October 2002, 20:07
Ookami: For SVCD I suggest you to read mb1's postings. He is one of the most knowledgeable person in this area.

I'll search. Thanks :)

Ookami: A good program that can help you for max. SVCD quality is FitCD.

I use it all the time, but only for resizing because I use CQ mode and let the material tell me how many discs to put it on :)

Ookami: Well, I have refused to mess with FPS (after some testings, of course)

Really? That's interesting. Why?

With 29.97 pure-interlace material I've tried ConvertFPS(23.976) and ConvertFPS(25). They both look pretty good to me, but perhaps I'm missing something since I've only just started experimenting in this area.

Ookami: IMO, you have done it correctly, make test clips and compare them by yourself

While I appreciate the input of others, there's nothing like trying it for yourself. I wouldn't consider picking, say, a certain resolution without trying all the others first :D

also a good way of testing is to call your girlfriend, friends, roommate, mother, anyone who doesn't look for encoding errors all the time and ask them for their opinion. :)

I do that too, but my wife is, shall we say, not a videophile. If presented with a movie in both VHS and DVD format she'd pick the one closest ;)

Ookami: Er, BTW, isn't NTSC VCD 320x240? Or is my memory so bad that I haven't remembered it correctly?

Nope, you're having memory errors :)

SansGrip
16th October 2002, 23:07
Just an update on my idea of making PAL encodes instead of NTSC, in case anyone was interested:

My standalone plays them fine at 352x288 25fps, but simply crops the picture to NTSC resolution (actually it looks to be less than that, since it also crops about 8 pixels off each side, probably to maintain aspect ratio).

In other words I don't gain any resolution and I lose about .30 SC (SansGrip's Conjecture) points.

So much for that idea ;)

Overall then it looks like MPEG-1 352x240 max 2564kbps 23.976fps (160kbps joint-stereo layer-II) is the way I'm going for now. At least until I have any more not-so-bright ideas... :D

Ookami
19th October 2002, 19:11
>> Ookami: Well, I have refused to mess with FPS (after some testings, of course)
> Really? That's interesting. Why?

Because I didn't liked it ;) . With lowering of FPS I only noticed a gain in loss of quality (I love this sentence) :D .
Lowering of FPS might be ok for cartoons or similar, but I would never do it for other things.

> I do that too, but my wife is, shall we say, not a videophile.

Well, that is the reason! They are not videophiles! I as a Videophile, have the "Video encoding syndrom". I even look for of synch audio, various compression errors, decoding flaws when I'm in the real world :) . I like to hear a opinion of someone who doesn't know anything about video compression.

> Nope, you're having memory errors

Sigh, not the first one. And with the NTSC VCD resolution I have my problems... This is for the n-th time that I think that it is 320x240, I have, probably, a webpage saved were it is not written correctly. :scared:

> .30 SC (SansGrip's Conjecture) points.

Grin. Let's define the standard for your SansGrip Conjecture points and make it famous :) .

Cheers,

Mijo.

SansGrip
21st October 2002, 02:32
Ookami: With lowering of FPS I only noticed a gain in loss of quality

heheh it took me a minute to parse that ;)

But a loss of quality? Fewer frames = more bits for the frames you do have = higher quality... Or am I missing something?

I even look for of synch audio, various compression errors, decoding flaws when I'm in the real world :)

Well I'm not quite that bad -- yet, anyway. Reminds me of when I played Rollercoaster Tycoon for about 60 hours straight. I kept looking at my family members and wondering what their "Happiness rating" was. That lasted about a day and was vaguely disturbing ;)

Let's define the standard for your SansGrip Conjecture points

I thought I already did :D

Ookami
21st October 2002, 20:12
Originally posted by SansGrip
But a loss of quality? Fewer frames = more bits for the frames you do have = higher quality... Or am I missing something? [/B]


Yes, you are missing the jerky motion :) . Of course, I am not talking about re-converting those 25 PAL to FILM, but lowering the FPS significally! And I didn't liked that... And I never bothered to fight the infamous PAL speed up.

But, if you have silent films or something, then it's something else ;) .

Seriously, I don't like to mess with the FPS setting as other settings had a greater impact and were not giving so much hassle when changing it (in every way).

We should really stop stealing Holomatrixes thread as we don't (or I :) ) add anything new.

Cheers,

Mijo.

Holomatrix
22nd October 2002, 13:26
Maybe you guys should take this into a private room :) hehe

I got my answer already but if you guys want to ramble on, then more power to ya, I am learning things to, as we all are :) The more info we get from others and their experiences, the better :)

SansGrip
22nd October 2002, 22:32
Holomatrix: Maybe you guys should take this into a private room :) hehe

I'm not sure I like the sound of that ;) ;).

I do think that FPS is relevant to a discussion on quality and bitrate, because logic would dictate that the lower the frame rate the better quality (in terms of quantization) you'd get.

Having looked closer at ConvertFPS from 29.97 to 23.976 I can see what you mean about losing visual quality, if you mean the blending that occurs. I would agree that it's not satisfactory, but it's possibly better than Decimate.

I'm currently playing with the other ConvertFPS mode, which blends part of one frame with part of another. It's somewhat noticible on a monitor, but the docs say it's not on a TV. I'm going to test that in a couple of days :).

As far as audio goes it's possible to change the sampling rate without changing the pitch. I'm not sure how good it sounds since I've not tried it yet...