<div dir="ltr">Hi, "libvpx" is not input format, see this for example<div><br></div><div><div>  AVCodec* pDecoder = avcodec_find_decoder(m_pStreamCtx->codecpar->codec_id);</div><div>  if(m_pStreamCtx->codecpar->codec_id==AV_CODEC_ID_VP8){</div><div>    // on2 vp8 does not extract alpha</div><div>    AVCodec* pDecoder2 = avcodec_find_decoder_by_name("libvpx");</div><div>    if(pDecoder2) pDecoder = pDecoder2;</div><div>  }</div></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2018-06-15 3:02 GMT+03:00 Mark Schafer <span dir="ltr"><<a href="mailto:mschafer@wireframe.biz" target="_blank">mschafer@wireframe.biz</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF">
    <p>Ahh I think its</p>
    <pre class="m_589738237636612550lang-cpp m_589738237636612550prettyprint m_589738237636612550prettyprinted"><code><span class="m_589738237636612550typ">AVInputFormat</span><span class="m_589738237636612550pln"> </span><span class="m_589738237636612550pun">*</span><span class="m_589738237636612550pln">inputFormat </span><span class="m_589738237636612550pun">=</span><span class="m_589738237636612550pln">av_find_input_format</span><span class="m_589738237636612550pun">(</span><span class="m_589738237636612550str">"</span></code><code><span class="m_589738237636612550str">libvpx"</span><span class="m_589738237636612550pun"><wbr>);
</span></code><code><span class="m_589738237636612550pun"></span><span class="m_589738237636612550pln">avformat_open_input</span><span class="m_589738237636612550pun">(&</span><span class="m_589738237636612550pln">pAVFormat<wbr>Context</span><span class="m_589738237636612550pun">,</span><span class="m_589738237636612550pln"> dev_name</span><span class="m_589738237636612550pun">,</span><span class="m_589738237636612550pln"> inputFormat</span><span class="m_589738237636612550pun">,</span><span class="m_589738237636612550pln"> NULL</span><span class="m_589738237636612550pun">)</span><span class="m_589738237636612550pln"> </span></code>
<code><span class="m_589738237636612550pun"></span></code></pre><div><div class="h5">
    <br>
    <div class="m_589738237636612550moz-cite-prefix">On 6/15/2018 11:49 AM, Mark Schafer
      wrote:<br>
    </div>
    <blockquote type="cite">OK.
      Thanks Carl.
      <br>
      <br>
      So you're saying I should always override it with libvpx if the
      file I'm loading is .webm ?
      <br>
      and if you don't mind - how do I override the codec on load ?
      <br>
      Is it in AVInputFormat by stipulating the extension and codec_tag
      ?
      <br>
      <br>
      <br>
      On 6/15/2018 11:13 AM, Carl Eugen Hoyos wrote:
      <br>
      <blockquote type="cite">2018-06-14 23:03 GMT+02:00, Mark Schafer
        <a class="m_589738237636612550moz-txt-link-rfc2396E" href="mailto:mschafer@wireframe.biz" target="_blank"><mschafer@wireframe.biz></a>:
        <br>
        <blockquote type="cite">We're trying to integrate ffmpeg 4 with
          Pyglet.
          <br>
          Its all going very well but we have one issue:
          <br>
          <br>
          - If a VP9 (or VP8) file is created using ffmpeg4 from png
          files with
          <br>
          alphas, we get a video file (webm) with alpha internally.
          (Excellent)
          <br>
          - ffmpeg -i image_seq%03d.png -qmin 0 -qmax 50 -crf 5 -b:v 1M
          output.webm
          <br>
                - The report from this CLI indicates that an alpha has
          been generated.
          <br>
          <br>
          - Sample webm videos with alpha can be found on this page:
          <br>
          <a class="m_589738237636612550moz-txt-link-freetext" href="https://simpl.info/videoalpha/" target="_blank">https://simpl.info/videoalpha/</a>
          <br>
          - However on playing back we only get the RGB and do not get
          the alpha
          <br>
          unless we override the codec to be 'libvpx'.
          <br>
        </blockquote>
        Yes, this is a known limitation of the native decoder, luckily
        you
        <br>
        have already found the only known work-around - not to use it if
        <br>
        you need this feature.
        <br>
        <br>
        If you really want to choose the decoder based on the alpha
        <br>
        layer, you can check AV_PKT_DATA_MATROSKA_<wbr>BLOCKADDITIONAL
        <br>
        if the side_data starts with (uint64_t) 1 there is a
        transparency layer.
        <br>
        <br>
        It is probably simpler to always use the libvpx decoder.
        <br>
        <br>
        Carl Eugen
        <br>
        ______________________________<wbr>_________________
        <br>
        Libav-user mailing list
        <br>
        <a class="m_589738237636612550moz-txt-link-abbreviated" href="mailto:Libav-user@ffmpeg.org" target="_blank">Libav-user@ffmpeg.org</a>
        <br>
        <a class="m_589738237636612550moz-txt-link-freetext" href="http://ffmpeg.org/mailman/listinfo/libav-user" target="_blank">http://ffmpeg.org/mailman/<wbr>listinfo/libav-user</a>
        <br>
      </blockquote>
      <br>
      ______________________________<wbr>_________________
      <br>
      Libav-user mailing list
      <br>
      <a class="m_589738237636612550moz-txt-link-abbreviated" href="mailto:Libav-user@ffmpeg.org" target="_blank">Libav-user@ffmpeg.org</a>
      <br>
      <a class="m_589738237636612550moz-txt-link-freetext" href="http://ffmpeg.org/mailman/listinfo/libav-user" target="_blank">http://ffmpeg.org/mailman/<wbr>listinfo/libav-user</a>
      <br>
    </blockquote>
    <br>
  </div></div></div>

<br>______________________________<wbr>_________________<br>
Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org">Libav-user@ffmpeg.org</a><br>
<a href="http://ffmpeg.org/mailman/listinfo/libav-user" rel="noreferrer" target="_blank">http://ffmpeg.org/mailman/<wbr>listinfo/libav-user</a><br>
<br></blockquote></div><br></div>