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?