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 : [email protected] <mailto:[email protected]> 

 

<<image001.png>>

_______________________________________________
Libav-user mailing list
[email protected]
http://ffmpeg.org/mailman/listinfo/libav-user

Reply via email to