<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p><br>
    </p>
    <br>
    <div class="moz-cite-prefix">El 29/03/18 a las 07:43, Vittalprasad
      escribió:<br>
    </div>
    <blockquote type="cite"
cite="mid:CANZS5ZzUieC2qPMANjLR4hGpUipEABuyEmLUtOhZCt-KiO8emQ@mail.gmail.com">
      <div dir="ltr">
        <span style="font-family:tahoma,sans-serif">
          <div><span>Hi Team,</span></div>
          <div><span><br>
            </span></div>
          <div><span>I have written sample application using FFMPEG
              Libraries  to encode YUV, but here i would like to know
              how to  specify H264 profile and levels for encoder.</span></div>
          <div><span><br>
            </span></div>
          <div><span>This is how i'm filling Encode context</span></div>
          <div><span><br>
            </span></div>
          <div><span>const AVCodec *codec_enc;</span></div>
          <div><span>AVCodecContext *c_enc = NULL;</span></div>
          <div><span>     c_enc = avcodec_alloc_context3(codec_enc);</span></div>
          <div><span>        if (!c_enc) {</span></div>
          <div><span>                printf( "Could not allocate video
              codec context\n");</span></div>
          <div><span>                exit(1);</span></div>
          <div><span>        }</span></div>
          <div><span>        //c_enc->bit_rate = c_dec->bit_rate;</span></div>
          <div><span>        c_enc->width = 176;// 320;</span></div>
          <div><span>        c_enc->height = 144;// 240;</span></div>
          <div><span>        c_enc->time_base = (AVRational){1, 25};</span></div>
          <div><span>        c_enc->framerate = (AVRational){25, 1};</span></div>
          <div><span>        c_enc->gop_size =   c_dec->gop_size;
              //10;</span></div>
          <div><span>        //c->max_b_frames = 1;/////vittal to
              enable or disable b frames</span></div>
          <div><span>        c_enc->pix_fmt = AV_PIX_FMT_YUV420P;</span></div>
        </span><br>
      </div>
    </blockquote>
    Choose one of:<br>
    <br>
    c_enc->profile = FF_PROFILE_H264_BASELINE;<br>
    <div dir="ltr">c_enc->profile =
      FF_PROFILE_H264_CONSTRAINED_BASELINE;</div>
    <div dir="ltr">c_enc->profile = FF_PROFILE_H264_MAIN;</div>
    <div dir="ltr">c_enc->profile = FF_PROFILE_H264_EXTENDED;</div>
    <div dir="ltr">
      <div dir="ltr">c_enc->profile = FF_PROFILE_H264_HIGH_10;
        <br>
      </div>
      c_enc->profile = FF_PROFILE_H264_HIGH_422;<br>
      c_enc->profile = FF_PROFILE_H264_HIGH_444;</div>
    <pre class="moz-signature" cols="72">-- 
Gonzalo Garramuño</pre>
  </body>
</html>