[Libav-user] h264 encode speed
hz nan
nhongzhen at gmail.com
Tue Jul 19 09:48:55 CEST 2011
Hi
I need to using H264 to live broadcast and it need 25 frames in one second.,
so I need to encode 25 frames
in one second. If the frame is 160*120 or 320*240 ,it is ok. But if it is
640*480, it need more than 70ms to
encode one frame. Does anyone have suggestion about how to increase encode
and decode speed?
Thanks Hongzhen Nan
------------------------------------------
libx264 compile: ../configure ---enable-static --disable-lavf --disable-ffms
--disable-gpac --enable-win32thread --disable-swscale
ffmpeg compile: ../configure --enable-static --enable-gpl --disable-mmx
--enable-libx264 --disable-ffmpeg --disable-ffmplay
--disable-ffprobe --disable-ffserver --disable-postproc --enable-w32threads
H264 encode:
pCodec = avcodec_find_encoder(CODEC_ID_H264);
pCodecCtx= avcodec_alloc_context();
pCodecCtx->width = v_width;
pCodecCtx->height = v_height;
pCodecCtx->pix_fmt = PIX_FMT_YUV420P;
pCodecCtx->time_base.den = 1;
pCodecCtx->time_base.num = 25;
pCodecCtx->coder_type=FF_CODER_TYPE_AC;
pCodecCtx->flags|=(CODEC_FLAG_LOOP_FILTER);
pCodecCtx->me_cmp|=1;
pCodecCtx->partitions|=(X264_PART_I8X8|X264_PART_I4X4|X264_PART_P8X8|X264_PART_B8X8);
pCodecCtx->me_method=ME_HEX;
pCodecCtx->me_subpel_quality=7;
pCodecCtx->me_range=16;
pCodecCtx->gop_size=20;
pCodecCtx->scenechange_threshold=40;
pCodecCtx->qcompress=0.6;
pCodecCtx->qmin=10;
pCodecCtx->qmax=51;
pCodecCtx->max_qdiff=4;
pCodecCtx->max_b_frames=3;
pCodecCtx->refs=3;
pCodecCtx->flags2
|=(CODEC_FLAG2_BPYRAMID|CODEC_FLAG2_MIXED_REFS|CODEC_FLAG2_WPRED|CODEC_FLAG2_8X8DCT|CODEC_FLAG2_FASTPSKIP);
pCodecCtx->weighted_p_pred=2;
pCodecCtx->rc_lookahead=0;
pCodecCtx->crf=22;
while(avcodec_open(pCodecCtx,pCodec)<0);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20110719/a7cf428e/attachment.html>
More information about the Libav-user
mailing list