Log in

View Full Version : HcEnc 026Beta exceeds maximum bitrate.


VonOben
9th May 2011, 10:59
Hi.

I've encoded some stuff with HcEnc 026 Beta and the results are great. However, now I have a a source where HcEnc exceeds maximum bitrate. I've tried it on two diffferent computers, lowered the bitrate, changed gop-length etc. No luck. :(

Does anyone else experience the same problem?

http://dl.dropbox.com/u/8582653/hcenc_miss.GIF

Edit: Trying the same settings in HC025 now.

Edit#2: HC025 did the same thing. Changing AQ to 1 and trying again.

Edit#3: Still peaks far above max bitrate. I can't figure out why. :(

Alex-Kid
10th May 2011, 07:07
If max bitrate = avg bitrate → CBR (VBR shouldn't be done!)

As there are options to get close to CBR (bitrate variations are minimal), HCEnc overrides max bitrate setting.

I guess that should happen, correct me if I'm wrong.

Saludos

By ALEX-KID

VonOben
10th May 2011, 12:02
If max bitrate = avg bitrate → CBR (VBR shouldn't be done!)

As there are options to get close to CBR (bitrate variations are minimal), HCEnc overrides max bitrate setting.

I guess that should happen, correct me if I'm wrong.

Nah. HcEnc are never close to CBR in my opinion.

Anyhow, having different values (like 7500 average and 8000 max) doesn't make any difference with this clip. It peaks well above limit. :(

sneaker_ger
10th May 2011, 14:29
Is this really a problem? VBV is a leaky bucket model and allows such bitrate spikes IIRC.

VonOben
10th May 2011, 19:52
Is this really a problem? VBV is a leaky bucket model and allows such bitrate spikes IIRC.

Well, when LPCM audio is muxed together with this the total bitrate will be too high for the DVD standard.

Right..?

Mug Funky
11th May 2011, 02:28
you could give it a shot without fox2, and turn adaptive matrices on for any scenes that fox2 would have helped on.

mpeg-standard should be enough if you have bitrate to spare.

this is interesting though, as i was under the impression HC couldn't underflow...

try turning interlaced on (instead of "auto"), as the preview there looks like an interlaced scenechange.

sneaker_ger
11th May 2011, 04:11
Well, when LPCM audio is muxed together with this the total bitrate will be too high for the DVD standard.

Right..?

I'm not really sure. I suggest you try it - if your muxer doesn't complain it should be fine.

Sagittaire
11th May 2011, 09:25
1) Rate control use VBV model and bitrate can be localy superior to "max bitrate". It's curious but it's like that.

2) Use the same "bitrate" and "max bitrate" is never good idea. Paradoxaly (but it's the VBV model) you can have for really complexe scene or simply Iframe a lower quality in this case. If the VBV RC work good it's better to fixe bitrate like that:

custum bitrate < 2/3 max bitrate.

With that you have a better buffer work:
- more constant quality
- paradoxaly a better quality in complexe scene

"more is not necessary better" ... ;-)

Mug Funky
12th May 2011, 05:21
the problem here though, is HC should never show a greater bitrate than the one the user inputs as max. no ifs, no buts. the VBV is failing here.

i've certainly never seen it do that.

of course, the screenshot could be shopped :)

sneaker_ger
12th May 2011, 05:58
the problem here though, is HC should never show a greater bitrate than the one the user inputs as max. no ifs, no buts. the VBV is failing here.

I won't deny the possibility of an error, but why should it never happen when the VBV model allows for bitrate spikes above the "max bitrate" value? :confused:

Sagittaire
12th May 2011, 08:58
I won't deny the possibility of an error, but why should it never happen when the VBV model allows for bitrate spikes above the "max bitrate" value? :confused:

Well I repeat: it's not bug. It's the "max local bitrate" (for frame) and not really "max bitrate" for VBV model. Your stream is certainely compliant stream. Make mux and see the result ... ;-)

Moreover it's really difficult for codec to respect bitrate = max bitrate. In most case codec will done bitrate inferior to max bitrate particulary with codec like MPEG2 (q1 saturation for less complex part).

sneaker_ger
12th May 2011, 09:37
Well I repeat: it's not bug. It's the "max local bitrate" (for frame) and not really "max bitrate" for VBV model. Your stream is certainely compliant stream. Make mux and see the result ... ;-)

That's my opinion, too, but Mug Funky seems to think otherwise.

VonOben
12th May 2011, 17:11
I'm not fully convinced that it's okay for HcEnc to peak above my preset until I've done some DVD-authoring. But I'm still having problems. With the same source transformed to 25p via AviSynth, a different matrix and different average bitrate settings this thing won't even encode.

It stops encoding (but doesn't freeze) when it comes to the demanding part of the video in pass 2. Also an error message about VBV beeing critial. I haven't seen that before, and didn't find anything at a fast googeling. Maximum bitrate peaks even higher.

http://dl.dropbox.com/u/8582653/hcenc_miss2.gif

VonOben
12th May 2011, 19:32
With mpeg matrix HcEnc does not break the max bitrate limit. It stays at 7999kbit/s.

Strange. But anyhow, now I got my encode done.

sneaker_ger
12th May 2011, 22:35
Too bad hank has been inactive lately, maybe he could shed some light on this.

hank315
14th May 2011, 22:29
This must be a pretty "heavy" source.
Your settings are close to CBR with max/average bitrate almost the same and a bias of 100.
The fox1 matrix also puts extra stress on the bitrate control.
The VBV message means the buffer is almost drained, HCenc estimates quantizers for the second pass based on the info from the first pass.
Frame sizes are based on this, so max bitrate and also the VBV are based on these quant estimates.
If the max bitrate is violated or the VBV is drained because of a bad estimate, HCenc starts to re-encode one or more frames using a higher quant in the current GOP until bitrate and VBV are OK.
Why it doesn't work in this case, I don't know, probably a combination of a difficult source and the other settings mentioned above.

It would be nice to have this source for testing.

And I do agree with the posts of Sagittaire above.

VonOben
14th May 2011, 23:24
This must be a pretty "heavy" source.

Yes, I guess. There's rain and stuff in it. It's a VHS transfer of this music video: http://www.youtube.com/watch?v=_R9TjcFKlQ8

This is the bitrate distrubution choosen by x264 when doing a ~14Mbit/s encode, this video is the red square:

http://dl.dropbox.com/u/8582653/bitrate.gif
(This encode is 50p.)

It would be nice to have this source for testing.

And I do agree with the posts of Sagittaire above.

No problem, for you (the creator of HcEnc) anything! ;) If you have a fast internet connection I'll give you a ftp account (this file is lots and lots of gigabytes, I'll try to trim it down) to a server with 100Mbit/s upload.

Otherwise drop me a PM with your adress and I'll send you a spare HDD with this source. :)

:thanks:

hank315
15th May 2011, 15:36
Downloading lots of gigabytes is no problem, I have a 100 Mbit fibre optic Inet connection.

VonOben
15th May 2011, 19:29
Downloading lots of gigabytes is no problem, I have a 100 Mbit fibre optic Inet connection.

Great. :D I'll get back to you as soon as I've created an account.

Edit: And BLAM! Hank downloaded the stuff in 83Mbit/s. Not bad since we're in different countries. Thanks again, Hank315.

http://dl.dropbox.com/u/8582653/ftp.png
(The other traffic, before and after the spike are torrent traffic.)

Trixter
4th June 2011, 23:02
this is interesting though, as i was under the impression HC couldn't underflow...


Unfortunately, it can, and this is what is hanging my longform project:

http://img15.imageshack.us/img15/2618/hcenchangimage.png (http://imageshack.us/photo/my-images/15/hcenchangimage.png/)

The encoder gets stuck right there and doesn't move. It doesn't hang; I can exit just fine and try again. But it is obviously stuck in some internal loop.

The frame that is causing this trouble is:

http://img863.imageshack.us/img863/2316/hcenctroubleframe.png (http://imageshack.us/photo/my-images/863/hcenctroubleframe.png/)

That particular segment is about 3 minutes long, with that particular frame about 1 minute in. (animation with extremely hard crisp lines). The entire video is full of drastically different content as it is an anthology of computer animation. The entire video is not like that sample frame, only the 3-minute sequence is.

I've tried tons of options and can't get this sequence to encode at all -- any ideas for avoiding underflow?

Trixter
5th June 2011, 04:47
Update: I was able to avoid underflow and get it to finish encoding by picking a truly horrendous matrix (HVSGOOD) and turning off all lowgain and AQ. But this is obviously less than desirable and the results are not as nice as they should be. Hank, did you ever do anything with that guy's sample? Any new betas on the way?

techreactor
14th July 2011, 13:22
I reported the same problem today in the 0.25 thread. Even ver 0.25 has the same problem. Perhaps a look at the features added beyond 0.23 and a look at both the version codes would determine the cause.