<html><head></head><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px"><div dir="ltr" id="yui_3_16_0_ym19_1_1467641178507_4294">Hello. I'm trying to change the bitrate on the fly with x264_encoder_reconfig() . Here's a small code of what I did: </div><div id="yui_3_16_0_ym19_1_1467641178507_4429" dir="ltr"><br></div><div id="yui_3_16_0_ym19_1_1467641178507_4430" dir="ltr"><br></div><div id="yui_3_16_0_ym19_1_1467641178507_4499"> encoder_sys_t *p_sys = p_enc->p_sys;</div>
<div id="yui_3_16_0_ym19_1_1467641178507_4500"> x264_picture_t pic;</div>
<div id="yui_3_16_0_ym19_1_1467641178507_4501"> x264_nal_t *nal;</div>
<div id="yui_3_16_0_ym19_1_1467641178507_4502"> block_t *p_block;</div>
<div id="yui_3_16_0_ym19_1_1467641178507_4503"> int i_nal=0, i_out=0, i=0;</div>
<div id="yui_3_16_0_ym19_1_1467641178507_4504"> </div>
<div id="yui_3_16_0_ym19_1_1467641178507_4505"> if(change_bitrate)</div>
<div id="yui_3_16_0_ym19_1_1467641178507_4506"> {</div>
<div id="yui_3_16_0_ym19_1_1467641178507_4507"> fprintf(stderr, "change bitrate\n");</div>
<div id="yui_3_16_0_ym19_1_1467641178507_4508"> change_bitrate = 0;</div>
<div id="yui_3_16_0_ym19_1_1467641178507_4509"> fprintf(stderr, "current bitrate= %d \n", p_sys->param.rc.i_bitrate*1000);</div>
<div id="yui_3_16_0_ym19_1_1467641178507_4510"> p_sys->param.rc.i_bitrate = bitrate; </div>
<div id="yui_3_16_0_ym19_1_1467641178507_4511"> if( p_sys->param.i_nal_hrd) </div>
<div id="yui_3_16_0_ym19_1_1467641178507_4512"> {</div>
<div id="yui_3_16_0_ym19_1_1467641178507_4513"> fprintf(stderr, "can't change bitrate because nal hrd is set\n"); </div>
<div id="yui_3_16_0_ym19_1_1467641178507_4514"> exit(0);</div>
<div id="yui_3_16_0_ym19_1_1467641178507_4515"> }</div>
<div id="yui_3_16_0_ym19_1_1467641178507_4516"> </div>
<div id="yui_3_16_0_ym19_1_1467641178507_4517"> x264_encoder_reconfig(p_sys->h, &p_sys->param);</div>
<div id="yui_3_16_0_ym19_1_1467641178507_4518"> fprintf(stderr, "modified bitrate= %d \n", p_sys->param.rc.i_bitrate*1000);</div>
<div id="yui_3_16_0_ym19_1_1467641178507_4519"> //exit(0);</div>
}<div id="yui_3_16_0_ym19_1_1467641178507_4432" dir="ltr"><br></div><div id="yui_3_16_0_ym19_1_1467641178507_4456" dir="ltr"><br></div><div id="yui_3_16_0_ym19_1_1467641178507_4408" dir="ltr">It worked with an earlier version of x264 (year 2011), but with the current snapshot (x264-snapshot-20160629-2245-stable) even if p_sys->param.rc.i_bitrate shows the new bitrate, the stream's real bitrate is not changed.</div><div id="yui_3_16_0_ym19_1_1467641178507_4670" dir="ltr">Note that x264_encoder_reconfig() returns 0 .<br></div><div id="yui_3_16_0_ym19_1_1467641178507_4669" dir="ltr"> What's wrong? Any suggestion ?</div><div id="yui_3_16_0_ym19_1_1467641178507_4599" dir="ltr"><br></div><div id="yui_3_16_0_ym19_1_1467641178507_4600" dir="ltr"><br></div><div id="yui_3_16_0_ym19_1_1467641178507_4629" dir="ltr">Thanks<br></div><div id="yui_3_16_0_ym19_1_1467641178507_4641" dir="ltr"><br></div></div></body></html>