<p dir="auto">Due to changes in the new version of ffmpeg, OpenCV can't be built with the current Version.</p>
<p dir="auto">As crackwitz (Moderator) mentioned in <a href="https://forum.opencv.org/t/error-avstream-aka-struct-avstream-has-no-member-named-codec/3506" rel="nofollow">my post</a> in the forum:</p>
<blockquote>
<p dir="auto">they (deprecated and) removed the codec member from AVStream recently, in favor of codecpar</p>
</blockquote>
<p dir="auto">related:<br>
<a href="https://forum.opencv.org/t/error-avstream-aka-struct-avstream-has-no-member-named-codec/3506" rel="nofollow">https://forum.opencv.org/t/error-avstream-aka-struct-avstream-has-no-member-named-codec/3506</a></p>
<p dir="auto">ffmpeg changed its <code class="notranslate">AVStream</code> structure. in ffmpeg v3.1 (~2016) the <code class="notranslate">codecpar</code> member was introduced to replace <code class="notranslate">codec</code> member. <code class="notranslate">codec</code> has been deprecated since then. it is still available in ffmpeg v4.4 but not in the master branch.</p>
<p dir="auto">availability is modulated by <code class="notranslate">#define FF_API_LAVF_AVCTX (LIBAVFORMAT_VERSION_MAJOR &lt; 59)</code></p>
<p dir="auto">this version was bumped to 59 a month ago in <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/FFmpeg/FFmpeg/commit/85ba17f36dbfde1baeaa47e14d30c337add52c0d/hovercard" href="https://github.com/FFmpeg/FFmpeg/commit/85ba17f36dbfde1baeaa47e14d30c337add52c0d">FFmpeg/FFmpeg@<tt>85ba17f</tt></a></p>
<p dir="auto">OpenCV v4.5.2/master still assumes the existence of the <code class="notranslate">codec</code> member:<br>
</p><div class="Box Box--condensed my-2">
  <div class="Box-header f6">
    <p class="mb-0 text-bold">
      <a href="https://github.com/opencv/opencv/blob/ae4cc404c15a206e7bc953e183e9a6812df6d5b0/modules/videoio/src/cap_ffmpeg_impl.hpp#L606">opencv/modules/videoio/src/cap_ffmpeg_impl.hpp</a>
    </p>
    <p class="mb-0 color-fg-muted">
         Line 606
      in
      <a data-pjax="true" class="commit-tease-sha" href="/opencv/opencv/commit/ae4cc404c15a206e7bc953e183e9a6812df6d5b0">ae4cc40</a>
    </p>
  </div>
  <div itemprop="text" class="Box-body p-0 blob-wrapper blob-wrapper-embedded data">
    <table class="highlight tab-size mb-0 js-file-line-container" data-tab-size="8" data-paste-markdown-skip="">

        <tbody><tr class="border-0">
          <td id="L606" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="606"></td>
          <td id="LC606" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-c1">avcodec_close</span>( video_st-&gt;<span class="pl-smi">codec</span> ); </td>
        </tr>
    </tbody></table>
  </div>
</div>
<p></p>
<p dir="auto">I've checked issues and pull requests for mentions of <code class="notranslate">codecpar</code> and it seems this hasn't been reported yet.</p>