mirror of
https://github.com/aler9/rtsp-simple-server
synced 2025-10-05 15:46:58 +08:00

Previously, RTP packets coming from sources other than RTSP (that actually are RTMP and HLS) were generated before the H264 remuxing, and that leaded to invalid streams, expecially when sourceOnDemand is true and the stream has invalid or dynamic SPS/PPS.
27 lines
414 B
Go
27 lines
414 B
Go
package core
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/pion/rtp"
|
|
)
|
|
|
|
// data is the data unit routed across the server.
|
|
// it must contain one or more of the following:
|
|
// - a single RTP packet
|
|
// - a group of H264 NALUs (grouped by timestamp)
|
|
// - a single AAC AU
|
|
type data struct {
|
|
trackID int
|
|
|
|
rtpPacket *rtp.Packet
|
|
|
|
// timing
|
|
ptsEqualsDTS bool
|
|
pts time.Duration
|
|
|
|
h264NALUs [][]byte
|
|
|
|
mpeg4AudioAU []byte
|
|
}
|