<div><br></div><div> c->codec_id = CODEC_ID_H264;<br></div> //c->codec_id = codec_id;<br> c->codec_type = AVMEDIA_TYPE_VIDEO;<br><br> c->bit_rate = 400000;<br> c->width = 320;<br>
c->height = 240;<br> c->time_base = (AVRational){1,25};<br> c->gop_size = 10;<br> //c->pix_fmt = PIX_FMT_YUYV; <br> c->pix_fmt = PIX_FMT_YUV420P;<br>
<br><div>package:<br></div><div><br></div>AVPacket pkt;<br> av_init_packet(&pkt);<br>if(c->coded_frame->pts != AV_NOPTS_VALUE)<br>{<br>pkt.pts = av_rescale_q(c->coded_frame->pts,c->time_base,en_info->video_st->time_base); <br>
}<br><br>if(c->coded_frame->key_frame)<br>pkt.flags |= AV_PKT_FLAG_KEY;<br>pkt.stream_index = en_info->video_st->index;<br>pkt.data = en_info->video_outbuf;<br>pkt.size = en_info->out_size;<br>printf("4\n");<br>
<div>ret = av_interleaved_write_frame( en_info->oc , &pkt );<br></div><div><br></div><div>I set all as you can see above .but i always get some error at av_interleaved_write_frame </div><div>error:</div><div>[mpeg @ 0x94142c0] buffer underflow i=0 bufi=22 size=2065<br>
[mpeg @ 0x94142c0] buffer underflow i=0 bufi=2051 size=2065<br></div><div>how can i solve the problem ?any advice will be great appreciate!!!</div>