Skip to content

Commit

Permalink
support H264 with payload type 35 from Bosh Cameras (#632)
Browse files Browse the repository at this point in the history
Co-authored-by: aler9 <[email protected]>
  • Loading branch information
JTejedor and aler9 authored Oct 14, 2024
1 parent ef77f78 commit b561229
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/format/format.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,9 @@ func Unmarshal(md *psdp.MediaDescription, payloadTypeStr string) (Format, error)
case payloadType == 33:
return &MPEGTS{}

case payloadType == 35 && codec == "h264" && clock == "90000": // Bosch cameras
return &H264{}

// audio

case payloadType == 14:
Expand Down
33 changes: 33 additions & 0 deletions pkg/format/format_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -927,6 +927,39 @@ var casesFormat = []struct {
"packetization-mode": "1",
},
},
{
"video h264 bosch (issue gortsplib/632)",
"v=0\n" +
"o=- 0 0 IN IP4 10.100.14.102\n" +
"s=LIVE VIEW\n" +
"c=IN IP4 0.0.0.0\n" +
"t=0 0\n" +
"a=control:rtsp://10.100.14.102:554/?inst=2&h26x=4\n" +
"m=video 0 RTP/AVP 35\n" +
"a=rtpmap:35 H264/90000\n" +
"a=control:rtsp://10.100.14.102:554/?inst=2&h26x=4&stream=video\n" +
"a=recvonly\n" +
"a=fmtp:35 packetization-mode=1;profile-level-id=4d4029;sprop-parameter-sets=Z01AKY2NYDwBE/LgLcBDQECA,aO44gA==\n",
&H264{
PayloadTyp: 35,
SPS: []byte{
0x67, 0x4d, 0x40, 0x29, 0x8d, 0x8d, 0x60, 0x3c,
0x01, 0x13, 0xf2, 0xe0, 0x2d, 0xc0, 0x43, 0x40,
0x40, 0x80,
},
PPS: []byte{
0x68, 0xee, 0x38, 0x80,
},
PacketizationMode: 1,
},
35,
"H264/90000",
map[string]string{
"packetization-mode": "1",
"profile-level-id": "4D4029",
"sprop-parameter-sets": "Z01AKY2NYDwBE/LgLcBDQECA,aO44gA==",
},
},
{
"video h265",
"v=0\n" +
Expand Down

0 comments on commit b561229

Please sign in to comment.