<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=us-ascii">
<meta name=Generator content="Microsoft Word 12 (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:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
-->
</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=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal>After looking at about a hundred web pages and the gstreamer
online docs, I can&#8217;t find the information that I&#8217;m apparently just
supposed to know.<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>So, can someone please explain how seeking works.&nbsp; In
particular, I want to pick out one JPEG frame from the stream of JPEGS demuxed and
saved from an MJPEG stream.&nbsp; And then, perhaps, to step one pic at a time
through the stream. <o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>I started by saving an mjpeg live stream into a mkv file
thus:<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal><span style='font-size:12.0pt;font-family:"Courier New";
color:#00B050'>gst-launch souphttpsrc location=... do-timestamp=true
is_live=true <o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:12.0pt;font-family:"Courier New";
color:#00B050'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ! &nbsp;multipartdemux <o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:12.0pt;font-family:"Courier New";
color:#00B050'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ! matroskamux <o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:12.0pt;font-family:"Courier New";
color:#00B050'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ! filesink location= saved-mjpeg-stream.<o:p></o:p></span></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>&nbsp;Now I am playing it back using this equally simple
pipeline:<o:p></o:p></p>

<p class=MsoNormal><span style='color:#00B050'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:12.0pt;
font-family:"Courier New";color:#00B050'>&nbsp;gst-launch filesrc location=saved-mjpeg-stream.mkv
\<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:12.0pt;
font-family:"Courier New";color:#00B050'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; !
matroskademux<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:12.0pt;
font-family:"Courier New";color:#00B050'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; !
jpegdec<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:12.0pt;
font-family:"Courier New";color:#00B050'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; !
ffmpegcolorspace<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:12.0pt;font-family:"Courier New";
color:#00B050'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ! autovideosink<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:12.0pt;font-family:"Courier New";
color:green'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal>This pipeline is actually coded in C.&nbsp; So, after I set
the pipeline to PAUSED, I&#8217;d like to be able to seek to one particular
frame that is at a specified&nbsp; offset in time relative to the start of the
saved mjpeg stream. &nbsp;&nbsp;<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal><span style='font-size:12.0pt;font-family:"Courier New";
color:#00B050'>// &#8230;..<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:12.0pt;font-family:"Courier New";
color:#00B050'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:12.0pt;font-family:"Courier New";
color:#00B050'>&nbsp; gst_element_set_state( pipeline, GST_STATE_PAUSED );<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:12.0pt;font-family:"Courier New";
color:#00B050'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:12.0pt;font-family:"Courier New";
color:#00B050'>// perform a seek here<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:12.0pt;font-family:"Courier New";
color:#00B050'>// then &#8220;play&#8221; the one frame or<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:12.0pt;font-family:"Courier New";
color:#00B050'>// play N more frames.<o:p></o:p></span></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>FWIW, I have read a mountain of web posts and samples.&nbsp;
All of them tell me what functions to use but no one seems to explain why and how
to create an event, where (and where not) to hook it in.&nbsp;&nbsp; Is there a
good online how-to for gstreamer.&nbsp; No, the online documentation at
gstreamer.net just glosses over events and seeking.<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>Wes Miller &nbsp;<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

</body>

</html>