> The first error you quoted (non monotonic timestamps) means that you 
> called av_write_frame() two times with the dame PTS or DTS value. Since 
> two different frames cannot have the same timestamp, this is an error, 
> and the library is complaining. If you do not believe this theory, try 
> printing the PTS and DTS before calling av_write_frame().
> 
>                               Luca

Thank you for your help. Now I've done with these errors.
But currently I am getting another ones.

Every time, when called av_write_frame give bunches of messages like the 
following.

[svcd @ 0089E7C0]buffer underflow i=0 bufi=0 size=9304
[svcd @ 0089E7C0]buffer underflow i=0 bufi=0 size=9304
[svcd @ 0089E7C0]buffer underflow i=0 bufi=2016 size=9304
[svcd @ 0089E7C0]buffer underflow i=0 bufi=4040 size=9304
[svcd @ 0089E7C0]buffer underflow i=0 bufi=6064 size=9304
[svcd @ 0089E7C0]buffer underflow i=0 bufi=8088 size=9304

I tried to give to the library the complete accumulated PES packet (with the 
header) or its payload (without the header), nothing helps:

buffer=el_pkt.GetPESPacket(&payload_size);

// or
// buffer=el_pkt.GetPayload(&payload_size);

AVPacket avpacket;
avpacket.pts=(el_pkt.m_PTS_DTS_flags & 0x02) ? el_pkt.m_PTS : AV_NOPTS_VALUE;
avpacket.dts=(el_pkt.m_PTS_DTS_flags & 0x01) ? el_pkt.m_DTS : AV_NOPTS_VALUE;
avpacket.duration=(int64_t)0;   
avpacket.data=buffer;
avpacket.size=payload_size;
int r = av_write_frame(m_pFormatCtx, &avpacket);



I also tried av_parser_parse: 

buffer=el_pkt.GetPayload(&payload_size);
int r=av_parser_parse(st->parser,codec_ctx,&samples,&frame_size,
                      buffer,payload_size,el_pkt.m_PTS,el_pkt.m_DTS);

if(frame_size>0) {
  AVPacket avpacket;
  avpacket.pts=(el_pkt.m_PTS_DTS_flags & 0x02) ? el_pkt.m_PTS : AV_NOPTS_VALUE;
  avpacket.dts=(el_pkt.m_PTS_DTS_flags & 0x01) ? el_pkt.m_DTS : AV_NOPTS_VALUE;
  avpacket.duration=(int64_t)0;   
  avpacket.data=samples;
  avpacket.size=frame_size;
  int r = av_write_frame(m_pFormatCtx, &avpacket);
}

Any time I get these "buffer underflows", and the file is not played in vlc.
VLC shows the black screen

Vladimir.


_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to