<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi all,<div class=""><br class=""></div><div class="">In my application I need to record streaming video (and audio audio) while I also have to record some time before the recording is initiated by the user. Currently Im doing this by have a small c++ application which executes the follwoing pipeline:</div><div class=""><br class=""></div><div class=""><div style="background-color: rgb(255, 255, 255); line-height: 15px;" class=""><div style="font-family: Menlo, Monaco, "Courier New", monospace; font-size: 10px; font-weight: 800; white-space: pre;" class=""><span style="color: rgb(162, 86, 55);" class="">udpsrc multicast-group=<VIDEO_SRC_IP> auto-multicast=true port=<</span><span style="color: rgb(162, 86, 55); caret-color: rgb(162, 86, 55);" class="">VIDEO_SRC_PORT</span><span style="color: rgb(162, 86, 55);" class="">></span></div><div style="color: rgb(54, 54, 54); font-family: Menlo, Monaco, "Courier New", monospace; font-size: 10px; font-weight: 800; white-space: pre;" class=""><span style="color: rgb(162, 86, 55);" class=""> ! application/x-rtp,media=video,encoding-name=VP8,payload=96 ! rtpjitterbuffer ! rtpvp8depay ! tee name=video_stream_spilt</span></div><div style="color: rgb(54, 54, 54); font-family: Menlo, Monaco, "Courier New", monospace; font-size: 10px; font-weight: 800; white-space: pre;" class=""><span style="color: rgb(162, 86, 55);" class=""> udpsrc port=<AUDIO_SRC_PORT></span></div><div style="color: rgb(54, 54, 54); font-family: Menlo, Monaco, "Courier New", monospace; font-size: 10px; font-weight: 800; white-space: pre;" class=""><span style="color: rgb(162, 86, 55);" class=""> ! application/x-rtp,media=audio,clock-rate=44100,encoding-name=L24,encoding-params=1,channels=1,payload=96,ssrc=687131883,timestamp-offset=3784732336,seqnum-offset=8272</span></div><div style="color: rgb(54, 54, 54); font-family: Menlo, Monaco, "Courier New", monospace; font-size: 10px; font-weight: 800; white-space: pre;" class=""><span style="color: rgb(162, 86, 55);" class=""> ! rtpL24depay ! audioconvert ! audioresample ! queue name=file_sink_audio_queue ! voaacenc ! queue name=q2 max-size-bytes=0 max-size-buffers=0 max-size-time=0 ! aacparse ! faad ! audioresample ! audioconvert ! voaacenc ! video_mux.</span></div><div class=""><span style="color: rgb(162, 86, 55); font-family: Menlo, Monaco, "Courier New", monospace; font-size: 10px; font-weight: 800; white-space: pre;" class=""> video_stream_spilt. ! queue name=file_sink_video_queue ! omxvp8dec ! videoconvert ! omxh264enc bitrate=</span><font color="#a25637" face="Menlo, Monaco, Courier New, monospace" size="1" class=""><span style="caret-color: rgb(162, 86, 55); font-weight: 800; white-space: pre;" class="">8000000</span></font><span style="color: rgb(162, 86, 55); font-family: Menlo, Monaco, "Courier New", monospace; font-size: 10px; font-weight: 800; white-space: pre;" class=""> control-rate=2 insert-sps-pps=true ! matroskamux name=video_mux</span></div><div style="color: rgb(54, 54, 54); font-family: Menlo, Monaco, "Courier New", monospace; font-size: 10px; font-weight: 800; white-space: pre;" class=""><span style="color: rgb(162, 86, 55);" class=""> ! filesink name=file_sink location=<OUTPUT_FILENAME></span></div><div style="color: rgb(54, 54, 54); font-family: Menlo, Monaco, "Courier New", monospace; font-size: 10px; font-weight: 800; white-space: pre;" class=""><span style="color: rgb(162, 86, 55);" class=""> video_stream_spilt. ! fakesink</span></div></div></div><div class=""><br class=""></div><div class="">In the c++ application logic I configure the "<span style="color: rgb(162, 86, 55); font-family: Menlo, Monaco, "Courier New", monospace; font-size: 10px; font-weight: 800; white-space: pre; background-color: rgb(255, 255, 255);" class="">max-size-time</span>" on the "<span style="caret-color: rgb(162, 86, 55); color: rgb(162, 86, 55); font-family: Menlo, Monaco, "Courier New", monospace; font-size: 10px; font-weight: 800; white-space: pre; background-color: rgb(255, 255, 255);" class="">file_sink_video_queue</span>" and "<span style="caret-color: rgb(162, 86, 55); color: rgb(162, 86, 55); font-family: Menlo, Monaco, "Courier New", monospace; font-size: 10px; font-weight: 800; white-space: pre; background-color: rgb(255, 255, 255);" class="">file_sink_audio_queue</span>" queues to video and audio data from the past and blocking the src pads on the <span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">queues. When the record start event arrives it will wait for the first keyframe in the video and the unblock the the pads to start to record the audio and video data into the file.</span></div><div class=""><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class=""><br class=""></span></div><div class=""><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">I would like to simplify this application by splitting it into two simpler application. First by adding a new</span><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class=""> pipeline running in the middle which would be responsible for delaying and returning the stream to realtime. Then a</span><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class=""> simple recorder component which receives the audio and video streams at the end.</span></div><div class=""><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class=""><br class=""></span></div><div class=""><font color="#000000" class="">So basically what I would like to achieve is that instead of blocking/unblocking the the queues I would have a "delayed stream" and I'm searching for an event that I can send to the pipeline </font><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">(or some other way) </span><font color="#000000" class="">to reduce the delay to realtime again (or <span style="caret-color: rgb(0, 0, 0);" class="">minimize</span> it to close to zero) in a way that it would flush / send out the data from the queue instead of dismissing it.</font></div><div class=""><font color="#000000" class=""><br class=""></font></div><div class=""><font color="#000000" class="">I found this example:</font></div><div class=""><font color="#000000" class=""><a href="https://stackoverflow.com/questions/32908047/gstreamer-increase-and-decrease-delay-on-the-fly" class="">https://stackoverflow.com/questions/32908047/gstreamer-increase-and-decrease-delay-on-the-fly</a></font></div><div class=""><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class=""><br class=""></span></div><div class=""><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">But this covers a slightly different use case, with this when I reset the que params it jumps to the present and drops all the data in the buffer.</span></div><div class=""><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class=""><br class=""></span></div><div class="">Do you have any idea how could I solve this? </div><div class=""><br class=""></div><div class="">Thank you for your help!</div><div class=""><br class=""></div><div class="">Bests,</div><div class="">Peter</div></div></body></html>