mirror of
https://github.com/bluenviron/mediamtx
synced 2024-12-16 19:54:59 +00:00
hls: support proxying AV1 tracks (#2157)
This commit is contained in:
parent
d9b7878c3d
commit
ff01e56dfe
@ -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,
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user