<div dir="ltr">Hi,<div><div><br></div><div>I am having issues creating a gstreamer pipeline to record from a RTSP server to HLS.<br></div><div><br></div><div>The idea is to have a module that can record snippets from a (tcp based) rtsp server.</div><div><br></div><div>Since the recorder is intended to be able to upload hls stream it is made so it copies the hls index file for every segment that is made. In that way the segments can be transferred to a host and streamed from there. Thats handled by listening for a few bus messages.<br></div><div><br></div><div><div>My first problem was that I had to connect the rtspsrc to my rtph264depay when the rtspsrc actually got data. Thats handled via a callback that connect the two pads at the right time via "pad_added_handler". That works for the first snippet recording.</div><div><br></div></div><div>My current problem is that I have not been able to restart the module successfully to record the second video.  I have tried alot of strategies but not been able to come up with anything stable.</div><div><br></div><div>I have therefore isolated the pipeline to a small public project, and I hope this can serve as a common reference for me to recieve advice on, and afterwards an example for others to take inspiration from.</div><div><br></div><div>Its located here</div><div><br></div><div><a href="https://github.com/taxfromdk/rtsp_recorder/" target="_blank">https://github.com/taxfromdk/rtsp_recorder/</a><br></div><div><br></div><div>With the bulk of the code I need feedback on here:</div><div><br></div><div><a href="https://github.com/taxfromdk/rtsp_recorder/blob/master/recorder.c">https://github.com/taxfromdk/rtsp_recorder/blob/master/recorder.c</a><br></div><div><br></div><div><div>It is wrapped with a fake_rtsp_server that can be run locally instead of connecting to a real rtsp server. It just servers a looping video. It works against ffplay and vlc. (its serving RTSP via TCP). Instructions in the readme file.</div><div><br></div></div><div>I would appreciate feedback to be able to bring my pipeline into a working state. </div><div><br></div><div>Even just pseudo code on how you would arrange a pipeline with this goal would be helpfull.</div><div><br></div><div>I am working under Arch against gstreamer 1.16<br></div><div><br></div><div><br></div><div>Kind regards</div><div><br></div><div>Jesper</div></div></div>