[Libav-user] H264 profiles and Levels

Gonzalo Garramuño ggarra13 at gmail.com
Thu Mar 29 14:37:42 EEST 2018



El 29/03/18 a las 07:43, Vittalprasad escribió:
> Hi Team,
>
> 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.
>
> This is how i'm filling Encode context
>
> const AVCodec *codec_enc;
> AVCodecContext *c_enc = NULL;
>      c_enc = avcodec_alloc_context3(codec_enc);
>         if (!c_enc) {
>                 printf( "Could not allocate video codec context\n");
>                 exit(1);
>         }
>         //c_enc->bit_rate = c_dec->bit_rate;
>         c_enc->width = 176;// 320;
>         c_enc->height = 144;// 240;
>         c_enc->time_base = (AVRational){1, 25};
>         c_enc->framerate = (AVRational){25, 1};
>         c_enc->gop_size =   c_dec->gop_size; //10;
>         //c->max_b_frames = 1;/////vittal to enable or disable b frames
>         c_enc->pix_fmt = AV_PIX_FMT_YUV420P;
>
Choose one of:

c_enc->profile = FF_PROFILE_H264_BASELINE;
c_enc->profile = FF_PROFILE_H264_CONSTRAINED_BASELINE;
c_enc->profile = FF_PROFILE_H264_MAIN;
c_enc->profile = FF_PROFILE_H264_EXTENDED;
c_enc->profile = FF_PROFILE_H264_HIGH_10;
c_enc->profile = FF_PROFILE_H264_HIGH_422;
c_enc->profile = FF_PROFILE_H264_HIGH_444;

-- 
Gonzalo Garramuño

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20180329/7483d3bf/attachment.html>


More information about the Libav-user mailing list