<div dir="ltr"><div>Not really a GStreamer answer, but the decoder's rules are you must see an sps and a pps before the first keyframe but there is no requirement that it has to be there before each and every keyframe. Old axis cameras used to have this selectable. <br></div><div>In my code I get it from the SDP packet at the beginning and cache it and then replace it if it comes in the bitstream or if the value gets updated in the stream. Then I save it and send to decoder with the SPS and PPS injected before the keyframes. <br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, May 3, 2023 at 1:22 PM Guru Govindan via gstreamer-devel <<a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi There,<br><div>I am having an issue where a lot of video footage from a security camera was recorded without the sprop-parameters-set (SPS/PPS).</div><div><br></div><div>I am unable to play or transcode these ts files as it does not have SPS/PPS values. </div><div><br></div><div>I tried the following by sending the h264parse the stream format but that failed</div><div><br></div><div>```</div><div>gst-launch-1.0 -v filesrc location=2.ts ! tsparse ! tsdemux name=demux demux. ! queue ! h264parse ! video/x-h264,stream-format=avc,alignment=au ! decodebin ! videoconvert ! vaapih264enc ! h264parse ! mpegtsmux alignment=-1 ! filesink location=output.ts<br></div><div>```</div><div>failed with /</div><div>GstPipeline:pipeline0/GstH264Parse:h264parse0.GstPad:sink: caps = video/x-h264, stream-format=(string)byte-stream</div>ERROR: from element /GstPipeline:pipeline0/GstH264Parse:h264parse0: No valid frames found before end of stream<div><br></div><div>I then tried to split it as per keyframes and then mux it.. like below but that failed as well</div><div><br></div><div>```</div><div>gst-launch-1.0 -v filesrc location=2.ts ! tsdemux name=demux ! h264parse ! splitmuxsink max-size-time=1000000000 location=segment%02d.ts mpegtsmux name=mux ! filesink location=output.ts demux.video_0 ! queue ! mux.<br></div><div>```</div><div>failed with h264parse0: No valid frames found before end of stream</div><div><br></div><div>Since it could not find EOS.. I thoiught of sending the entire manifest.. but that didnt work as well</div><div><br></div><div>```</div><div>gst-launch-1.0 -v filesrc location="<manifest uri>" ! hlsdemux ! h264parse ! video/x-h264,stream-format='(string)avc,alignment=(string)au' ! mpegtsmux ! h264parse config-interval=-1 ! mpegtsmux ! filesink location=output.ts<br></div><div>```</div><div><br></div><div>Just like how we can add config-interval to a rtp stream, is there a way to add it to a ts segment?</div><div><br></div><div>Best Regards,</div><div>Guru</div><div><br></div></div>
</blockquote></div>