user18048: Looking at https://trac.ffmpeg.org/wiki/Encode/H.264: 
I see this example as being the recommended method to target a bit rate for files meant for streaming
ffmpeg -i input -c:v libx264 -b:v 1M -maxrate 1M -bufsize 2M -pass 1 -f mp4 /dev/null
ffmpeg -i input -c:v libx264 -b:v 1M -maxrate 1M -bufsize 2M -pass 2 output.mp4

I encoded a file using a slightly variation here:
ffmpeg -i *mkv -c:v libx264 -b:v 2.5M -maxrate 2.5M -bufsize 5M -profile:v high -level 4.2 -pass 1 -an -f mp4 /dev/null -y \
ffmpeg -i *mkv -c:v libx264 -b:v 2.5M -maxrate 2.5M -bufsize 5M -profile:v high -level 4.2 -an -movflags +faststart -pass 2 output.mp4

I see that sometimes it's uses a bitrate of 1.800 kbits/s but where does it get that?
Is it using some kind of default CRF value or what?
Does setting a -preset slow would increase the quality further? 

user4169: think of it this way, your driving a car, and you have a target speed of 25, and a max speed limit of 25. Then you stop at a red light for 30 seconds and your average speed drops to 20. It is now impossible to reach an average of 25 again without going over the max. you would need to drive at the max speed an infinite amount of time to get the average back to 25. 
When encoding the video, the encoder reached a frame that took less bits to encode than average (low spacial or temporal information.  For example two identical frames), so bitrate temporarily dipped, and now it can never reach max. 
What you need is a way to say, if we drop below average, we are able to go over max for a small period of time to bring the average back up. This is called “vbv” and you should use that if you want to target a bitrate. 

18048: <p>Looking at <a href="https://trac.ffmpeg.org/wiki/Encode/H.264" rel="nofollow noreferrer">https://trac.ffmpeg.org/wiki/Encode/H.264</a>: </p>

<p>I see this example as being the recommended method to target a bit rate for files meant for streaming</p>

<pre><code>ffmpeg -i input -c:v libx264 -b:v 1M -maxrate 1M -bufsize 2M -pass 1 -f mp4 /dev/null
ffmpeg -i input -c:v libx264 -b:v 1M -maxrate 1M -bufsize 2M -pass 2 output.mp4
</code></pre>

<p>I encoded a file using a slightly variation here:</p>

<pre><code>ffmpeg -i *mkv -c:v libx264 -b:v 2.5M -maxrate 2.5M -bufsize 5M -profile:v high -level 4.2 -pass 1 -an -f mp4 /dev/null -y \
ffmpeg -i *mkv -c:v libx264 -b:v 2.5M -maxrate 2.5M -bufsize 5M -profile:v high -level 4.2 -an -movflags +faststart -pass 2 output.mp4
</code></pre>

<p>I see that sometimes it's uses a bitrate of 1.800 kbits/s but where does it get that?</p>

<p>Is it using some kind of default CRF value or what?</p>

<p>Does setting a -<code>preset slow</code> would increase the quality further? </p>
 4169: <p>think of it this way, your driving a car, and you have a target speed of 25, and a max speed limit of 25. Then you stop at a red light for 30 seconds and your average speed drops to 20. It is now impossible to reach an average of 25 again without going over the max. you would need to drive at the max speed an infinite amount of time to get the average back to 25. </p>

<p>When encoding the video, the encoder reached a frame that took less bits to encode than average (low spacial or temporal information.  For example two identical frames), so bitrate temporarily dipped, and now it can never reach max. </p>

<p>What you need is a way to say, if we drop below average, we are able to go over max for a small period of time to bring the average back up. This is called “vbv” and you should use that if you want to target a bitrate. </p>
