View Full Version : megui/x264 average bitrate question
tecxx
1st October 2006, 16:54
hello!
i've recently decided to change from gordian knot to megui, and i'm very pleased, it's a nice piece of software! i just have one question i couldn't find an answer yet:
in gknot, i usually did a compressibility check and then set the filesize so that the "quality" indicator was 100%. this worked very well for me. the resulting movies were all between 1.2gb and 3gb and the quality was very good.
now how do i achieve something like this in megui ?
the meWiki says something about using the bitrate calculator but i don't get it. i can set the average bitrate value, but what do i set it to? 1000? 1500? 10000 ? i don't care about the resulting filesize. do i simply use one of the HQ profiles and forget about the calc?
:thanks: for helping.
check
1st October 2006, 17:34
The HQ profiles all just come with a default bitrate of 1000. If you want a certain quality but don't care about filesize, I'd suggest you use x264 with Constant Quality mode. Try values around 18-24.
It produces files with a known quality and unknown filesize rather than a known average bitrate and unknown filesize.
tecxx
1st October 2006, 17:51
in the x264 encoder configuration window i see three CQ profiles. which one should i use?
or should i select HQ-Slower and then switch the mode to constant quality?
check
1st October 2006, 18:18
Your choice. Personally I use the HQ modes because they use higher quality options and therefore when using a CQ/CRF (constant quantizer/constant quality) mode you will get better compression. Pick the HQ setting that matches the speed you are happy with for the encoding. If you want to save the change to a CQ mode, you must click 'update' down the bottom of the codec config.
To answer your next question (unasked as of yet ;)), there are two CQ modes in x264:
o constant quantizer: every frame is encoded with a mathematically identical quantizer
o constant quality (aka constant rate factor): the video is encoded to a nominal quantizer, but the encoder increases the quantizer where quality is needed less and decreases it where it is needed more - bowing to the fact that quantizer is not a 100% accurate model of quality.
Generally you'll want to use the latter mode :)
tecxx
1st October 2006, 18:28
thanks for that long reply. i was just going to ask that next question, yes ;=)
i just have to ask some more.
is the "constant quality" mode of x264 something like CBR in mp3 encoding (every frame with same bitrate) or does it encode the movie frames based on it's complexity? so, darker/less complex movie frames are encoded with a lower "bitrate(?)"?
i'm a bit unsure about the CQ mode as it's just one pass and i'm used to 2-pass encodes. what i know about video encoding is that the first pass is used to analyze the movie, and the second pass to do the encoding based on the information gained from the first pass.
do i have to worry about this or simply use CQ mode and i'm fine?
check
1st October 2006, 19:23
constant quality *is* the latter way you described. It encodes every frame to the same complexity without regard to bitrate required.
In 2pass mode (ie known bitrate/filesize unknown quality), the first pass is used to calculate the relative complexity of every frame, so the available bitrate can be equally distributed between all frames in the second pass when the file is actually created.
In CQ modes there is no need to do the analysis pass because there is no need to 'ration' bits and every frame will simply be given the amount required to encode it at the given quantizer. So in other words, simply use Constant Quality in its one pass form :)
tecxx
1st October 2006, 19:40
thanks for that explanation!
(btw, a short explanation like this should be in the megui wiki :=)
bye!
DDogg
3rd October 2006, 02:58
check, could you venture an opinion on the CQ-ASP_Q2_eq(crf) profile? Do you feel it is one of the better approaches for those of us who are not concerned with size? If so, would you recommend it as is, or with the eqm_avc_hr matrix?
Alternatively, do you have a favorite CQ profile to share for our purposes? I'm itching to use the import profile feature.
Thanks for your work.
check
3rd October 2006, 11:01
CQ-ASP_Q2_eq(crf) & CQ-ASP_Q2_eq are identical profiles, the only difference is that the first is crf (ie constant rate factor - I explained this term above) at a value of 18, and the second is cq (constant quantizer - ditto) at a value of 18.
Why 18 and not the 2 as alluded to in the name? Because all the old guard of encoders that encode to MPEG-4 ASP (http://mewiki.project357.com/Computer_movie_files/Video#MPEG-4_ASP) use a different quantizer system. The equivalent value for q2 in the ASP system is q18 in h264 (aka MPEG-4 AVC). So it's mostly a preset designed to smooth the migration from xvid, divx, et al to a newer codec :). Personally I find q18 too high for normal use (animation is an exception), I use 20-22 most of the time.
o fun fact: HD stuff generally is ok with slightly lower quants)
o fun fact #2: Just because ASP q2 is mathematically the same as AVC q18 does not mean they will produce pixel-identical output. AVC does a lot of things differently to ASP, and it can look worse especially if the inloop deblocker is set too high (and on some sources even enabling it is bad). That said, the quality is perceptually the same and the filesize is smaller.
o fun fact #3 (last one): codec compression vs. filesize can be thought of accurately as being a law of diminishing returns system. When you have high quality, a small drop in quality yields a large reduction in filesize. At low quality, you'll find it harder to save space without further significant quality reductions. q18 can be considered 'high' quality, q24-26 'medium' and 30+ 'low' for the purposes of this mental exercise.
DDogg
3rd October 2006, 22:14
check, thanks for the informative reply. There are many corollaries between my old CCE stuff and this, so your thoughts were clear to me.
Did you wish to pass by the matrix question? If so, I know all about worms and cans. :)
check
4th October 2006, 10:05
I would guess sharktooth's matrix would end up being better at those q levels, but as I've never tested it I can't say for sure.
Kaze_no_Hime
3rd December 2009, 22:15
I wanted to try CQ mode in x264:Unrestricted 2pass Anime Toons Insane. I switched to CQ mode in that profile and selected Advanced Options tab. But when I stared the encoder it gives me some error in the log window.
It says:
Encoding started
Standard output stream
Standard error stream: D\Program Files\megui\tools\x264\x264.exe: unrecognized option `--lookahead'
This lookahead-thing is showing when I check Advanced settings in the main profile(In that case - Anime Toons Insane). When I uncheck the Advanced Settings tab everything's going all right. But I suppose those setting from Advanced Settings tab are not being aplayed to the encoding process when they're unchecked, right?
So, can someone help me to fix that problem?
Nightshiver
3rd December 2009, 23:13
No, those option's will always be applied. Simply unchecking the "Show Advanced Options" will only not let you see what those options are. It doesn't turn them off. You have to edit them yourself and then save to profile to do that. It's perfectly fine if it's unchecked.
Kaze_no_Hime
3rd December 2009, 23:16
Ah, I see. Thanks a lot! Going back to megui to try it out :)
Zathor
7th December 2009, 15:21
No, those option's will always be applied. Simply unchecking the "Show Advanced Options" will only not let you see what those options are. It doesn't turn them off. You have to edit them yourself and then save to profile to do that. It's perfectly fine if it's unchecked.
Sadly that's wrong at least for 1057. I do not know if the behavior was different before this version. If the "advanced settings" checkbox is not set only the basic/main settings will be applied and only the command shown below will be passed to the encoder.
This has been fixed/changed in the patched build:
- [x264Config] the advanced settings will be applied to the command line independent of the advanced settings checkbox
http://forum.doom9.org/showthread.php?t=151159
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.