C-> profile = ff_profile_h1__main;
FFMPEG and x264 Encoding Guide parameter description: http://ffmpeg.org/trac/ffmpeg/wiki/x264EncodingGuide
Preset is related to encoding speed and quality
Av_opt_set (c-> priv_data, "preset", "slow", 0); current presets in descending order of speed are:Ultrafast,Superfast,Veryfast,Faster,Fast,Medium,Slow,Slower,Veryslow,Placebo.
Priv_data belongs to the setting domain specific to each encoder and is set with av_opt_set.
How to Set fixed bit rate encoding
CBR (constant bit rate)
There is no native CBR mode, but you can "simulate" a constant bit rate setting by tuning the parameters of ABR, like
ffmpeg -i input -c:v libx264 -b:v 4000k -minrate 4000k -maxrate 4000k -bufsize 1835k out.m2v
In this example,-BufsizeIs the "Rate Control Buffer" so it will enforce your requested "average" (4000 K in this case) When SS each 1835 K worth of video. so basically it is assumed that the receiver/end player will buffer that much data so it's OK to fluctuate within that much.
Of course, if it's all just empty/black frames then it will still serve less than that has bits/s (but it will raise the quality level as much as it can, up to the CRF level ).
Only setting bit_rate is the average bit rate, which may not be controlled
C-> bit_rate = 400000;
C-> rc_max_rate = 400000;
C-> rc_min_rate = 400000;
[Libx264 @ 00c70be0] vbv maxrate specified, but no bufsize, ignored
Set C-> rc_buffer_size = 200000.
After such control, the encoding quality is obviously poor...