确定RTSP流是否包含PPS和SPS信息

发布于 2025-01-31 21:15:52 字数 598 浏览 3 评论 0原文

我正在使用GSTREAMER摄入各种安全摄像机RTSP流。在大多数情况下,我使用的管道类似于此

gst-launch-1.0 rtspsrc location=rtsp://<username:password@$RTSPURL> protocols=4 name=rtspsrc0 rtspsrc0. ! rtph264depay ! tee name=t t.! queue ! hlssink2 name=ingest2 playlist-length=5 max-files=10 target-duration=2 playlist-location=stream.m3u8 location=segment_%d.ts

,但是轴摄像机似乎根本没有发送SPS ANSD PPS Nalus。为了解决此问题,我必须使用H264Parse config-Interval = -1,以便插入SPS和PPS。

我想确定哪些流具有SPS PPS信息,并相应地添加H264Parse。

GSTREAMER,FFMPEG/FFPROBE是否可以识别PPS,SPS是否在数据包中发送,然后动态添加H264Parse元素?

I am ingesting different kinds of security camera RTSP streams with gstreamer. In most of the cases I use a pipeline similar to this

gst-launch-1.0 rtspsrc location=rtsp://<username:password@$RTSPURL> protocols=4 name=rtspsrc0 rtspsrc0. ! rtph264depay ! tee name=t t.! queue ! hlssink2 name=ingest2 playlist-length=5 max-files=10 target-duration=2 playlist-location=stream.m3u8 location=segment_%d.ts

However the Axis cameras do not seem to send SPS ansd PPS NALUs at all. In order to work around this problem I am having to use h264parse config-interval=-1 so that the SPS and PPS is inserted.

I would like to identify which streams have the SPS PPS information and the add the H264parse accordingly.

Is there a way in gstreamer, ffmpeg/ffprobe to identify if PPS, SPS is sent in the packets and then add the h264parse element dynamically?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

猛虎独行 2025-02-07 21:15:52

您可以运行

ffmpeg -i输入-AN -C复制-t 10 -bsf:v trace_headers -f null -2&gt;&amp; 1 | GREP参数

这将检查10秒的视频流数据并记录所有NALU数据。如果存在PS,您会看到表单的行

[trace_headers @ 000002951294c4c0] Sequence Parameter Set
[trace_headers @ 000002951294c4c0] 0           forbidden_zero_bit              0 = 0
[trace_headers @ 000002951294c4c0] 1           nal_ref_idc                    11 = 3

确实检查PS部分上方的线路(如果

[trace_headers @ 000002951294c4c0] Extradata

忽略)。这可以是带外传输,例如从SDP中。

You can run

ffmpeg -i INPUT -an -c copy -t 10 -bsf:v trace_headers -f null - 2>&1 | grep Parameter

This will examine 10 seconds of video stream data and log all NALU data. If PS are present, you will see lines of the form

[trace_headers @ 000002951294c4c0] Sequence Parameter Set
[trace_headers @ 000002951294c4c0] 0           forbidden_zero_bit              0 = 0
[trace_headers @ 000002951294c4c0] 1           nal_ref_idc                    11 = 3

Do check the line immediately above the PS section, if it says

[trace_headers @ 000002951294c4c0] Extradata

ignore it. That can be out-of-band transmission, like from the SDP.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文