[Libav-user] CodecContext Optimization to Decode H264

Jérôme SALAYET jerome.salayet at hymatom.fr
Thu Feb 21 12:25:40 CET 2013


Hello,

 

I use the last released FFMPEG library to decode H264 video streams (each frame send to the avcodec_decode_video2 function is a full video frame).

 

When I look several code sources samples, it seems that everyone set differents options for the CodecContext and the Codec flags.

 

I someone can tell me if I use the better ones to decode H264 :

 

m_lpCodecCtx->skip_frame       =  AVDISCARD_NONREF;

m_lpCodecCtx->skip_loop_filter =  AVDISCARD_ALL;

m_lpCodecCtx->skip_idct        =  AVDISCARD_ALL;

m_lpCodecCtx->idct_algo        =  1;

m_lpCodecCtx->has_b_frames     =  0;

m_lpCodecCtx->refs             =  1;

av_opt_set(m_lpCodecCtx->priv_data, "preset", "ultrafast", 0);

av_opt_set(m_lpCodecCtx->priv_data, "tune", "zerolatency", 0);

 

 

I also set the codec flags like this :

 

if(m_lpCodec->capabilities&CODEC_CAP_TRUNCATED) 

 m_lpCodecCtx->flags|= CODEC_FLAG_TRUNCATED;

// Enable faster H264 decode.

m_lpCodec->capabilities |= CODEC_CAP_FRAME_THREADS;

m_lpCodecCtx->flags     |= CODEC_FLAG_LOW_DELAY;

m_lpCodecCtx->flags2    |= CODEC_FLAG2_FAST;

 

Regards,

 

Jérôme SALAYET
Ingénieur Informatique
Tél :    04 67 87 61 12
Fax :   04 67 70 85 44
Site web : www.hymatom.fr <http://www.hymatom.fr/> 
Email : jerome.salayet at hymatom.fr <mailto:jerome.salayet at hymatom.fr> 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20130221/aacc303c/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 7598 bytes
Desc: image001.png
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20130221/aacc303c/attachment.png>


More information about the Libav-user mailing list