FFmpeg源代码:avcodec_open2()
                                                            生活随笔
收集整理的這篇文章主要介紹了
                                FFmpeg源代码:avcodec_open2()
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.                        
                                本文簡單分析FFmpeg的avcodec_open2()函數(shù)。該函數(shù)用于初始化一個音視頻編解碼器的AVCodecContext。avcodec_open2()的聲明位于libavcodec\avcodec.h,如下所示。
/*** Initialize the AVCodecContext to use the given AVCodec. Prior to using this* function the context has to be allocated with avcodec_alloc_context3().** The functions avcodec_find_decoder_by_name(), avcodec_find_encoder_by_name(),* avcodec_find_decoder() and avcodec_find_encoder() provide an easy way for* retrieving a codec.** @warning This function is not thread safe!** @note Always call this function before using decoding routines (such as* @ref avcodec_receive_frame()).** @code* av_dict_set(&opts, "b", "2.5M", 0);* codec = avcodec_find_decoder(AV_CODEC_ID_H264);* if (!codec)* exit(1);** context = avcodec_alloc_context3(codec);** if (avcodec_open2(context, codec, opts) < 0)* exit(1);* @endcode** @param avctx The c總結(jié)
以上是生活随笔為你收集整理的FFmpeg源代码:avcodec_open2()的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
                            
                        - 上一篇: PMP之敏捷图表之产品地图VS产品路线图
 - 下一篇: FFMPEG结构体分析之AVCodec