mirror of
https://github.com/aler9/rtsp-simple-server
synced 2025-10-16 04:30:52 +08:00
hls source: support proxying H265 and Opus tracks
This commit is contained in:
@@ -83,6 +83,18 @@ func (s *hlsSource) run(ctx context.Context) error {
|
||||
}
|
||||
})
|
||||
|
||||
case *format.H265:
|
||||
c.OnData(track, func(pts time.Duration, dat interface{}) {
|
||||
err := stream.writeData(medi, ctrack, &formatprocessor.DataH265{
|
||||
PTS: pts,
|
||||
AU: dat.([][]byte),
|
||||
NTP: time.Now(),
|
||||
})
|
||||
if err != nil {
|
||||
s.Log(logger.Warn, "%v", err)
|
||||
}
|
||||
})
|
||||
|
||||
case *format.MPEG4Audio:
|
||||
c.OnData(track, func(pts time.Duration, dat interface{}) {
|
||||
err := stream.writeData(medi, ctrack, &formatprocessor.DataMPEG4Audio{
|
||||
@@ -94,6 +106,18 @@ func (s *hlsSource) run(ctx context.Context) error {
|
||||
s.Log(logger.Warn, "%v", err)
|
||||
}
|
||||
})
|
||||
|
||||
case *format.Opus:
|
||||
c.OnData(track, func(pts time.Duration, dat interface{}) {
|
||||
err := stream.writeData(medi, ctrack, &formatprocessor.DataOpus{
|
||||
PTS: pts,
|
||||
Frame: dat.([]byte),
|
||||
NTP: time.Now(),
|
||||
})
|
||||
if err != nil {
|
||||
s.Log(logger.Warn, "%v", err)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user