File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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
5052const (
@@ -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 {
You can’t perform that action at this time.
0 commit comments