Ffmpeg开发手册
From Ffmpeg工程组
目录 |
[编辑] FFMPEG之初始化
与FFMPEG初始化和收尾工作相关的函数;
[编辑] av_register_all()
说明:注册全部的文件格式和编解码器;
函数调用代码示例:
av_register_all();
备注:暂无;
[编辑] avcodec_open()
[编辑] avcodec_close()
[编辑] av_open_input_file()
[编辑] av_find_input_format()
[编辑] av_find_stream_info()
[编辑] av_close_input_file()
[编辑] FFMPEG之文件操作
与FFMPEG文件操作相关的函数; 说明:从视频流中读取一帧数据;文件中包含视频流和音频流,他们以包的形式存在。
函数调用代码示例
// FIXME
AVFormatContext *pf_format_context;
AVPacket f_packet;
//
// Open video file
if ( av_open_input_file(&pm_format_context, f_filename, pm_iformat, 0, pm_format_params) != 0 ){
fprintf(stderr, "av_open_input_file %s\n", strerror(errno));
return false;
}
// Retrieve stream information
if (av_find_stream_info (pm_format_context) < 0){
fprintf(stderr, "av_find_stream_info %s\n", strerror(errno));
return false;
}
if ( av_read_frame (pm_format_context, &f_packet) < 0 ){
fprintf(stderr, "Can't read frames!");
}
备注:
/**
* Return the next frame of a stream. * * The returned packet is valid * until the next av_read_frame() or until av_close_input_file() and * must be freed with av_free_packet. For video, the packet contains * exactly one frame. For audio, it contains an integer number of * frames if each frame has a known fixed size (e.g. PCM or ADPCM * data). If the audio frames have a variable size (e.g. MPEG audio), * then it contains one frame. * * pkt->pts, pkt->dts and pkt->duration are always set to correct * values in AV_TIME_BASE unit (and guessed if the format cannot * provided them). pkt->pts can be AV_NOPTS_VALUE if the video format * has B frames, so it is better to rely on pkt->dts if you do not * decompress the payload. * * @return 0 if OK, < 0 if error or end of file. */
[编辑] av_write_frame()
[编辑] dump_format()
[编辑] FFMPEG之音视频解码器
与FFMPEG音视频处理相关的主要函数;
[编辑] avcodec_find_decoder()
[编辑] avcodec_alloc_frame()
[编辑] avpicture_get_size()
[编辑] avpicture_fill()
[编辑] img_convert()
[编辑] avcodec_alloc_context()
[编辑] avcodec_decode_audio()
[编辑] avcodec_decode_video()
[编辑] av_free_packet()
[编辑] av_free()
[编辑] FFMPEG之其他函数参考
其它相关的比较重要的函数;
[编辑] avpicture_deinterlace()
[编辑] FFMPEG之重要数据结构参考
列出对重要数据结构的定义,说明;
[编辑] AVFormatContext
这个结构体会记录有关Format的许多信息,在面向文件格式的时候,这是一个主要的结构体。 目前我知道他会包含一些流,音频或视频的流,并且会有一个最数目,人们加入的流不能超过这个数目。
[编辑] AVFormatParameters
[编辑] AVCodecContext
[编辑] AVCodec
[编辑] AVFrame
[编辑] AVPacket
[编辑] AVPicture
[编辑] AVStream
[编辑] FFMPEG之其它数据结构参考
其它相关的比较重要的数据结构;
[编辑] ImgReSampleContext
对ffmpeg库的各函数主要是常用函数的注释和分析
