ffmpeg的简单例子

http://www.ffmpeg.com.cn/index.php/Output_example.c   ffmpeg项目中很典型的一个例程

http://www.rosoo.net/a/201110/15191.html   音视频文件码率与大小计算

http://blog.csdn.net/derryzhang/article/details/5133083  视频知识基础:什么是TS、PS流?

API分为4个部分Initialization,Decode,Image scaling,Video rendering。

Initialization:

avcodec_register_all

avcodec_find_encoder

avcodec_alloc_context

avcodec_alloc_frame

SDL_SetVideoMode

Decode:

avcodec_decode_video

Image scaling:

sws_getContext

sws_scale

Video rendering:

SDL_CreateYUVOverlay


API的具体说明。

FFmpeg API

描述

av_register_all()

Initializes libavformat and registers all the muxers, demuxers and protocols.

初始化libavformat和注册所有的混合器,分路和协议。

avcodec_find_decoder(…)

Finds a decoder with a matching codec ID.

找到一个可以匹配的编解码器ID的解码器。

avcodec_alloc_context()

Allocates an AVCodecContext and sets its fields to default values.

分配一个AVCodecContext,并设置其字段的默认值。

avcodec_alloc_frame()

Allocates an AVFrame and sets its fields to default values.

分配一个AVFrame,并设置其字段的默认值。

sws_getContext(…)

Returns an SwsContext to be used in sws_scale().

返回在sws_scale()使用的SwsContext。

sws_scale(…)

Scales the data in source according to our settings in our SwsContext c. srcStride and dstStride are the source and destination linesize.

avcodec_decode_video(…)

Decodes a video frame from buffer into picture.



av_register_all();

av_alloc_format_context()-------av_free()-----------生成或释放一个AVFormatContext结构体

url_fopen()-------url_fclose()------------打开或关闭一个输出文件


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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值