<div dir="auto">Hello, <div dir="auto"><br></div><div dir="auto">I've tried, but there are couple disadvantages:</div><div dir="auto">1. I'm not able to stop part of the pipe which writing to the file.</div><div dir="auto">2. Setting min-threshold-time to 1 dynamically doesn't have any effect.</div><div dir="auto"><br></div><div dir="auto">Finally, I'm trying to achieve that using shm:</div><div dir="auto"><div dir="auto">pipeline_string = "rtspsrc location=<video_uri> " \</div><div dir="auto">                  "! rtph264depay " \</div><div dir="auto">                  "! tee name=t " \</div><div dir="auto">                  "t. " \</div><div dir="auto">                  "! queue" \</div><div dir="auto">                  "! avdec_h264 " \</div><div dir="auto">                  "! autovideosink " \</div><div dir="auto">                  "t. " \</div><div dir="auto">                  "! queue min-threshold-time=11000000000 name=cam1 " \</div><div dir="auto">                  "! h264parse" \</div><div dir="auto">                  "! shmsink socket-path=/tmp/src wait-for-connection=false shm-size=10000000"</div><div dir="auto"><br></div><div dir="auto">And,</div><div dir="auto"><div dir="auto">pipeline2_string = "shmsrc socket-path=/tmp/src"  \</div><div dir="auto">                   "! queue" \</div><div dir="auto">                   "! filesink location=vid.avi"</div><div dir="auto"><br></div><div dir="auto">At other end.</div><div dir="auto"><br></div><div dir="auto">But in such case - pipeline doesn't want to preroll error!</div><div dir="auto"><br></div><div dir="auto">Any other suggestions?</div><div dir="auto"><br></div><div dir="auto">Best regards,</div><div dir="auto">Anton</div></div><div dir="auto"><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Feb 19, 2020, 12:40 Thornton, Keith <<a href="mailto:keith.thornton@zeiss.com">keith.thornton@zeiss.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="DE" link="#0563C1" vlink="#954F72">
<div class="m_8233397494050916773WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial",sans-serif">Hi, if you want to dump h264 to an mp4 file for instance try<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Tee --- queue avdec_h264  --- autovideosink<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">         |--queue (with min-threshold == 11 secs) – h264parse – mp4mux – filesink.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">If you then set min-threshold to 1 it will empty the queue<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><b>Von:</b> gstreamer-devel <<a href="mailto:gstreamer-devel-bounces@lists.freedesktop.org" target="_blank" rel="noreferrer">gstreamer-devel-bounces@lists.freedesktop.org</a>>
<b>Im Auftrag von </b>Anton Pryima<br>
<b>Gesendet:</b> Mittwoch, 19. <span lang="EN-US">Februar 2020 10:16<br>
<b>An:</b> Discussion of the development of and with GStreamer <<a href="mailto:gstreamer-devel@lists.freedesktop.org" target="_blank" rel="noreferrer">gstreamer-devel@lists.freedesktop.org</a>><br>
<b>Betreff:</b> Dump 10 seconds of video at once.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<div>
<p class="MsoNormal"><span lang="EN-US">Hello all.<u></u><u></u></span></p>
<div>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">I need to make program which displays online video from rtsp and then, by a command, it dumps 10 seconds of video to the disk (creates playable video file). <u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">I've created working pipeline looking like:<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><i><span lang="EN-US">rtspsrc location=<video_uri> ! rtph264depay ! queue min-threshold-time=11000000000 name=n ! avdec_h264 ! autovideosink</span></i><span lang="EN-US"><u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">It has 10 seconds of buffer and working fine.<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">Now I need to dump all content of the queue to the disk at once.<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">I've tried different methods:<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">queue2, shmsink, appsink and etc.<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">But all of them has some disadvantages:<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">    queue2 - creates temp file on disk during playout. But when I try to 'cat' it I'm not getting playable video file. I've tried to pass it as filesrc - but this pipeline refuses to start. As I understand queue does
 not store video directly - it has its metadata aside.<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">    shmsink - socket is created, I've tried to shmcat it - but it doesn't work. <u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">    appsink - provides video stream frame by frame, but no whole buffer at once. <u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">So is there is any way to make it with standard GST tools? Or only the way it to create appsink callback and save frame by frame to gst.buffer and then, when it is needed, dump this buffer to disk with appsrc->filesink?<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">Thank you in advance.<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">Best regards,<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal">Anton.<u></u><u></u></p>
</div>
</div>
</div>
</div>

_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org" target="_blank" rel="noreferrer">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="noreferrer noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
</blockquote></div>