Also, extend the documentation about setting timestamps.
Unified · Split
| @@ -1629,10 +1629,17 @@ int avformat_write_header(AVFormatContext *s, AVDictionary **options); · 1628 unmodified lines | |||
| 1629 | * <br> | 1629 | * <br> |
| 1630 | * Packet's @ref AVPacket.stream_index "stream_index" field must be | 1630 | * Packet's @ref AVPacket.stream_index "stream_index" field must be |
| 1631 | * set to the index of the corresponding stream in @ref | 1631 | * set to the index of the corresponding stream in @ref |
| 1632 | * AVFormatContext.streams "s->streams". It is very strongly | 1632 | * AVFormatContext.streams "s->streams". |
| 1633 | * recommended that timing information (@ref AVPacket.pts "pts", @ref | 1633 | * <br> |
| 1634 | * AVPacket.dts "dts", @ref AVPacket.duration "duration") is set to | 1634 | * The timestamps (@ref AVPacket.pts "pts", @ref AVPacket.dts "dts") |
| 1635 | * correct values. | 1635 | * must be set to correct values in the stream's timebase (unless the |
| 1636 | * output format is flagged with the AVFMT_NOTIMESTAMPS flag, then | ||
| 1637 | * they can be set to AV_NOPTS_VALUE). | ||
| 1638 | * The dts for subsequent packets passed to this function must be strictly | ||
| 1639 | * increasing when compared in their respective timebases (unless the | ||
| 1640 | * output format is flagged with the AVFMT_TS_NONSTRICT, then they | ||
| 1641 | * merely have to be nondecreasing). @ref AVPacket.duration | ||
| 1642 | * "duration") should also be set if known. | ||
| 1636 | * @return < 0 on error, = 0 if OK, 1 if flushed and there is no more data to flush | 1643 | * @return < 0 on error, = 0 if OK, 1 if flushed and there is no more data to flush |
| 1637 | * | 1644 | * |
| 1638 | * @see av_interleaved_write_frame() | 1645 | * @see av_interleaved_write_frame() |
| @@ -1662,10 +1669,16 @@ int av_write_frame(AVFormatContext *s, AVPacket *pkt); · 23 unmodified lines | |||
| 1662 | * <br> | 1669 | * <br> |
| 1663 | * Packet's @ref AVPacket.stream_index "stream_index" field must be | 1670 | * Packet's @ref AVPacket.stream_index "stream_index" field must be |
| 1664 | * set to the index of the corresponding stream in @ref | 1671 | * set to the index of the corresponding stream in @ref |
| 1665 | * AVFormatContext.streams "s->streams". It is very strongly | 1672 | * AVFormatContext.streams "s->streams". |
| 1666 | * recommended that timing information (@ref AVPacket.pts "pts", @ref | 1673 | * <br> |
| 1667 | * AVPacket.dts "dts", @ref AVPacket.duration "duration") is set to | 1674 | * The timestamps (@ref AVPacket.pts "pts", @ref AVPacket.dts "dts") |
| 1668 | * correct values. | 1675 | * must be set to correct values in the stream's timebase (unless the |
| 1676 | * output format is flagged with the AVFMT_NOTIMESTAMPS flag, then | ||
| 1677 | * they can be set to AV_NOPTS_VALUE). | ||
| 1678 | * The dts for subsequent packets in one stream must be strictly | ||
| 1679 | * increasing (unless the output format is flagged with the | ||
| 1680 | * AVFMT_TS_NONSTRICT, then they merely have to be nondecreasing). | ||
| 1681 | * @ref AVPacket.duration "duration") should also be set if known. | ||
| 1669 | * | 1682 | * |
| 1670 | * @return 0 on success, a negative AVERROR on error. Libavformat will always | 1683 | * @return 0 on success, a negative AVERROR on error. Libavformat will always |
| 1671 | * take care of freeing the packet, even if this function fails. | 1684 | * take care of freeing the packet, even if this function fails. |