1.当使用 avcodec_find_encoder_by_name找到编码器的时候,
const AVCodec * aacencoder = avcodec_find_encoder_by_name("libx264");
编码器 有值的是:
id AV_CODEC_ID_H264 (27)
long_name libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
name libx264
pix_fmts AV_PIX_FMT_YUV420P (0)
type AVMEDIA_TYPE_VIDEO (0)
2.当调用 AVCodecContext *aacencodercontext = avcodec_alloc_context3(aacencoder); 后。
编码器中和上面一样,没有啥变化
编码器上下文里面有内容的是:
编码器上下文中的 codec_id 和 codec_type 是有值的,其他的都重新赋值了默认值
codec_id AV_CODEC_ID_H264 (27)
codec_type AVMEDIA_TYPE_VIDEO (0)
如下举例的默认值:
s->time_base = (AVRational){0,1};
s->framerate = (AVRational){ 0, 1 };
s->pkt_timebase = (AVRational){ 0, 1 };
3.当调用了 avcodec_