Browse Source

v121 fix for B-frames closing the stream

pull/2874/head
Roger Davenport 2 years ago
parent
commit
cb53c7b91b
  1. 2
      internal/core/core.go
  2. 7
      internal/core/webrtc_session.go

2
internal/core/core.go

@ -24,7 +24,7 @@ import ( @@ -24,7 +24,7 @@ import (
"github.com/bluenviron/mediamtx/internal/rlimit"
)
var version = "v0.0.0"
var version = "v1.2.1-roger"
var defaultConfPaths = []string{
"rtsp-simple-server.yml",

7
internal/core/webrtc_session.go

@ -44,7 +44,7 @@ func (webrtcTrackWrapper) PTSEqualsDTS(*rtp.Packet) bool { @@ -44,7 +44,7 @@ func (webrtcTrackWrapper) PTSEqualsDTS(*rtp.Packet) bool {
type setupStreamFunc func(*webrtc.OutgoingTrack) error
func webrtcFindVideoTrack(
func (s *webRTCSession) webrtcFindVideoTrack(
stream *stream.Stream,
writer *asyncwriter.Writer,
) (format.Format, setupStreamFunc) {
@ -189,7 +189,8 @@ func webrtcFindVideoTrack( @@ -189,7 +189,8 @@ func webrtcFindVideoTrack(
if !firstReceived {
firstReceived = true
} else if tunit.PTS < lastPTS {
return fmt.Errorf("WebRTC doesn't support H264 streams with B-frames")
//return fmt.Errorf("WebRTC doesn't support H264 streams with B-frames")
s.Log(logger.Warn, "WebRTC doesn't support H264 streams with B-frames")
}
lastPTS = tunit.PTS
@ -592,7 +593,7 @@ func (s *webRTCSession) runRead() (int, error) { @@ -592,7 +593,7 @@ func (s *webRTCSession) runRead() (int, error) {
writer := asyncwriter.New(s.writeQueueSize, s)
videoTrack, videoSetup := webrtcFindVideoTrack(res.stream, writer)
videoTrack, videoSetup := s.webrtcFindVideoTrack(res.stream, writer)
audioTrack, audioSetup := webrtcFindAudioTrack(res.stream, writer)
if videoTrack == nil && audioTrack == nil {

Loading…
Cancel
Save