Compare commits

...

5 Commits

Author SHA1 Message Date
imp_rayjay
6a3af7ba14
Merge 6119ac9c53 into de7afaf992 2024-09-26 17:06:41 +08:00
xiongguangjie
de7afaf992
Avoid negative PTS in the RTSP protocol (#3929 #3815)
Some checks failed
Android / build (push) Has been cancelled
CodeQL / Analyze (cpp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
Docker / build (push) Has been cancelled
Linux / build (push) Has been cancelled
macOS / build (push) Has been cancelled
Windows / build (push) Has been cancelled
Optimaztion for issue #3815 ffmpeg rtsp pull stream has negative pts
2024-09-26 10:59:41 +08:00
rayjay
6119ac9c53 rtp推流增加PCM音频的处理 2024-03-28 11:21:23 +08:00
rayjay
a33c1d5a08 Merge branch 'master' of https://github.com/ZLMediaKit/ZLMediaKit 2024-03-28 11:15:19 +08:00
rayjay
e7e157c312 打包mjepg rtp的时候增加支持DRI(原先只在解包的时候支持,打包的时候并不支持) 2024-02-19 11:20:06 +08:00
3 changed files with 15 additions and 3 deletions

View File

@ -105,6 +105,16 @@ bool GB28181Process::inputRtp(bool, const char *data, size_t data_len) {
_rtp_decoder[pt] = Factory::getRtpDecoderByCodecId(track->getCodecId());
break;
}
case Rtsp::PT_L16_Mono: {
//L16
ref = std::make_shared<RtpReceiverImp>(16000, [this](RtpPacket::Ptr rtp) { onRtpSorted(std::move(rtp)); });
auto track = Factory::getTrackByCodecId(CodecL16, 16000, 1, 16);
CHECK(track);
track->setIndex(pt);
_interface->addTrack(track);
_rtp_decoder[pt] = Factory::getRtpDecoderByCodecId(track->getCodecId());
break;
}
default: {
if (pt == opus_pt) {
// opus负载 [AUTO-TRANSLATED:defa6a8d]

View File

@ -54,7 +54,9 @@ void RtspMediaSource::onWrite(RtpPacket::Ptr rtp, bool keyPos) {
assert(rtp->type >= 0 && rtp->type < TrackMax);
auto &track = _tracks[rtp->type];
auto stamp = rtp->getStampMS();
if (track) {
bool is_video = rtp->type == TrackVideo;
// 音频总是更新,视频在关键包时更新
if (track && ((keyPos && _have_video && is_video) || (!is_video))) {
track->_seq = rtp->getSeq();
track->_time_stamp = rtp->getStamp() * uint64_t(1000) / rtp->sample_rate;
track->_ssrc = rtp->getSSRC();
@ -77,7 +79,7 @@ void RtspMediaSource::onWrite(RtpPacket::Ptr rtp, bool keyPos) {
regist();
}
}
bool is_video = rtp->type == TrackVideo;
PacketCache<RtpPacket>::inputPacket(stamp, is_video, std::move(rtp), keyPos);
}

View File

@ -833,7 +833,7 @@ void RtspSession::handleReq_Play(const Parser &parser) {
rtp_info << "url=" << track->getControlUrl(_content_base) << ";"
<< "seq=" << track->_seq << ";"
<< "rtptime=" << (int) (track->_time_stamp * (track->_samplerate / 1000)) << ",";
<< "rtptime=" << (int64_t)(track->_time_stamp) * (int64_t)(track->_samplerate/ 1000) << ",";
}
rtp_info.pop_back();