AVCodecContext结构体

本文详细介绍了FFmpeg中关键参数的作用及使用场景,包括比特率设置、时间基准定义、分辨率配置、像素格式选择及运动估计算法等,对于理解并掌握FFmpeg的编码与解码过程非常有用。

这里先只列出已经用到的部分,便于自己查看(节选自http://blog.youkuaiyun.com/leixiaohua1020/article/details/14214859):

  1. /** 
  2.      * the average bitrate 
  3.      * - encoding: Set by user; unused for constant quantizer encoding. 
  4.      * - decoding: Set by libavcodec. 0 or some bitrate if this info is available in the stream. 
  5.      */  
  6.     int bit_rate;  
  1. /** 
  2.      * This is the fundamental unit of time (in seconds) in terms 
  3.      * of which frame timestamps are represented. For fixed-fps content, 
  4.      * timebase should be 1/framerate and timestamp increments should be 
  5.      * identically 1. 
  6.      * - encoding: MUST be set by user. 
  7.      * - decoding: Set by libavcodec. 
  8.      */  
  9.     AVRational time_base;  
  1.     /* video only */  
  2.     /** 
  3.      * picture width / height. 
  4.      * - encoding: MUST be set by user. 
  5.      * - decoding: Set by libavcodec. 
  6.      * Note: For compatibility it is possible to set this instead of 
  7.      * coded_width/height before decoding. 
  8.      */  
  9.     int width, height;  
  10.   
  11.     /** 
  12.      * Bitstream width / height, may be different from width/height if lowres enabled. 
  13.      * - encoding: unused 
  14.      * - decoding: Set by user before init if known. Codec should override / dynamically change if needed. 
  15.      */  
  16.     int coded_width, coded_height; 
  1.     /** 
  2.      * Pixel format, see AV_PIX_FMT_xxx. 
  3.      * May be set by the demuxer if known from headers. 
  4.      * May be overridden by the decoder if it knows better. 
  5.      * - encoding: Set by user. 
  6.      * - decoding: Set by user if known, overridden by libavcodec if known 
  7.      */  
  8.     enum AVPixelFormat pix_fmt;  
  9.   
  10.     /** 
  11.      * Motion estimation algorithm used for video coding. 
  12.      * 1 (zero), 2 (full), 3 (log), 4 (phods), 5 (epzs), 6 (x1), 7 (hex), 
  13.      * 8 (umh), 9 (iter), 10 (tesa) [7, 8, 10 are x264 specific, 9 is snow specific] 
  14.      * - encoding: MUST be set by user. 
  15.      * - decoding: unused 
  16.      */  
  17.     int me_method;

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值