Index: encoder/ratecontrol.c =================================================================== --- encoder/ratecontrol.c (revision 680) +++ encoder/ratecontrol.c (working copy) @@ -352,6 +352,7 @@ return -1; } rc->num_entries = i; + h->param.rc_num_entries = i; if( h->param.i_frame_total < rc->num_entries && h->param.i_frame_total > 0 ) { Index: x264.c =================================================================== --- x264.c (revision 680) +++ x264.c (working copy) @@ -763,6 +763,13 @@ return -1; } + if ( ( param->rc.b_stat_read == 2 ) && ( i_frame_total == 0 ) ) + { + i_frame_total=h->param.rc_num_entries; + x264_log( h, X264_LOG_INFO, "using %d frames discovered from first pass for eta calculations.\n" + ,i_frame_total); + } + if( p_set_outfile_param( opt->hout, param ) ) { fprintf( stderr, "x264 [error]: can't set outfile param\n" ); Index: x264.h =================================================================== --- x264.h (revision 680) +++ x264.h (working copy) @@ -147,6 +147,7 @@ int i_csp; /* CSP of encoded bitstream, only i420 supported */ int i_level_idc; int i_frame_total; /* number of frames to encode if known, else 0 */ + int rc_num_entries; /* Number of frames found by RC, used for fifo eta*/ struct {