Skip to content

Commit 8f5fce4

Browse files
committed
Add support HTTP-FLV with H265 from new Reolink cameras #1938
1 parent b705cad commit 8f5fce4

2 files changed

Lines changed: 11 additions & 6 deletions

File tree

pkg/flv/muxer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func (m *Muxer) GetInit() []byte {
3434
switch codec.Name {
3535
case core.CodecH264:
3636
b[4] |= FlagsVideo
37-
obj["videocodecid"] = CodecAVC
37+
obj["videocodecid"] = CodecH264
3838

3939
case core.CodecAAC:
4040
b[4] |= FlagsAudio

pkg/flv/producer.go

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ const (
4444
TagData = 18
4545

4646
CodecAAC = 10
47-
CodecAVC = 7
47+
48+
CodecH264 = 7
49+
CodecHEVC = 12
4850
)
4951

5052
const (
@@ -207,15 +209,18 @@ func (c *Producer) probe() error {
207209
} else {
208210
_ = pkt.Payload[0] >> 4 // FrameType
209211

210-
if codecID := pkt.Payload[0] & 0b1111; codecID != CodecAVC {
212+
if packetType := pkt.Payload[1]; packetType != PacketTypeAVCHeader { // check if header
211213
continue
212214
}
213215

214-
if packetType := pkt.Payload[1]; packetType != PacketTypeAVCHeader { // check if header
216+
switch codecID := pkt.Payload[0] & 0b1111; codecID {
217+
case CodecH264:
218+
codec = h264.ConfigToCodec(pkt.Payload[5:])
219+
case CodecHEVC:
220+
codec = h265.ConfigToCodec(pkt.Payload[5:])
221+
default:
215222
continue
216223
}
217-
218-
codec = h264.ConfigToCodec(pkt.Payload[5:])
219224
}
220225

221226
media := &core.Media{

0 commit comments

Comments
 (0)