<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html style="direction: ltr;">
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
    <style>body p { margin-bottom: 0cm; margin-top: 0pt; } </style>
  </head>
  <body style="direction: ltr;"
    bidimailui-detected-decoding-type="latin-charset" bgcolor="#ffffff"
    text="#000000">
    On 08/28/2011 09:13 AM, Alex Cohn wrote:<br>
    <blockquote
cite="mid:CADiKgoic=Ei36esKgsr2um0dtuGE1wxcgTCPFSN+7_TXqGW1pA@mail.gmail.com"
      type="cite">
      <blockquote type="cite">
        <pre wrap="">(a) is there a general way to bookmark frames while writing a file in such a
way that I can seek to them directly when playing, without searching? pts is
NOT the answer, as explained below.
</pre>
      </blockquote>
      <pre wrap="">
This is only relevant for key frames, but yes, you can. When writing
the stream, you can embed a copy of SPS/PPS preceeding every key
frame. Keep the file offset for this copy of SPS in your database, and
when you need it, you can simply start reading the file from this
offset.
</pre>
    </blockquote>
    As I mentioned in my original post, this works fine for .h264 file,
    but for some reason not for .avi or .mp4 - perhaps I am missing some
    magic incantation that someone on the list is aware of?<br>
    <blockquote
cite="mid:CADiKgoic=Ei36esKgsr2um0dtuGE1wxcgTCPFSN+7_TXqGW1pA@mail.gmail.com"
      type="cite">
      <blockquote type="cite">
        <pre wrap="">(c) is there a way to force "low delay" handling of a stream despite its
SPS/PPS description? for some cameras, video decoding is lagging 4 frames
after the packet arrival, which - at 5fps, is almost 1 second delay. (one
suggestion given below, looking for more options)
</pre>
      </blockquote>
      <pre wrap="">
Why can't you fix the SPS to require low delay?
</pre>
    </blockquote>
    I can (and probably will), but that requires bit manipulation that I
    was hoping to avoid; I hoped there was a way to do it without
    patching either libavcodec or the bitstream.<br>
    <blockquote
cite="mid:CADiKgoic=Ei36esKgsr2um0dtuGE1wxcgTCPFSN+7_TXqGW1pA@mail.gmail.com"
      type="cite">
      <blockquote type="cite">
        <pre wrap="">(d) is there a way, other than subtitles, to add a visual timestamp to the
file while writing it, without decoding+overlaying+reencoding?
</pre>
      </blockquote>
      <pre wrap="">
What's wrong with using subtitles?
</pre>
    </blockquote>
    Nothing wrong, and is probably what I am going to do; It would
    require adding a different subtitle per frame. I was hoping there's
    a standard or accepted way to do this that I was unaware of - I'm
    sure I'm not the first person to run into this.<br>
    <blockquote
cite="mid:CADiKgoic=Ei36esKgsr2um0dtuGE1wxcgTCPFSN+7_TXqGW1pA@mail.gmail.com"
      type="cite">
      <blockquote type="cite">
        <pre wrap="">(e) is there a way to tell, without decoding the video stream, that a
received packet starts a new non-key frame?
</pre>
      </blockquote>
      <pre wrap="">
Look at the first Nal code. It will most likely be 65 for I-frame, and
61 for P-frame.</pre>
    </blockquote>
    Thanks.<br>
  </body>
</html>