diff --git a/src/Rtp/PSEncoder.cpp b/src/Rtp/PSEncoder.cpp index 5195626d..c6d64cac 100644 --- a/src/Rtp/PSEncoder.cpp +++ b/src/Rtp/PSEncoder.cpp @@ -124,7 +124,7 @@ void PSEncoder::inputFrame(const Frame::Ptr &frame) { _frame_merger.inputFrame(frame, [&](uint32_t dts, uint32_t pts, const Buffer::Ptr &buffer, bool have_idr) { track_info.stamp.revise(dts, pts, dts_out, pts_out); //取视频时间戳为TS的时间戳 - _timestamp = (uint32_t) dts_out; + _timestamp = (uint32_t) pts_out; ps_muxer_input(_muxer.get(), track_info.track_id, have_idr ? 0x0001 : 0, pts_out * 90LL, dts_out * 90LL, buffer->data(), buffer->size()); }); @@ -165,7 +165,7 @@ PSEncoderImp::~PSEncoderImp() { } void PSEncoderImp::onPS(uint32_t stamp, void *packet, size_t bytes) { - _rtp_encoder->inputFrame(std::make_shared((char *) packet, bytes, stamp)); + _rtp_encoder->inputFrame(std::make_shared((char *) packet, bytes, stamp, stamp)); } }//namespace mediakit