<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div><div>Hi Andrew,</div><div class=""><br class=""></div><blockquote type="cite" class=""><div style="line-height: 1.7; font-size: 14px; font-family: Arial;" class=""><div class="">x264 adopts several rate control methods, one of which is of two pass. For 1st pass, x264 encoder will generate two files, i.e. rate control file and mb tree file. For 2nd pass, x264 encoder will read the two files, and estimate qp value to encode each frame.<br class=""><br class="">It's redundant to encode video sequence twice, one for each pass. Is it possible to encode video sequence once without making big change into rate control algorithm?<br class=""></div></div></blockquote></div><div><br class=""></div><div>Perhaps consult the documentation before posting here? x264 supports c<span style="background-color: rgb(254, 254, 254);" class="">onstant quality mode, constant quantiser and constant bitrate:</span></div><div><span style="background-color: rgb(254, 254, 254);" class=""><font color="#4f4f4f" face="Ubuntu Mono" size="3" class=""><br class=""></font></span></div><div><span style="background-color: rgb(254, 254, 254);" class="">From x264 --help:</span></div><div><span style="background-color: rgb(254, 254, 254);" class=""><br class=""></span></div><div><div style="margin: 0px; line-height: normal; background-color: rgb(254, 254, 254);" class=""></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: 'Ubuntu Mono'; color: rgb(79, 79, 79); background-color: rgb(254, 254, 254);" class=""></div></div><blockquote type="cite" class=""><div class=""><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: 'Ubuntu Mono'; color: rgb(79, 79, 79); background-color: rgb(254, 254, 254);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Ratecontrol:</span></div><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: 'Ubuntu Mono'; color: rgb(79, 79, 79); background-color: rgb(254, 254, 254); min-height: 16px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></div><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: 'Ubuntu Mono'; color: rgb(79, 79, 79); background-color: rgb(254, 254, 254);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">  -B, --bitrate <integer>     Set bitrate (kbit/s)</span></div><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: 'Ubuntu Mono'; color: rgb(79, 79, 79); background-color: rgb(254, 254, 254);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">      --crf <float>           Quality-based VBR (0-51) [23.0]</span></div><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: 'Ubuntu Mono'; color: rgb(79, 79, 79); background-color: rgb(254, 254, 254);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">      --vbv-maxrate <integer> Max local bitrate (kbit/s) [0]</span></div><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: 'Ubuntu Mono'; color: rgb(79, 79, 79); background-color: rgb(254, 254, 254);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">      --vbv-bufsize <integer> Set size of the VBV buffer (kbit) [0]</span></div><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: 'Ubuntu Mono'; color: rgb(79, 79, 79); background-color: rgb(254, 254, 254);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">  -p, --pass <integer>        Enable multipass ratecontrol</span></div><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: 'Ubuntu Mono'; color: rgb(79, 79, 79); background-color: rgb(254, 254, 254);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">                                  - 1: First pass, creates stats file</span></div><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: 'Ubuntu Mono'; color: rgb(79, 79, 79); background-color: rgb(254, 254, 254);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">                                  - 2: Last pass, does not overwrite stats file</span></div></div></blockquote><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class="">If you aren’t bothered about hitting an exact file size then there is no need to use two-pass encoding.</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class="">For example, the default is --</span><span style="background-color: rgb(254, 254, 254);" class="">crf 23, which aims to keep constant quality and bitrate depends only on the complexity of the source material. This is done in a single pass.</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Regards,</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Simon</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div></div></body></html>