Hi guys,

In av_write_frame()->compute_muxer_pkt_fields()

we have
 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);
    }

May I know why we need DTS <= PTS. I understand a frame need to be decoded
before it can be shown.

Say we has packets in [DTS, PTS]: [10, 0], [11, 2], [12, 3]

If decoding and display reference different clocks, DTS and PTS can be
totally decoupled and above is a valid sequence packets.

If DTS and PTS reference a same clock which means first packet needed to be
decoded at starttime + 10 but display at starttime + 0, of couse it's
invalid. So ffmpeg interprets DTS, PTS this way?


Thanks
_______________________________________________
Libav-user mailing list
Libav-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user

Reply via email to