<div dir="ltr"><div><div><div>Hi,<br><br></div>Firstly I'd like to say thanks for the liveMedia library and for supporting the community! But I have a problem ...<br><br>When I run "openRTSP -b 300000 rtsp://<a href="http://192.168.2.101">192.168.2.101</a>" on the H.264 stream of my IP camera it works perfectly, but when I tried modifying testRTSPClient to do the equivalent (ie: saving NAL packets to a H264 raw bitstream file), it works perfectly sometimes but occasionally the video looks broken.<br><br>I compared the output using h264bitstream (<a href="https://github.com/aizvorski/h264bitstream">https://github.com/aizvorski/h264bitstream</a>) and found the difference to be that sometimes my testRTSPClient code isn't saving an IDR frame and that seems to be causing the weird videos. Anyway, here is the code I used inside testRTSPClient, I basically got testRTSPClient to call the same functions as openRTSP, so I assume there is something else I have to do to get testRTSPClient handling H264 correctly:<br><br></div>I replaced the line in continueAfterSETUP() of testRTSPClient.cpp from:<br><br> scs.subsession->sink = DummySink::createNew(env, *scs.subsession, rtspClient->url());<br></div><br>With this code (taken from createOutputFiles() in playCommon.cpp):<br><br> FileSink* fileSink = NULL;<br> if (strcmp(scs.subsession->mediumName(), "video") == 0) {<br> if (strcmp(scs.subsession->codecName(), "H264") == 0) {<br> char outFileName[1000] = "video.264";<br> unsigned int fileSinkBufferSize = 300000;<br><br> // For H.264 video stream, we use a special sink that adds 'start codes',<br> // and (at the start) the SPS and PPS NAL units:<br> fileSink = H264VideoFileSink::createNew(env, outFileName,<br> scs.subsession->fmtp_spropparametersets(),<br> fileSinkBufferSize);<br> }<br> }<br> scs.subsession->sink = fileSink;<br><br><div><div><br></div><div>Is there anything that needs to be done to testRTSPClient so it generates H264 raw bitstream files properly?<br><br clear="all"></div><div><div><div><div><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><span>Cheers,<br>Shervin Emami.<br>Senior Embedded Vision Engineer,<br>DIB Australia.<br></span><span><br></span></div></div></div></div></div>
</div></div></div></div></div>