[x264-devel] x264_encoder_reconfig()

paolo perotinus paoloperot at yahoo.it
Mon Jul 4 16:13:01 CEST 2016


Hello. I'm trying to change the bitrate on the fly with x264_encoder_reconfig() . Here's a small code of what I did:  

    encoder_sys_t *p_sys = p_enc->p_sys;    x264_picture_t pic;    x264_nal_t *nal;    block_t *p_block;    int i_nal=0, i_out=0, i=0;     if(change_bitrate)    {        fprintf(stderr, "change bitrate\n");        change_bitrate = 0;        fprintf(stderr, "current bitrate= %d \n", p_sys->param.rc.i_bitrate*1000);        p_sys->param.rc.i_bitrate = bitrate;         if( p_sys->param.i_nal_hrd)         {            fprintf(stderr, "can't change bitrate because nal hrd is set\n");             exit(0);        }         x264_encoder_reconfig(p_sys->h, &p_sys->param);        fprintf(stderr, "modified bitrate= %d \n", p_sys->param.rc.i_bitrate*1000);        //exit(0);    }

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.Note that x264_encoder_reconfig() returns 0 .
 What's wrong? Any suggestion ?

Thanks

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x264-devel/attachments/20160704/3267482a/attachment.html>


More information about the x264-devel mailing list