下载此文档

FFMpeg 中比较重要的函数以及数据结构.doc


文档分类:IT计算机 | 页数:约21页 举报非法文档有奖
1/21
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/21 下载此文档
文档列表 文档介绍
FFMpeg 中比较重要的函数以及数据结构 2010-07-27 14:47:19| 分类: ffmpeg 视频转换|标签: |字号大中小订阅 1. 数据结构: (1) AVFormatContext (2) AVOutputFormat (3) AVInputFormat (4) ontext (5) AVCodec (6) AVFrame (7) AVPacket (8) AVPicture (9) AVStream : (1) av_register_all() (2) avcodec_open() (3) avcodec_close() (4) av_open_input_file() (5) av_find_input_format() (6) av_find_stream_info() (7) av_close_input_file() : (1) avcodec_find_decoder() (2) avcodec_alloc_frame() (3) avpicture_get_size() (4) avpicture_fill() (5) img_convert() (6) avcodec_alloc_context() (7) avcodec_decode_video() (8) av_free_packet() (9) av_free() : (1) avnew_steam() (2) av_read_frame() (3) av_write_frame() (4) dump_format() : (1) avpicture_deinterlace() (2) ImgReSampleContext() 以下就根据,以上数据结构及函数在 ffmpeg 测试代码 中出现的前后顺进行分析。在此之前还是先谈一下 ffmpeg 的编译问题。在 linux 下的编译比较简单,这里不多说了。在 windows 下的编译可以参考以下网页: http://bbs./?tid=1897&extra=page%3D1 值得一提的是,在使用编译后的 sdk 进行测试时(用到 ffmpeg 目录下的 )编译过程中可能会有以下两个问题: 1. 用到了 这个头文件。然而这个头文件在 win 下和 linux 下有所不同。具体在 win 下可以用以下方法解决: tware/snprintf/ vc6 ,或是 vc6 的命令行进行编译, inline 可能不认。 文件中, 中加入#ifdef _MSC_VAR #define inline __inline #endif 交待完毕进入正题。一. FFMpeg 中的数据结构: I. AVFormatContext 一般在使用 ffmpeg sdk 的代码中 AVFormatContext 是一个贯穿始终的数据结构,很多函数都要用到它作为参数。 FFmpeg 代码中对这个数据结构的注释是: format I/O context 此结构包含了一个视频流的格式内容。其中存有了 AVInputFormat ( or AVOutputFormat 同一时间 AVFormatContext 内只能存在其中一个),和 AVStream 、 AVPacket 这几个重要的数据结构以及一些其他的相关信息,比如 title,author,copyright 等。还有一些可能在编解码中会用到的信息,诸如: duration, file_size, bit_rate 等。参考 头文件。 Useage: 声明: AVFormatContext *oc; (1) 初始化:由于 AVFormatConext 结构包含许多信息因此初始化过程是分步完成,而且有些变量如果没有值可用,也可不初始化。但是由于一般声明都是用指针因此一个分配内存过程不可少: oc = av_alloc_format_context(); (2) 结构中的 AVInputFormat* (或 AVOutputFormat* )是一定要初始化的,基本上这是编译码要使用什么 codec 的依据所在: oc->oformat = fmt; or oc->iformat = fmt; (3) 其中 AVOutputFormat* fmt 或 AVInputFormat* fmt 。( AVInputFormat and AVOutputForma t 的初始化在后面介绍。随后在参考代码 output

FFMpeg 中比较重要的函数以及数据结构 来自淘豆网www.taodocs.com转载请标明出处.

相关文档 更多>>
非法内容举报中心
文档信息
  • 页数21
  • 收藏数0 收藏
  • 顶次数0
  • 上传人gyzhluyin
  • 文件大小92 KB
  • 时间2017-02-24