<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Hello,</p>
    <p>I'm currently working on enabling opus FEC/loss concealment in
      Jami (GNU VoIP application) through ffmpeg. We have integrated
      this patch
(<a class="moz-txt-link-freetext" href="https://patchwork.ffmpeg.org/project/ffmpeg/patch/E1fIUGT-0003tH-Ql@pannekake.samfundet.no/">https://patchwork.ffmpeg.org/project/ffmpeg/patch/E1fIUGT-0003tH-Ql@pannekake.samfundet.no/</a>)
      to enable FEC on the decoder.</p>
    <p>I traced the codec execution while debugging and noticed that,
      when multiple consecutive packets are lost, the
      'opus_multistream_decode' function is called with a frame size
      equal to the total number of samples lost, instead of just the
      size of the last packet lost. What happens in this case ? From my
      understanding, FEC can only be used when a single packet is
      missing. However, is it possible to do loss concealment on
      multiple consecutive packets this way ?</p>
    <p>For the record, here is below a commented trace of ffmpeg using
      opus:</p>
    <p>    [sdp @ 0x7f72a4001000] max delay reached. need to consume
      packet<br>
          [sdp @ 0x7f72a4001000] RTP: missed 1 packets<br>
          [libopus @ 0x7f72a4006640] FEC: calculating audio mismatch : 
      251472 | 252432<br>
          [libopus @ 0x7f72a4006640] FEC: calculating nb_lost_samples : 
      960<br>
          [libopus @ 0x7f72a4006640] FEC: calculated lost samples :  960<br>
          [libopus @ 0x7f72a4006640] FEC: lost 960 samples<br>
          // Here, opus_multistream_decode is called with frame_size =
      960, as expected<br>
          [libopus @ 0x7f72a4006640] FEC: Recovered 960 samples<br>
          [libopus @ 0x7f72a4006640] FEC: no mismatch detected<br>
          [libopus @ 0x7f72a4006640] FEC: no mismatch detected<br>
          [libopus @ 0x7f72a4006640] FEC: no mismatch detected<br>
          [libopus @ 0x7f72a4006640] FEC: no mismatch detected<br>
          [libopus @ 0x7f72a4006640] FEC: no mismatch detected<br>
          [libopus @ 0x7f72a4006640] FEC: no mismatch detected<br>
          [sdp @ 0x7f72a4001000] max delay reached. need to consume
      packet<br>
          [sdp @ 0x7f72a4001000] RTP: missed 2 packets<br>
          [libopus @ 0x7f72a4006640] FEC: calculating audio mismatch : 
      259152 | 261072<br>
          [libopus @ 0x7f72a4006640] FEC: calculating nb_lost_samples : 
      1920<br>
          [libopus @ 0x7f72a4006640] FEC: calculated lost samples : 
      1920<br>
          [libopus @ 0x7f72a4006640] FEC: lost 1920 samples<br>
          // Here, opus_multistream_decode is called with frame_size =
      1920. This seems functional and seems to work, but I'm not sure
      how/why<br>
          [libopus @ 0x7f72a4006640] FEC: Recovered 1920 samples <-
      Is it possible to recover 1920 samples through loss concealment
      when a packet is 960 samples ?<br>
          [libopus @ 0x7f72a4006640] FEC: no mismatch detected<br>
          [libopus @ 0x7f72a4006640] FEC: no mismatch detected<br>
          [libopus @ 0x7f72a4006640] FEC: no mismatch detected<br>
          [libopus @ 0x7f72a4006640] FEC: no mismatch detected</p>
    <p>Thanks a lot for your time and assistance (and for the codec, of
      course).</p>
    <p>Best regards,</p>
    <p>Philip-Dylan Gleonec<br>
    </p>
    <div class="moz-signature">-- <br>
      <div class="wrapper" style="font: 14px arial, sans-serif;
        font-weight: normal; max-width: 480px;">
        <div class="logo" style="margin-bottom: 10px; width: 100%;"><img
src="https://static.savoirfairelinux.com/img/signature-courriel/logo-signature-sfl.png"
            alt="Logo Savoir-faire Linux inc." width="138" height="39"></div>
        <div class="wrapper-name" style="margin-bottom: 20px;">
          <div style="font: 18px arial, sans-serif; font-weight: bold;
            color: #2b2e30; margin-bottom: 5px;">Philip-Dylan Gleonec</div>
          <div style="color: #768089;">Consultant en logiciel libre /
            Ingénieur systèmes embarqués | Rennes, Fr</div>
        </div>
        <div class="wrapper-phone" style="margin-bottom: 20px;">
          <div class="phone-office" style="display: inline-block;
            margin-bottom: 10px;">
            <div style="margin-bottom: 5px; font-weight: bold; color:
              #2b2e30;">Bureau</div>
            <div style="color: #768089;"><a style="color: #56b0c9;
                text-decoration: underline;" href="tel:+14185257354"
                target="_blank" rel="noopener">(+33) 9 72 46 89 80</a></div>
          </div>
          <div class="phone-ring"><img title="Jami"
src="https://static.savoirfairelinux.com/img/signature-courriel/jami-picto.png"
              alt="Logo Jami" width="14" height="13"> <span
              style="color: #768089;">sfl-pgleonec</span></div>
        </div>
        <div class="divider" style="margin-bottom: 20px;"><img
            title="new-year"
src="https://static.savoirfairelinux.com/img/signature-courriel/Signature_2021_FR.jpg"
            alt="new-year" width="600" height="250"></div>
        <div class="wrapper-web-social" style="margin-bottom: 20px;">
          <div class="web" style="color: #768089; display:
            inline-block;"><a style="color: #56b0c9; text-decoration:
              underline;" href="https://www.savoirfairelinux.com"
              target="_blank" rel="noopener">Site web</a> | <a
              style="color: #56b0c9; text-decoration: underline;"
              href="https://blog.savoirfairelinux.com/fr-ca/"
              target="_blank" rel="noopener">Blog</a> | <a
              style="color: #56b0c9; text-decoration: underline;"
              href="https://jami.net" target="_blank" rel="noopener">Jami</a></div>
          <div class="social" style="color: #768089; display:
            inline-block; margin-left: 15px;"><span style="color:
              #768089; display: inline-block; margin-right: 5px;">Suivez-nous</span>
            <a style="display: inline-block;"
              href="https://www.facebook.com/savoirfairelinux/"
              target="_blank" rel="noopener"> <img title="Facebook"
src="https://static.savoirfairelinux.com/img/signature-courriel/facebook.png"
                alt="Facebook" width="7" height="15"> </a> <a
              style="color: #56b0c9; display: inline-block; margin-left:
              5px;"
              href="https://www.linkedin.com/company/savoir-faire-linux"
              target="_blank" rel="noopener"> <img title="LinkedIn"
src="https://static.savoirfairelinux.com/img/signature-courriel/linkedin.png"
                alt="LinkedIn" width="16" height="15"> </a> <a
              style="color: #56b0c9; display: inline-block; margin-left:
              5px;" href="https://twitter.com/sflinux" target="_blank"
              rel="noopener"> <img title="Twitter"
src="https://static.savoirfairelinux.com/img/signature-courriel/twitter.png"
                alt="Twitter" width="18" height="15"> </a> <a
              style="color: #56b0c9; display: inline-block; margin-left:
              5px;" href="https://gitlab.savoirfairelinux.com"
              target="_blank" rel="noopener"> <img title="gitLab"
src="https://static.savoirfairelinux.com/img/signature-courriel/gitlab.png"
                alt="gitLab" width="18" height="15"> </a></div>
        </div>
        <div class="wrapper-message">
          <div style="color: #2b2e30; font-size: 10px;">Messages de
            confidentialité : <span style="color: #768089;">Ce courriel
              (de même que les fichiers joints) est strictement réservé
              à l'usage de la personne ou de l'entité à qui il est
              adressé et peut contenir de l'information privilégiée et
              confidentielle. Toute divulgation, distribution ou copie
              de ce courriel est strictement prohibée. Si vous avez reçu
              ce courriel par erreur, veuillez nous en aviser
              sur-le-champ, détruire toutes les copies et le supprimer
              de votre système informatique.</span></div>
        </div>
      </div>
    </div>
  </body>
</html>