-
感谢大佬提供的库,不知道是否能提供一下帮助。 1、使用了
4、使用ffplay、vlc、openRTSP 可以正常播放第三步的rtsp流; |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 9 replies
-
看ffmpeg的输出是没有pps, 有抓包吗,可以直接抓个包 |
Beta Was this translation helpful? Give feedback.
-
rtp打包h264的时候,看样子没有把 00 00 01 去掉,这样gomedia识别出来的Nalu type 只有0,如果rtp流中不存在sps pps,gomedia只有在I帧的时候才会把sps pps (sdp中解析出来的sps pps) 带上,如果估计是这个原因 |
Beta Was this translation helpful? Give feedback.
-
在HandleDescribe 函数里面加入一下代码,解析sdp里面的sps pps,然后把sps pps 写入到文件开头在播放试试 for _, media := range sdpcontext.Medias {
tmp := strings.ToLower(media.EncodeName)
switch tmp {
case "h264":
fmtpHandle := sdp.NewH264FmtpParam()
fmtpHandle.Load(media.Attrs["fmtp"])
sps, pps := fmtpHandle.GetSpsPps()
case "h265":
fmtpHandle := sdp.NewH265FmtpParam()
fmtpHandle.Load(media.Attrs["fmtp"])
vps, sps, pps := fmtpHandle.GetVpsSpsPps()
}
} |
Beta Was this translation helpful? Give feedback.
-
这个err 有打印吗,应该会刷 unsupport h264 rtp packet type
|
Beta Was this translation helpful? Give feedback.
-
这种情况,rtp没法解析出sps pps gomedia/go-rtsp/rtp/rtp-h264.go Line 251 in 67da098 在本地把这行改成 |
Beta Was this translation helpful? Give feedback.
-
用 TrackLocalStaticSample 把,直接写入h264 frame |
Beta Was this translation helpful? Give feedback.
有条件的话,去除 "00 00 01" 或 "00 00 00 01"吧,现在 是不符合rfc标准的