<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Paul I agree with you, but the thing is that i dont found a good
      example or explain about how to get that working, even to set the
      DTS. Can you give to me a resource?<br>
    </p>
    <div class="moz-cite-prefix">On 1/2/23 18:01, Paul B Mahol wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAPYw7P6f=c70CtBSmQsMRNPVuTNSd=Abu9j1hcbs_40=yvxGSw@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <div dir="ltr"><br>
        </div>
        <br>
        <div class="gmail_quote">
          <div dir="ltr" class="gmail_attr">On Mon, Jan 2, 2023 at 9:48
            PM Luis Felipe Domínguez Vega via Libav-user <<a
              href="mailto:libav-user@ffmpeg.org" moz-do-not-send="true"
              class="moz-txt-link-freetext">libav-user@ffmpeg.org</a>>
            wrote:<br>
          </div>
          <blockquote class="gmail_quote" style="margin:0px 0px 0px
            0.8ex;border-left:1px solid
            rgb(204,204,204);padding-left:1ex">Found the best
            documentation about ffmpeg outside ffmpeg.<br>
            <br>
            <a
href="https://github.com/leandromoreira/ffmpeg-libav-tutorial#chapter-1---syncing-audio-and-video"
              rel="noreferrer" target="_blank" moz-do-not-send="true"
              class="moz-txt-link-freetext">https://github.com/leandromoreira/ffmpeg-libav-tutorial#chapter-1---syncing-audio-and-video</a><br>
            <br>
            There is well explained the PTS definition very very well.
            Used the <br>
            calculations from that readme and set this:<br>
            <br>
            ```<br>
                     packet->pts = dvCodecCtx->time_base.den / <br>
            av_q2d(dvCodecCtx->framerate) *  frameCounter++;<br>
            <br>
            ```<br>
            <br>
            Now the input stream can restart, get wrong PTS, TS,
            whatever that dont <br>
            broke my output stream timing.<br>
          </blockquote>
          <div><br>
          </div>
          <div>Technically speaking that line is pure hack as it does
            use double floating point precision for calculations when it
            is not really needed to use and may after some relative long
            time give bad results.</div>
          <div><br>
          </div>
          <blockquote class="gmail_quote" style="margin:0px 0px 0px
            0.8ex;border-left:1px solid
            rgb(204,204,204);padding-left:1ex">
            <br>
            On 1/2/23 16:39, Luis Felipe Domínguez Vega via Libav-user
            wrote:<br>
            > Hi, I'm trying to create in C a basic live transcoder
            that use my <br>
            > NVidia for hardware transcoding. I trying to set the
            decoded frame PTS <br>
            > to my own because the source of the video is a UDP
            stream and can be <br>
            > restarted. So i want manage by myself the PTS value to
            avoid a restart <br>
            > of that value.<br>
            ><br>
            > Really i dont found a good documentation about to how
            manage and <br>
            > create from 0 that PTS value.<br>
            ><br>
            > Right now iw geting the frame from decoder, "modify
            ->pts", and send <br>
            > to encoder, only for testing i get a variable with
            "frame" counter <br>
            > that start at 0, tested this:<br>
            ><br>
            > ```<br>
            > frame->pts = frameCounter++<br>
            > ```<br>
            ><br>
            > Of course this, after video encoder completed, drop so
            many frames on <br>
            > the player (codec is h264 at input and output). So i
            think that i dont <br>
            > geting the idea behind pts.<br>
            ><br>
            > _______________________________________________<br>
            > Libav-user mailing list<br>
            > <a href="mailto:Libav-user@ffmpeg.org" target="_blank"
              moz-do-not-send="true" class="moz-txt-link-freetext">Libav-user@ffmpeg.org</a><br>
            > <a
              href="https://ffmpeg.org/mailman/listinfo/libav-user"
              rel="noreferrer" target="_blank" moz-do-not-send="true"
              class="moz-txt-link-freetext">https://ffmpeg.org/mailman/listinfo/libav-user</a><br>
            ><br>
            > To unsubscribe, visit link above, or email<br>
            > <a href="mailto:libav-user-request@ffmpeg.org"
              target="_blank" moz-do-not-send="true"
              class="moz-txt-link-freetext">libav-user-request@ffmpeg.org</a>
            with subject "unsubscribe".<br>
            _______________________________________________<br>
            Libav-user mailing list<br>
            <a href="mailto:Libav-user@ffmpeg.org" target="_blank"
              moz-do-not-send="true" class="moz-txt-link-freetext">Libav-user@ffmpeg.org</a><br>
            <a href="https://ffmpeg.org/mailman/listinfo/libav-user"
              rel="noreferrer" target="_blank" moz-do-not-send="true"
              class="moz-txt-link-freetext">https://ffmpeg.org/mailman/listinfo/libav-user</a><br>
            <br>
            To unsubscribe, visit link above, or email<br>
            <a href="mailto:libav-user-request@ffmpeg.org"
              target="_blank" moz-do-not-send="true"
              class="moz-txt-link-freetext">libav-user-request@ffmpeg.org</a>
            with subject "unsubscribe".<br>
          </blockquote>
        </div>
      </div>
      <br>
      <fieldset class="moz-mime-attachment-header"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
Libav-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Libav-user@ffmpeg.org">Libav-user@ffmpeg.org</a>
<a class="moz-txt-link-freetext" href="https://ffmpeg.org/mailman/listinfo/libav-user">https://ffmpeg.org/mailman/listinfo/libav-user</a>

To unsubscribe, visit link above, or email
<a class="moz-txt-link-abbreviated" href="mailto:libav-user-request@ffmpeg.org">libav-user-request@ffmpeg.org</a> with subject "unsubscribe".
</pre>
    </blockquote>
  </body>
</html>