On Thu, Mar 20, 2008 at 11:20:54AM +0000, Vladimir Eremeev wrote:
> > 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

You need to set all a the VBV / bitrate things correctly for the muxer
to be able to mux according to them ...


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

You need ES frames, that is a SINGLE ES frame on each call, you cannot pass 
any PES packet its payload with or without headers.


[...]
> 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);
> }

This code looks just invalid, first you must call the parser in a loop
and second you must pass timestamps through it, you cannot use PES timestamps
in av_write_frame().

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In a rich man's house there is no place to spit but his face.
-- Diogenes of Sinope

Attachment: signature.asc
Description: Digital signature

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

Reply via email to