[Libav-user] pts < dts error

YIRAN LI mrfun.china at gmail.com
Tue Oct 13 09:04:36 CEST 2015


Hi Guys,

I'm using Window Media Foundation H.264 encoder to encode video frames and
use ffmpeg as a muxer.

The frames returned by the encoder has following timestamps

pts = 0, dts = 0
pts = 2, dts = 1
pts = 1, dts = 2
pts = 4, dts = 3
pts = 3, dts = 4
pts = 6, dts = 5
pts = 5, dts = 6
pts = 8, dts = 7
pts = 7, dts = 8
pts = 10, dts = 9
pts = 9, dts = 10
pts = 12, dts = 11
pts = 11, dts = 12
pts = 14, dts = 13
pts = 13, dts = 14
pts = 16, dts = 15
pts = 15, dts = 16
pts = 18, dts = 17
pts = 17, dts = 18
pts = 20, dts = 19
pts = 19, dts = 20
pts = 22, dts = 21
pts = 21, dts = 22
pts = 24, dts = 23
pts = 23, dts = 24
pts = 26, dts = 25

But when I use av_write_frame to write these packets, some error are
returned.

Checking the sourcecode I can see that compute_pkt_fields2 in
libavformat/mux.c rejects some frames


    if (pkt->dts != AV_NOPTS_VALUE && pkt->pts != AV_NOPTS_VALUE && pkt->pts
< pkt->dts) {
        av_log(s, AV_LOG_ERROR,
               "pts (%s) < dts (%s) in stream %d\n",
               av_ts2str(pkt->pts), av_ts2str(pkt->dts),
               st->index);
        return AVERROR(EINVAL);
    }

Can someone give any suggestion how to do in this case?

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20151013/ed98771a/attachment.html>


More information about the Libav-user mailing list