Hi
I calculate the pts value with this code:
avpkt.pts = av_rescale_q(cocontext->coded_frame->pts,
cocontext->time_base, videostm->time_base);
cocontext is the AVCodeccontex of the stream, and videostm the AvStream.
In my solution with Mpeg2 the dts value is set by the
av_interleaved_write_frame call.
Steffen
> 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
> _______________________________________________
> libav-user mailing list
> [email protected]
> https://lists.mplayerhq.hu/mailman/listinfo/libav-user
>
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user