ffmpeg音视频解封装

一 . 解封装

  1.av_register_all : open 一次就调用一次

  2.avformat_network_init() : 网络模块初始化

  3.avformat_open_input(...) : 打开文件并解析音/视频流的格式和音视频的参数和索引

  4.avformat_find_stream_info(...) : 去查找文件的格式和索引

  5.av_find_best_stream(...) : 确定是音频还是视频

  6.AVFormatContext  AVStream  AVPacket  : 不仅解封装还有加封装也用这个

   AVStream :  stream 数组存放每一个流的参数信息

   AVPacket  :  解封装完一个一个的数据包

  7.av_read_frame : 读取AVPacket的数据

二.avformat_open_input的参数讲解

  1.AVFormatContext  **ps  可以改变指针的地址

  2.const char *url  -------->   数据的地址(http rtp 本地)

  3.AVInputFormat *fmt ------->  指定输入封装格式,一般参数为null,自行去探测

  4.AVDictionary  **options ------->  一组key-value的数组 

三.AVFormatContext 的函数成员

  1.AVIOContext  *pb  : 自定义读写格式或者从内存来读

  2.char filename[1024] : 把打开文件的名字保存起来(譬如断开或者重连)

  3.unsigned int nb_stream :  

  4.AVStream  **streams :

猜你喜欢

转载自www.cnblogs.com/liunx1109/p/9263792.html