[Libav-user] MPEG2VIDEO error (codec not yet implemented) in 5.0.1 ???

francesco at blt.it francesco at blt.it
Wed May 18 11:45:36 EEST 2022


Hi to all
in these days I switched from ffmpeg libraries 4.3.1 to the 5.0.1.
With great surprise I receive this error attempting to open codec.
Here is an excerpt of code


  pCodec =  avcodec_find_encoder(AV_CODEC_ID_MPEG2VIDEO);
  pCodecCtx = avcodec_alloc_context3(pCodec);
  pCodecCtx->height = 1080;     pCodecCtx->width = 1920;    
  pCodecCtx->time_base.num = 1;        pCodecCtx->time_base.den = 25; 
  pCodecCtx->rc_buffer_size = 17825792;  pCodecCtx->rc_initial_buffer_occupancy =  17825792;
  pCodecCtx->profile = FF_PROFILE_MPEG2_422;
  pCodecCtx->flags =  AV_CODEC_FLAG_INTERLACED_DCT | AV_CODEC_FLAG_INTERLACED_ME |  AV_CODEC_FLAG_CLOSED_GOP ;
  pCodecCtx->rc_max_rate = pCodecCtx->rc_min_rate = pCodecCtx->bit_rate =  50000000 ;        
  pCodecCtx->max_b_frames = 2;              pCodecCtx->gop_size = 12;
  pCodecCtx->pix_fmt = AV_PIX_FMT_YUV422P;
  
   err = avcodec_open2(pCodecCtx, pCodec, &imparam);
   if (err<0)
     {
        str1.printf("Error opening codec %s ",pCodec->name);
        if (av_strerror(err, err_str, 1024) == 0) str1.cat_printf("(%s)",err_str);
         else str1.cat_printf("(%d)",err);
        err = -6;   goto _setc_exit;
     }

message is "Error opening codec mpeg2video (Not yet implemented in FFmpeg, patches welcome)".
The same code works fine using 4.3.1 libraries. 
Anyone experieces the same problem ?
regards
Francesco







--


More information about the Libav-user mailing list