FFMPEG解码流程

1. 注册所有容器格式和CODEC: av_register_all()

2. 打开文件: avformat_open_input_file()

3. 从文件中提取流信息: avformat_find_stream_info()

4. 穷举所有的流,查找其中种类为CODEC_TYPE_VIDEO

5. 查找对应的解码器: avcodec_find_decoder()

6. 打开编解码器: avcodec_open2()

7. 为解码帧分配内存: avcodec_alloc_frame()

8. 不停地从码流中提取出帧数据: av_read_frame()

9. 判断帧的类型,对于视频帧调用: avcodec_decode_video()

10. 解码完后,释放解码器: avcodec_close()

11. 关闭输入文件:av_close_input_file()

posted @ 2012-04-06 23:16  Bruce-Hou  阅读(653)  评论(1编辑  收藏  举报