<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=utf-8">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi all,<br>
    <br>
    I have an application that encodes mpeg4 video. The encoder was an
    adaptation of the <a
href="https://www.ffmpeg.org/doxygen/2.4/decoding_encoding_8c-example.html">decoding_encoding_8c-example</a>.
    It works well, but bitrate fluctuates without much control.
    Currently, these are my AVCodecContext settings:<br>
    <br>
    <tt>    c->bit_rate = 5000000;</tt><tt><br>
    </tt><tt>    c->width = this->m_width;</tt><tt><br>
    </tt><tt>    c->height = this->m_height;</tt><tt><br>
    </tt><tt>    c->time_base.den = 25;</tt><tt><br>
    </tt><tt>    c->time_base.num = 1;</tt><tt><br>
    </tt><tt>    c->gop_size = 0;</tt><tt><br>
    </tt><tt>    c->max_b_frames=0;</tt><tt><br>
    </tt><tt>    c->pix_fmt = this->pix_fmt;</tt><tt><br>
    </tt><tt><br>
    </tt><tt>    av_opt_set(c->priv_data, "preset", "ultrafast", 0);</tt><tt><br>
    </tt><tt>    av_opt_set(c->priv_data, "tune", "zerolatency", 0);</tt><br>
    <br>
    And I get up to 70Mbps depending on the image being encoded. I have
    also tried to set these parameters:<br>
    <br>
    <tt>    c->bit_rate = 12e06;</tt><tt><br>
    </tt><tt>    c->rc_min_rate = c->bit_rate;</tt><tt><br>
    </tt><tt>    c->rc_max_rate = c->bit_rate;</tt><tt><br>
    </tt><tt>    c->rc_buffer_size = c->bit_rate * 30;</tt><br>
    <br>
    And it does limit bandwidth, but after a couple minutes of encoding
    I get the error:<br>
    <br>
        <tt>[error] ffmpeg error evaluating rc_eq (null)</tt><br>
    <br>
    My guess is that I'm missing some parameters. I don't quite
    understand what the rc_buffer_size value should be either.<br>
    <br>
    Cheers!<br>
    <pre class="moz-signature" cols="72">-- 
Sergio Basurco,
Coherent Synchro</pre>
  </body>
</html>