[FFmpeg-devel] [PATCH] 2-pass log filename for x264 codec
Michael Niedermayer
michaelni
Thu Mar 12 01:11:45 CET 2009
On Wed, Mar 11, 2009 at 10:33:42PM +0000, Mark Kennedy wrote:
> Hi,
>
> This bug:
>
> https://roundup.ffmpeg.org/roundup/ffmpeg/issue303
>
> ...was making my life difficult so attached is a patch to let the x264
> codec see the pass-log filename prefix supplied by the user.
[...]
> @@ -147,6 +153,15 @@
> x4->params.rc.i_vbv_buffer_size = avctx->rc_buffer_size / 1000;
> x4->params.rc.i_vbv_max_bitrate = avctx->rc_max_rate / 1000;
> x4->params.rc.b_stat_write = avctx->flags & CODEC_FLAG_PASS1;
> +
> + // allow user to supply logfile stub (for multi process 2pass encodes)
> + if( avctx->passlogfilename && strlen( avctx->passlogfilename ) > 0 ) {
> + const char *logstub = "_x264_2pass.log";
> + x4->params.rc.psz_stat_in = av_malloc( ( strlen( avctx->passlogfilename ) + strlen( logstub ) ) * sizeof( char ) );
> + strcpy( x4->params.rc.psz_stat_in, avctx->passlogfilename );
> + av_strlcat( x4->params.rc.psz_stat_in, logstub, strlen( avctx->passlogfilename ) + strlen( logstub ) + 1 );
> + x4->params.rc.psz_stat_out = strdup( x4->params.rc.psz_stat_in );
> + }
> if(avctx->flags & CODEC_FLAG_PASS2) x4->params.rc.b_stat_read = 1;
tabs
> else{
> if(avctx->crf){
> Index: ffmpeg/libavcodec/avcodec.h
> ===================================================================
> --- ffmpeg/libavcodec/avcodec.h (revision 11570)
> +++ ffmpeg/libavcodec/avcodec.h (revision 11571)
> @@ -1252,6 +1252,8 @@
> */
> int mpeg_quant;
>
> + char *passlogfilename;
> +
> /**
> * pass1 encoding statistics output buffer
> * - encoding: Set by libavcodec.
breaks ABI
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
The misfortune of the wise is better than the prosperity of the fool.
-- Epicurus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090312/c9d376d7/attachment.pgp>
More information about the ffmpeg-devel
mailing list