<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    I changed the Audio codec to WMAV2, and left the rest of the
    AudioCodec settings the same Now the program crashes at this line in
    the QtMel code:<br>
    <br>
    int outSize = avcodec_encode_audio(<span style=" font-weight:600;">m_audioStream</span>-><span
      style=" font-weight:600;">codec</span>, <span style="
      font-weight:600;">m_audioOutputBuffer</span>, <span style="
      font-weight:600;">m_audioOutputBufferSize</span>, (short
    *)samples.data<span style=" color:#ffff00;"><font color="#000000">())</font>;</span><br>
    <br>
    In debug the error staates "Stopped in thread 2 by:Exception at
    0x66364c62, cod:0xc0000005: write access violation at:0x1, flags=0x0
    (first chance).<br>
    <br>
    I suspect I don't have the audio settings set write, but I am not
    sure how to set them for WMAV2.<br>
    <br>
    <br>
    <br>
    On 6/17/2015 4:30 PM, Kevin J. Brooks wrote:<br>
    <blockquote cite="mid:5581E6F9.8050408@r2c-ss.com" type="cite">
      <meta content="text/html; charset=windows-1252"
        http-equiv="Content-Type">
      I am setting the AudioCodec to MP3,  I am using the pre-built
      libraries the code I have the causes the issue is from the code
      for the QtMEL library.  What I am posting here is the Audio Codec
      setup for the QtMel object.  I hope it helps.<br>
      <br>
      BTW I am using H264 for the Video Codec.  If I record video only,
      it does work, it is only if I try to add sound that it fails.<br>
      <span style=" color:#646482;"> </span><span style="
        color:#aaff00;"><br>
        <font color="#000000">CR2CAudioFormat</font></span> format;
      <pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">    format.setChannelCount(2);</pre>
      <pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">    format.setSampleRate(44100);</pre>
      <pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">    format.setFormat(CR2CAudioFormat::SignedInt16);</pre>
      <br>
      I really don't have a preference for the codec, I just need to
      know how to set it up properly. I am totally new at recording
      video and audio.<br>
      <br>
      <div class="moz-cite-prefix">
        <meta http-equiv="content-type" content="text/html;
          charset=windows-1252">
        On 6/17/2015 1:08 AM, Taha Ansari wrote:<br>
      </div>
      <blockquote
cite="mid:CAK2cdgBVRZMzPmPP_H8A6BXpmDRRqQ5qxRWxFqMr=pAC2gDRHA@mail.gmail.com"
        type="cite">
        <div dir="ltr">On Wed, Jun 17, 2015 at 2:17 AM, Gonzalo
          Garramuno <span dir="ltr"><<a moz-do-not-send="true"
              href="mailto:ggarra13@gmail.com" target="_blank">ggarra13@gmail.com</a>></span>
          wrote:<br>
          <div class="gmail_extra">
            <div class="gmail_quote">
              <blockquote class="gmail_quote" style="margin:0 0 0
                .8ex;border-left:1px #ccc solid;padding-left:1ex"><span
                  class="">On 16/06/15 09:06, Kevin J. Brooks wrote:<br>
                  <blockquote class="gmail_quote" style="margin:0 0 0
                    .8ex;border-left:1px #ccc solid;padding-left:1ex">
                    Yes I am.  For more information, I am developing on
                    Windoze 7.<br>
                  </blockquote>
                </span> avcodec_open2 can fail if you lack the library
                for the codec you want to decode or encode.  For
                example, libx264.  The libraries in <a
                  moz-do-not-send="true"
                  href="http://ffmpeg.zeranoe.com" rel="noreferrer"
                  target="_blank">ffmpeg.zeranoe.com</a> contain all
                codecs, but they are GPL only.  You should try them
                first and see if the problem goes away.  If it does, you
                know you have to compile ffmpeg with different flags.<span
                  class="HOEnZb"></span><br>
              </blockquote>
            </div>
            <br>
          </div>
          <div class="gmail_extra">Since he mentions Windows 7, I assume
            he is using pre-built packages from zeranoe site (as you
            mention). These builds contain proprietary codec(s) like
            x264 (non GPL).<br>
            <br>
          </div>
          <div class="gmail_extra">@Kevin: maybe you have some bare
            minimum code with you that can produce this error, which
            people can have a look? <br>
          </div>
        </div>
        <br>
        <fieldset class="mimeAttachmentHeader"></fieldset>
        <br>
        <pre wrap="">_______________________________________________
Libav-user mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:Libav-user@ffmpeg.org">Libav-user@ffmpeg.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://ffmpeg.org/mailman/listinfo/libav-user">http://ffmpeg.org/mailman/listinfo/libav-user</a>
</pre>
      </blockquote>
      <br>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <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="http://ffmpeg.org/mailman/listinfo/libav-user">http://ffmpeg.org/mailman/listinfo/libav-user</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>