mirror of
https://github.com/bluenviron/mediamtx
synced 2025-01-13 10:26:34 +00:00
rtmp server: stop inserting a AV_SEQHDR message before every IDR
AV_SEQHDR contains SPS and PPS. It is useless to resend it after initialization since SPS/PPS are automatically added before every IDR.
This commit is contained in:
parent
4990e98993
commit
51e0bbd975
@ -404,28 +404,6 @@ func (c *rtmpConn) runRead(ctx context.Context, u *url.URL) error {
|
||||
pts -= videoStartDTS
|
||||
}
|
||||
|
||||
// insert a H264DecoderConfig before every IDR
|
||||
if idrPresent {
|
||||
sps := videoTrack.SafeSPS()
|
||||
pps := videoTrack.SafePPS()
|
||||
|
||||
buf, _ := h264conf.Conf{
|
||||
SPS: sps,
|
||||
PPS: pps,
|
||||
}.Marshal()
|
||||
|
||||
err = c.conn.WriteMessage(&message.MsgVideo{
|
||||
ChunkStreamID: 6,
|
||||
MessageStreamID: 1,
|
||||
IsKeyFrame: true,
|
||||
H264Type: flvio.AVC_SEQHDR,
|
||||
Payload: buf,
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
avcc, err := h264.AVCCMarshal(data.h264NALUs)
|
||||
if err != nil {
|
||||
return err
|
||||
|
Loading…
Reference in New Issue
Block a user