<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’t find the information that I’m apparently just
supposed to know.<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>So, can someone please explain how seeking works. In
particular, I want to pick out one JPEG frame from the stream of JPEGS demuxed and
saved from an MJPEG stream. And then, perhaps, to step one pic at a time
through the stream. <o:p></o:p></p>
<p class=MsoNormal><o:p> </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> </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'> ! multipartdemux <o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:12.0pt;font-family:"Courier New";
color:#00B050'> ! matroskamux <o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:12.0pt;font-family:"Courier New";
color:#00B050'> ! filesink location= saved-mjpeg-stream.<o:p></o:p></span></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal> 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> </o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:12.0pt;
font-family:"Courier New";color:#00B050'> 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'> !
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'> !
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'> !
ffmpegcolorspace<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:12.0pt;font-family:"Courier New";
color:#00B050'> ! autovideosink<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:12.0pt;font-family:"Courier New";
color:green'><o:p> </o:p></span></p>
<p class=MsoNormal>This pipeline is actually coded in C. So, after I set
the pipeline to PAUSED, I’d like to be able to seek to one particular
frame that is at a specified offset in time relative to the start of the
saved mjpeg stream. <o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal><span style='font-size:12.0pt;font-family:"Courier New";
color:#00B050'>// …..<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:12.0pt;font-family:"Courier New";
color:#00B050'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:12.0pt;font-family:"Courier New";
color:#00B050'> 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> </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 “play” 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> </o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>FWIW, I have read a mountain of web posts and samples.
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. Is there a
good online how-to for gstreamer. No, the online documentation at
gstreamer.net just glosses over events and seeking.<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>Wes Miller <o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
</div>
</body>
</html>