Question: keeping client connections alive after input stream interruptions #791
Replies: 1 comment
-
It is possible indeed, it's enough to create The stream can be made more coherent by manually filling nextSequenceNumber := 0
// called when receiving a RTP packet
ctx.Session.OnPacketRTPAny(func(medi *description.Media, _ format.Format, pkt *rtp.Packet) {
// make sure that PayloadType is the same advertised by the first publisher
pkt.PayloadType = 96
// recompute SequenceNumber
pkt.SequenceNumber = nextSequenceNumber++
// recompute Timestamp
pkt.Timestamp = (monothonic timestamp with a 90khz clock)
// route the RTP packet to all readers
sh.stream.WritePacketRTP(medi, pkt) //nolint:errcheck
}) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Description:
I'm new to RTSP and streaming. I’ve tried the server example in the
gortsplib
repo (https://github.com/bluenviron/gortsplib/blob/main/examples/server/main.go), but the clients get terminated when the input stream ends. My application already automatically restarts the FFmpeg process that sends the RTSP input stream.I think it's because the
sh.stream.Close()
when a new stream is announced what happens, when I'm restarting my ffmpeg input process.I would like to build a RTSP server that:
Example FFmpeg processes:
Questions:
gortsplib
?Beta Was this translation helpful? Give feedback.
All reactions