[FFmpeg-devel] H264 encoding and RTP muxing - calculating pts and dts

Dominik Tomczak dominiktomczak
Tue Jul 20 12:56:16 CEST 2010


Hello

My application uses libav libaries to encode frames with H264 and mux them
using RTP. The sequence is

int encodedBytes = avcodec_encode_video
if (encodedBytes > 0)
{
AVPacket packet;
...

av_interleaved_write_frame(&packet)
}

I get the video frames in RGB from my web camera, convert it to YUV but I
don't know how to set DTS and PTS values for packet. I can see that this is
an issue. Format context is set to RTP. I can see the packets are
transferred but RTP logs are:
[rtp @ 007CF040]st:0 error, non monotone timestamps -368934881474191031 >=
-368934881474191031
I want to play the video stream in VLC.

My question is - how to calculate DTS and PTS so that they can be correctly
streamed by RTP and viewed in VLC?

Regards
Dominik Tomczak
--



More information about the ffmpeg-devel mailing list