<div dir="ltr"><span style="font-family:arial,sans-serif;font-size:13px">Hi,</span><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">I'm trying to build a server application that allows a client to request a video covering a specific time range in the recent past from a camera attached to the server.</div>
<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">My plan is to block the source pad of a leaky queue which is set up to hold ~ 1 GB of encoded video, with the queue always running full and dropping old video as the new video arrives. The first part of the pipeline looks something like:</div>
<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">videotestsrc ! videoconvert ! queue ! x264enc ! queue</div><div style="font-family:arial,sans-serif;font-size:13px">
<br></div><div style="font-family:arial,sans-serif;font-size:13px">On a signal from the the client, the controlling app would unblock the queue's source pad, inspecting each buffer as it comes through: drop any buffers that are before the requested time window, pass through to a mux and filesink any buffers within the requested window, and send along an EOS to wrap things up and block the queue again as soon as it sees a buffer timestamped after the requested window. (Requests will always be non-overlapping and in chronological order.)</div>
<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">To handle a request, the app would append to the above pipeline:</div><div style="font-family:arial,sans-serif;font-size:13px">
<br></div><div style="font-family:arial,sans-serif;font-size:13px">mp4mux ! filesink</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">... and then tear those elements down again to wait for the next request.</div>
<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">My questions are:</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">
 * Are blocking probes the right tool here? The documentation suggests that blocking probes are really intended for short-term blockages, but in this system the normal state is that the stream is blocked and accumulating in the queue. I worry whether this will have unexpected consequences, and indeed my experiments thus far have failed to produce a proper MP4 file.</div>
<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px"> * Do you know of any examples of similar problems and solutions on the 1.x codebase? The only examples I've been able to find are pre-1.x. (For example, this one: <a href="http://gstreamer-devel.966125.n4.nabble.com/Dynamically-updating-filesink-location-at-run-time-on-the-fly-tt4660569.html#a4660577" target="_blank">http://gstreamer-devel.966125.n4.nabble.com/Dynamically-updating-filesink-location-at-run-time-on-the-fly-tt4660569.html#a4660577</a>)<br>
</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">Thanks in advance for any guidance you can offer.</div><div style="font-family:arial,sans-serif;font-size:13px">
<br></div><div style="font-family:arial,sans-serif;font-size:13px">-Todd</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div></div>