<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    On 22.06.2015 10:09, Carl Eugen Hoyos wrote:<br>
    <blockquote
cite="mid:alpine.DEB.2.11.1506221006010.23992@rainbow.studorg.tuwien.ac.at"
      type="cite">Hi!
      <br>
      <br>
      On Mon, 22 Jun 2015, Peter Belkner wrote:
      <br>
      <br>
      <blockquote type="cite">    if (0!=*got_packet) {
        <br>
             
        av_packet_rescale_ts(pkt,cc->time_base,st->time_base);
        <br>
        +     // where do the "magic" factor 0.5 come from?
        <br>
        +     pkt->dts>>=1;
        <br>
        +     pkt->pts>>=1;
        <br>
        +     pkt->duration>>=1;
        <br>
        <br>
              if (ffsox_stream_interleaved_write(so,pkt)<0) {
        <br>
                DMESSAGE("writing packet");
        <br>
        <br>
        Maybe Carl Eugen can provide some insight into how to align the
        time
        <br>
        scales between streams.
        <br>
      </blockquote>
      <br>
      Your patch looks very wrong to me </blockquote>
    <br>
    Obviously it is not wrong because it does the right thing :-) The
    question is why, because, of course, this patch is ad hoc without
    any understanding.<br>
    <br>
    <blockquote
cite="mid:alpine.DEB.2.11.1506221006010.23992@rainbow.studorg.tuwien.ac.at"
      type="cite">but I only commented on a ffmpeg command line that you
      claimed shows a problem with FFmpeg (it only showed an issue
      <br>
      with the command line in question).
      <br>
      <br>
      I don't know what libffsox is.
      <br>
    </blockquote>
    <br>
    It's a utility library where this code comes from.
    <blockquote>
      <pre>int ffsox_stream_interleaved_write(stream_t *s, AVPacket *pkt)
{
  pkt->stream_index=s->stream_index;

#if 0 // {
  fprintf(stderr,"%d: %I64d, %I64d\n",pkt->stream_index,pkt->pts,pkt->dts);
#endif // }

  return av_interleaved_write_frame(s->fc,pkt);
}
</pre>
    </blockquote>
    <br>
    <blockquote
cite="mid:alpine.DEB.2.11.1506221006010.23992@rainbow.studorg.tuwien.ac.at"
      type="cite">One thing that comes to mind is: Is st->time_base
      the time_base of the
      <br>
      input or the output stream? They do not have to be identical, not
      even
      <br>
      if you requested them to be identical.
      <br>
    </blockquote>
    <br>
    Stream "st" and codec context "cc" are output.<br>
    <br>
    The packet "pkt" is constructed from a fresh frame which has no
    direct link to the decoded frame from the input, except sample
    frequency, number of channels, and channel layout.<br>
    <br>
    <blockquote
cite="mid:alpine.DEB.2.11.1506221006010.23992@rainbow.studorg.tuwien.ac.at"
      type="cite">
      <br>
      Carl Eugen
      <br>
      <br>
    </blockquote>
    <br>
  </body>
</html>