Luca, thank you for the answer.

Luca Abeni <[EMAIL PROTECTED]> writes:
 
> [...]
> > When I call av_write_frame() or av_interleaved_write_frame(), these 
functions complain:
> > 
> > "error, non monotonic time stamps <very-very long negative number> >= <the 
same number>"
> > or
> > "error, pts < dts" 
> > 
> > What was not set??
> Maybe the error is just the one described by the above message: you set 
> a wrong pts or dts?

Oh, sorry, I forgot.
I get these time stamps from the stream.
My code collects transport packets and assembles PES packets from them and then 
parses the PES headers.
I've explored the pts and dts values in the debugger, they are correct.
 
> Why cannot you just dump the PAT, the PMT, and the audio and video PIDs 
> in the output file, without using libavformat? That would be much simpler.

The output file must have correct header (one beginning from 00 00 01 ba).

 
> > I have developed a code, parsing the system information, contained in
> > the Transport stream.
> > FFmpeg functions are used to save elementary streams to a file.
> > 
> > Since I have no input file and have only parts of the stream in a
> > function, I cannot call av_open_input_file() and av_find_stream_info()
> > and have to create and fill all necessary data structures from scratch.
> You can call av_open_input_file() on the DVB device. I did it in the 
> past, and it worked quite well...

I develop the program on windows. There are some complications with the device 
and drivers.

> > Then I accumulate PES packets, set their PES_packet_size if it is 0 and
> > call av_write_frame() (I also tried av_interleaved_write_frame)
> I do not think av_write_frame() accepts PES packets. I think it wants 
> audio or video frames.

I tried supplying PES payload (that, containing MPEG video data), and 
av_write_frame() crashed the application.
 
> > The code (C++) follows.
> > 
> >     AVPacket avpacket;
> >     avpacket.stream_index = avstream->index; 
> >     avpacket.pts=el_pkt.m_PTS; //el_pkt is a class, storing a PES packet
> >     avpacket.dts=el_pkt.m_DTS;
> Without knowing how you compute m_PTS and m_DTS, it is not possible to 
> say if this is correct. But judging from the error message you get, you 
> are probably setting wrong values here.

These values come from the PES header, they are not computed.

Thanks again for your answer


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

Reply via email to