转自: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进行了封装,使读出的数据总是完整的帧