<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.E-MailFormatvorlage18
        {mso-style-type:personal-reply;
        font-family:"Arial",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="DE" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial",sans-serif;mso-fareast-language:EN-US">Hi, if you want to dump h264 to an mp4 file for instance try<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">Tee --- queue avdec_h264  --- autovideosink<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">         |--queue (with min-threshold == 11 secs) – h264parse – mp4mux – filesink.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">If you then set min-threshold to 1 it will empty the queue<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><b>Von:</b> gstreamer-devel <gstreamer-devel-bounces@lists.freedesktop.org>
<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 <gstreamer-devel@lists.freedesktop.org><br>
<b>Betreff:</b> Dump 10 seconds of video at once.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><span lang="EN-US">Hello all.<o:p></o:p></span></p>
<div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></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). <o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">I've created working pipeline looking like:<o:p></o:p></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"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">It has 10 seconds of buffer and working fine.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></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.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">I've tried different methods:<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">queue2, shmsink, appsink and etc.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">But all of them has some disadvantages:<o:p></o:p></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.<o:p></o:p></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. <o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">    appsink - provides video stream frame by frame, but no whole buffer at once. <o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></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?<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">Thank you in advance.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">Best regards,<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal">Anton.<o:p></o:p></p>
</div>
</div>
</div>
</body>
</html>