代码之家  ›  专栏  ›  技术社区  ›  ivymike

ffmpeg(libavcodec)警告:编码帧太大

  •  3
  • ivymike  · 技术社区  · 14 年前

    qmax = 6;
    qmin = 2;
    bit_rate = 200000; // if I increase this, I get more warnings. 
    width = 1360;
    height = 768;
    time_base.den = 15; // frames per second
    time_base.num = 1;
    gop_size = 48;
    pix_fmt = PIX_FMT_YUV420P;
    

    当做,

    3 回复  |  直到 14 年前
        1
  •  4
  •   Jeff B    14 年前

    据我所知,ffmpeg分配了一个2MB的恒定缓冲区大小来保存压缩的数据

    您可以通过增加缓冲区大小和/或使其动态化来解决这个问题。

        2
  •  2
  •   psihodelia    14 年前

    ctx->bit_rate = 500000;
    ctx->bit_rate_tolerance = 0;
    ctx->rc_max_rate = 0;
    ctx->rc_buffer_size = 0;
    ctx->gop_size = 40;
    ctx->max_b_frames = 3;
    ctx->b_frame_strategy = 1;
    ctx->coder_type = 1;
    ctx->me_cmp = 1;
    ctx->me_range = 16;
    ctx->qmin = 10;
    ctx->qmax = 51;
    ctx->scenechange_threshold = 40;
    ctx->flags |= CODEC_FLAG_LOOP_FILTER;
    ctx->me_method = ME_HEX;
    ctx->me_subpel_quality = 5;
    ctx->i_quant_factor = 0.71;
    ctx->qcompress = 0.6;
    ctx->max_qdiff = 4;
    ctx->directpred = 1;
    ctx->flags2 |= CODEC_FLAG2_FASTPSKIP;
    
        3
  •  1
  •   Tim Cooper    13 年前

    在示例代码中,我发现如下内容:

    outbuf_size = 100000;
    outbuf = malloc(outbuf_size);
    
    [...]
    
    out_size = avcodec_encode_video(c, outbuf, outbuf_size, picture);
    

    outbuf_size