You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a camera generating RTP packets with too high MTU. To fix this, I feed the packets to the h264 rtp depacketizer, and then to the h264 rtp packetizer using a proper MTU. To test this I am using GStreamer:
This gives me RTP packets where every timestamp contains 2 NAL units with each unit split into 2 packets:
The h264 rtp depacketizer looks for the first packet with NAL unit type FUA and only adds the separator for that. This results in the packetizer merging the 2 NAL units into one which then causes errors in the video player.
If instead of looking for the first FUA packet, I change the depacketizer to check if the NAL unit fragment header isStart() the feed works as expected:
diff --git a/src/h264rtpdepacketizer.cpp b/src/h264rtpdepacketizer.cpp
index f2ddabb4..15126f21 100644
--- a/src/h264rtpdepacketizer.cpp
+++ b/src/h264rtpdepacketizer.cpp
@@ -67,7 +67,7 @@ message_vector H264RtpDepacketizer::buildFrames(message_vector::iterator begin,
auto nalUnitFragmentHeader = NalUnitFragmentHeader{
std::to_integer<uint8_t>(pkt->at(rtpHeaderSize + sizeof(NalUnitHeader)))};
- if (nFrags++ == 0) {
+ if (nalUnitFragmentHeader.isStart()) {
addSeparator(accessUnit);
accessUnit.emplace_back(
byte(nalUnitHeader.idc() | nalUnitFragmentHeader.unitType()));
The text was updated successfully, but these errors were encountered:
Good catch, thank you for reporting! I push the suggested fix in #1167 (It also ensures a separator is always written at the beginning of the access unit).
I have a camera generating RTP packets with too high MTU. To fix this, I feed the packets to the h264 rtp depacketizer, and then to the h264 rtp packetizer using a proper MTU. To test this I am using GStreamer:
This gives me RTP packets where every timestamp contains 2 NAL units with each unit split into 2 packets:
The h264 rtp depacketizer looks for the first packet with NAL unit type FUA and only adds the separator for that. This results in the packetizer merging the 2 NAL units into one which then causes errors in the video player.
If instead of looking for the first FUA packet, I change the depacketizer to check if the NAL unit fragment header
isStart()
the feed works as expected:The text was updated successfully, but these errors were encountered: