[Libav-user] how to set pixfmt YUV420P10 by CODEC_ID_H264

杨志祥 yangzx at acejet.com.cn
Wed Apr 11 10:14:29 CEST 2012


hi:
   i use last version ffmpeg at my application,now,when i set c->pix_fmt PIX_FMT_YUV420P,it work sucess.but ,i use c->pix_fmt PIX_FMT_YUV420P10,then call 
avcodec_open2(c, pcode, NULL) fail,why? i use code id is codec_id_h264. code:
 
fmt=av_guess_format("flv",NULL,NULL);
    pCodeH264=avcodec_find_encoder(CODEC_ID_H264);
......
codec = avcodec_find_encoder(codec_id);
....
  c = st->codec;
       c->codec_id=codec->id;
......
  c->pix_fmt =/* STREAM_PIX_FMT*/PIX_FMT_YUV420P;
  c->profile=FF_PROFILE_H264_HIGH_10/*FF_PROFILE_H264_HIGH_10_INTRA*/;
......
avcodec_open2(c, pcode, NULL);
 
thanks!


More information about the Libav-user mailing list