您好,欢迎来到年旅网。
搜索
您的当前位置:首页ffmpeg--avformat_find_stream_info

ffmpeg--avformat_find_stream_info

来源:年旅网

/**
 * Read packets of a media file to get stream information. This
 * is useful for file formats with no headers such as MPEG. This
 * function also computes the real framerate in case of MPEG-2 repeat
 * frame mode.
 * The logical file position is not changed by this function;
 * examined packets may be buffered for later processing.
 *

            **/

流程分析:

avformat_find_stream_info{

。。。

   for (;;) {    

                   for(i = 0; i < ic->nb_streams; i++) {

                            try_decode_frame{

                               AVCodecContext *avctx = st->internal->avctx;

                                     //解析后,放到st->internal->avctx

                            }

                   }

                   ...

    }

         ...

       ret =avcodec_parameters_from_context(st->codecpar, st->internal->avctx);

       //最终放到AVStreamAVCodecContext

   ret =avcodec_parameters_to_context(st->codec, st->codecpar);

       ...

}

堆栈如下:


read_frame_internal

如上所示堆栈,avformat_find_stream_info会调用read_frame_internal。

read_frame_internal会调用ff_read_packet读取一帧数据,例:如果是mpegts, 会解析PES,得到一帧数据。

因篇幅问题不能全部显示,请点此查看更多更全内容

Copyright © 2019- oldu.cn 版权所有 浙ICP备2024123271号-1

违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务