Log in

View Full Version : Which encoder for CBR?


MrTroy
12th February 2006, 12:28
Recently I've been trying to do some CBR MPEG2 encoding with TMPGEnc Plus, for coming to the conclusion that TMPGEnc isn't the best encoder for constant bitrates. With a setting of CBR 9000 kbit/s, the bitrate graph of the resulting mpg looks like a VBR one (deviating as much as 2000 kbit/s from the set bitrate) instead of 'oscillating around 9000 kbit/s'.

After a bit reading on this board I found out this is a well-known issue of TMPGEnc, and that it isn't recommended for CBR.

What encoder would you recommend for creating MPEG2 with a bitrate as constant as possible?

Mug Funky
13th February 2006, 05:53
you could try CCE...

if you want something free, one thing i like doing is QuEnc with 1-pass with max and average BR set to your CBR rate. you can also un-check "VBR" to get CBR, but it'll only mean you get padding when the quality is saturated (that wont increase quality, only make your file bigger). if you're doing this, use a high bitrate matrix to prevent undersizing (you'll get better quality in quiet bits too). search the forum for matrices if you're unsure. 6of9 is a good matrix.

also, HC with constant quant set to 1, and max bitrate allowed is pretty good for "mock CBR". it'll be a tad slower than quenc though because there'll be lots of VBV fixes going on (this means re-encoding the part that underflowed).

MrTroy
26th February 2006, 09:59
Sorry for the late reply, I didn't have access to the Internet for some time.

I tried HC with the settings you recommended, and set the max bitrate to 9000. The result is not exactly CBR (see attachment). I guess my .ini file is wrong or incomplete?

*ASPECT 16:9
*BIAS 100
*BITRATE 9000
*CQ_MAXBITRATE 1
*CUSTOMMATRIX
8 10 11 12 12 13 14 15
10 11 12 13 13 15 15 16
11 12 12 14 15 15 16 17
12 13 14 15 15 16 17 18
12 13 15 15 16 17 18 19
13 15 15 16 17 18 19 19
14 15 16 17 18 19 19 20
15 16 17 18 19 19 20 20

10 10 11 12 12 13 14 15
10 11 12 13 14 14 15 16
11 12 12 14 14 15 16 17
12 13 14 14 15 16 17 18
12 14 14 15 16 17 18 19
13 14 15 16 17 18 19 20
14 15 16 17 18 19 20 20
15 16 17 18 19 20 20 20
*INFILE <the avs file>
*MAXBITRATE 9000
*OUTFILE <the m2v file>
*PROFILE NORMAL
*TFF
(I used profile "normal" for testing purposes instead of "best", could this cause the problem?)

Another problem is that, although I used *TFF, the output file is progressive. It has, however, lots of ugly "interlacing lines" in the screen when high motion is going on (read: any motion faster than just standing still). I used avisynth's SelectEven to convert 23.976fps to 29.97fps, maybe it has to do something with that?

foxyshadis
26th February 2006, 11:04
Do you mean the encoder trashes the interlacing, causing lots of ugly blocks and smeared combs around them in motion scenes? That's the symptom of progressively encoding interlaced material. It sounds like yours worked out great; encoding interlaced is supposed to be combed if displayed progressively, because it's the decoder's job to do the deinterlacing on a progessive medium like a computer. Try playing it on a tv through a real dvd player, see if it looks normal or not there.

MrTroy
26th February 2006, 12:12
Do you mean the encoder trashes the interlacing, causing lots of ugly blocks and smeared combs around them in motion scenes? That's the symptom of progressively encoding interlaced material. It sounds like yours worked out great; encoding interlaced is supposed to be combed if displayed progressively, because it's the decoder's job to do the deinterlacing on a progessive medium like a computer. Try playing it on a tv through a real dvd player, see if it looks normal or not there.
No, I tested it yesterday on my regular tv, it still displays those lines. They aren't normal; it's like the encoder tries to "fake" interlacing.

My source is progressive, maybe HC can't make interlaced video out of progressive material? Should I let AviSynth interlace the video?

dragongodz
26th February 2006, 12:21
My source is progressive
so of course doesnt have interlaced combing.

it still displays those lines. They aren't normal; it's like the encoder tries to "fake" interlacing.
if a deocder is displaying interlaced combing and doesnt either automatically deinterlace or has a setting to deinterlace that hasnt been set then there is nothing "fake" about it.

why dont you provide a small sample so people can check it out and tell you exactly what it is.

MrTroy
26th February 2006, 12:54
if a deocder is displaying interlaced combing and doesnt either automatically deinterlace or has a setting to deinterlace that hasnt been set then there is nothing "fake" about it.
Maybe you missed the bit in my post that said the output m2v is progressive. Of course the decoder doesn't deinterlace: it thinks the video is progressive. However, if this were normal interlacing artifacts, they wouldn't be visible on a normal tv, which they do.

I will see if I can make a sample.

hank315
26th February 2006, 13:52
The clip will be encoded progressive with the ini file you posted.
The *INTERLACED flag is missing, using only *TFF doesn't turn on interlaced encoding.

MrTroy
26th February 2006, 15:30
The clip will be encoded progressive with the ini file you posted.
The *INTERLACED flag is missing, using only *TFF doesn't turn on interlaced encoding.
Thanks, that explains why there are interlacing lines visible. I forgot AviSynth outputs an interlaced video, because of the use of SelectEven (framerate conversion). Of course the encoder needs to know that the source is interlaced. :)

But then there's still the bitrate thing. According to the HCEnc manual, BIAS 100 and CQ_MAXBITRATE 1 should produce fairly constant bitrates. But for me it doesn't (see attachment in my second post). Are there wrong / missing parts in my .ini file?