hls: support proxying AV1 tracks (#2157)

This commit is contained in:
Alessandro Ros 2023-08-06 13:21:43 +02:00 committed by GitHub
parent d9b7878c3d
commit ff01e56dfe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 2 deletions

View File

@ -76,6 +76,22 @@ func (s *hlsSource) run(ctx context.Context, cnf *conf.PathConf, reloadConf chan
var medi *media.Media
switch tcodec := track.Codec.(type) {
case *codecs.AV1:
medi = &media.Media{
Type: media.TypeVideo,
Formats: []formats.Format{&formats.AV1{}},
}
c.OnDataAV1(track, func(pts time.Duration, obus [][]byte) {
stream.WriteUnit(medi, medi.Formats[0], &formatprocessor.UnitAV1{
BaseUnit: formatprocessor.BaseUnit{
NTP: time.Now(),
},
PTS: pts,
OBUs: obus,
})
})
case *codecs.H264:
medi = &media.Media{
Type: media.TypeVideo,

View File

@ -703,8 +703,6 @@ func (c *srtConn) runRead(req srtNewConnReq, pathName string, user string, pass
})
case *formats.MPEG1Audio:
// TODO: check whether's a MPEG-1 or MPEG-2 stream by parsing header
// of first frame
track := addTrack(medi, &mpegts.CodecMPEG1Audio{})
var startPTS time.Duration