[vlc-commits] x264: in crf mode, set stream bitrate to be maxrate, so in muxer we have some idea about bitrate

Ilkka Ollakka git at videolan.org
Mon Oct 8 16:56:12 CEST 2012


vlc | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Sat Oct  6 14:02:50 2012 +0300| [8eac86677e3f6f131ca935571c63646907db9a28] | committer: Ilkka Ollakka

x264: in crf mode, set stream bitrate to be maxrate, so in muxer we have some idea about bitrate

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8eac86677e3f6f131ca935571c63646907db9a28
---

 modules/codec/x264.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/modules/codec/x264.c b/modules/codec/x264.c
index 00df228..7074dc0 100644
--- a/modules/codec/x264.c
+++ b/modules/codec/x264.c
@@ -939,6 +939,8 @@ static int  Open ( vlc_object_t *p_this )
 
     /* max bitrate = average bitrate -> CBR */
     p_sys->param.rc.i_vbv_max_bitrate = var_GetInteger( p_enc, SOUT_CFG_PREFIX "vbv-maxrate" );
+    if( p_sys->param.rc.i_vbv_max_bitrate && p_sys->param.rc.i_rc_method != X264_RC_ABR )
+        p_enc->fmt_out.i_bitrate = p_sys->param.rc.i_vbv_max_bitrate * 1000;
 
 
     if( !var_GetBool( p_enc, SOUT_CFG_PREFIX "mbtree" ) )



More information about the vlc-commits mailing list