<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<div class="moz-cite-prefix">On 08.09.2013 18:32, Alex Cohn wrote:<br>
</div>
<blockquote
cite="mid:CADiKgohA0z7zpGLuWXLc3Ukeh1od8mkb4M3Govjq+hGeGH=Vdw@mail.gmail.com"
type="cite">
<p dir="ltr">On Sep 8, 2013 6:17 PM, "Sandro Mani" <<a
moz-do-not-send="true" href="mailto:manisandro@gmail.com">manisandro@gmail.com</a>>
wrote:<br>
><br>
> Hello,<br>
><br>
> I would like to periodically (say every second) grab the
latest frame from a rtsp live stream of a webcam. I am able to
successfully open the stream and read and decode frames, however
if I read one frame every second, I am still reading subsequent
frames (as opposed to frames which are i.e. one second apart). I
guess I need to seek to the last available frame before reading
the next frame. Can anyone point out how this can be done?<br>
><br>
> For reference, my code is here: [1] [2].<br>
><br>
> Thanks for any inputs.<br>
><br>
> Sandro<br>
><br>
><br>
> [1] <a moz-do-not-send="true"
href="http://smani.fedorapeople.org/VideoCapture.hpp">http://smani.fedorapeople.org/VideoCapture.hpp</a><br>
> [2] <a moz-do-not-send="true"
href="http://smani.fedorapeople.org/VideoCapture.cpp">http://smani.fedorapeople.org/VideoCapture.cpp</a></p>
<p dir="ltr">If your webcam has GOP of 1 sec, e.g. GOP length = 30
and FPS = 30, you can skip to next second; otherwize, the
correct strategy would be to decode all frames, but throw away
all frames that you don't need.</p>
<p dir="ltr">BR<br>
Alex Cohn<br>
</p>
<br>
</blockquote>
Thanks for the reply. With skip do you mean by calling av_seek_frame
with an appropriately computed timestamp? (Sorry if I may be asking
the obvious, I'm rather a novice in this area.)<br>
<br>
Sandro<br>
</body>
</html>