diff --git a/pkg/h265/rtp.go b/pkg/h265/rtp.go index 27fc3a01..7a55b408 100644 --- a/pkg/h265/rtp.go +++ b/pkg/h265/rtp.go @@ -55,6 +55,14 @@ func RTPDepay(codec *core.Codec, handler core.HandlerFunc) core.HandlerFunc { case 1: // end buf = append(buf, data[3:]...) binary.BigEndian.PutUint32(buf[nuStart:], uint32(len(buf)-nuStart-4)) + case 3: // wrong RFC 7798 realisation from OpenIPC project + // A non-fragmented NAL unit MUST NOT be transmitted in one FU; i.e., + // the Start bit and End bit must not both be set to 1 in the same FU + // header. + nuType = data[2] & 0x3F + buf = binary.BigEndian.AppendUint32(buf, uint32(len(data))-1) // NAL unit size + buf = append(buf, (data[0]&0x81)|(nuType<<1), data[1]) + buf = append(buf, data[3:]...) } } else { nuStart = len(buf)