[Libav-user] ffmpeg(0.10.2) and x264 encode question

qiu guo guoqiu413 at gmail.com
Sat Sep 15 10:49:31 CEST 2012


c->codec_id = CODEC_ID_H264;
//c->codec_id = codec_id;
c->codec_type = AVMEDIA_TYPE_VIDEO;

c->bit_rate = 400000;
c->width = 320;
c->height = 240;
c->time_base = (AVRational){1,25};
c->gop_size = 10;
//c->pix_fmt = PIX_FMT_YUYV;
c->pix_fmt = PIX_FMT_YUV420P;

package:

AVPacket pkt;
av_init_packet(&pkt);
if(c->coded_frame->pts != AV_NOPTS_VALUE)
{
pkt.pts =
av_rescale_q(c->coded_frame->pts,c->time_base,en_info->video_st->time_base);

}

if(c->coded_frame->key_frame)
pkt.flags |= AV_PKT_FLAG_KEY;
pkt.stream_index = en_info->video_st->index;
pkt.data = en_info->video_outbuf;
pkt.size = en_info->out_size;
printf("4\n");
ret = av_interleaved_write_frame( en_info->oc , &pkt );

I set all as you can see above .but i always get some error at
av_interleaved_write_frame
error:
[mpeg @ 0x94142c0] buffer underflow i=0 bufi=22 size=2065
[mpeg @ 0x94142c0] buffer underflow i=0 bufi=2051 size=2065
how can i solve the problem ?any advice will be great appreciate!!!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20120915/77f9ff7d/attachment.html>


More information about the Libav-user mailing list