Support codecs negotiation for MSE

This commit is contained in:
Alexey Khit
2022-11-23 21:45:10 +03:00
parent 3c3e9d282b
commit 65e7efa775
3 changed files with 53 additions and 2 deletions
+6
View File
@@ -12,6 +12,7 @@ import (
type Consumer struct {
streamer.Element
Medias []*streamer.Media
UserAgent string
RemoteAddr string
@@ -23,6 +24,11 @@ type Consumer struct {
}
func (c *Consumer) GetMedias() []*streamer.Media {
if c.Medias != nil {
return c.Medias
}
// default medias
return []*streamer.Media{
{
Kind: streamer.KindVideo,
+3 -2
View File
@@ -35,8 +35,9 @@ func (m *Muxer) MimeType(codecs []*streamer.Codec) string {
case streamer.CodecH264:
s += "avc1." + h264.GetProfileLevelID(codec.FmtpLine)
case streamer.CodecH265:
// +Safari +Chrome +Edge -iOS15 -Android13
s += "hvc1.1.6.L93.B0" // hev1.1.6.L93.B0
// H.265 profile=main level=5.1
// hvc1 - supported in Safari, hev1 - doesn't, both supported in Chrome
s += "hvc1.1.6.L153.B0"
case streamer.CodecAAC:
s += "mp4a.40.2"
}