新版本ffmpeg的变动整理

转自:http://sheepssoft.blog.163.com/blog/static/178735990201210322520628/


新版本ffmpeg的变动整理


av_open_input_file() 改为 avformat_open_input() 且有参数上的变动:

 

一下函数文档来自:http://wiki.aasimon.org/doku.php?id=ffmpeg:av_open_input_file

av_open_input_file

Overview

Defined in avformat.h

Open a media file as input. The codecs are not opened. Only the file header (if present) is read.

NOTE: If no output is desired, used av_alloc_format_context instead.

int av_open_input_file(AVFormatContext **ic_ptr,                         const char *filename,                         AVInputFormat *fmt,                         int buf_size,                         AVFormatParameters *ap);

Parameters

ic_ptr
AVFormatContext **ic_ptr

A pointer to an AVFormatContext pointer. The opened media file handle is put here.

filename
const char *filename

Filename to open.

fmt
AVInputFormat *fmt

An AVInputFormat pointer. If non NULL, force the file format to use.

buf_size
int buf_size

Optional buffer size (zero if default is OK).

ap
AVFormatParameters *ap

An AVFormatParameters pointer containing additional parameters needed when opening the file (NULL if default).

Return value

0 if OK. AVERROR otherwise.

 

 

****************************************************************************************************************

 

dump_format() 更名为 av_dump_format()  参数与之前相同

 

****************************************************************************************************************

 

AVMediaType 的枚举类型有所变动:

以下解释来自于FFmpeg源码:

enum AVMediaType {
    AVMEDIA_TYPE_UNKNOWN = -1,  ///< Usually treated as AVMEDIA_TYPE_DATA
    AVMEDIA_TYPE_VIDEO,
    AVMEDIA_TYPE_AUDIO,
    AVMEDIA_TYPE_DATA,          ///< Opaque data information usually continuous
    AVMEDIA_TYPE_SUBTITLE,
    AVMEDIA_TYPE_ATTACHMENT,    ///< Opaque data information usually sparse
    AVMEDIA_TYPE_NB
};

 

**************************************************************************************************************

avcodec_decode_video()  变更为:avcodec_decode_video2() 并将 size 和 data 两参数整合成一个 const 的 Packet 参数


 **************************************************************************************************************

av_alloc_format_context() 弃用后使用 avcodec_alloc_context()


转自:http://t.hexun.com/17875038/15589174_d.html


av_read_frame - 新版本的ffmpeg用的是av_read_frame,而老版本的是av_read_packet。区别是av_read_packet读出的是包,它可能是半帧或多帧,不保证帧的完整性。av_read_frame对av_read_packet进行了封装,使读出的数据总是完整的帧



  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值