Revision 315b0f97

View differences:

ffmpeg.c
130 130
static int video_codec_id = CODEC_ID_NONE;
131 131
static int video_codec_tag = 0;
132 132
static int same_quality = 0;
133
static int b_frames = 0;
134 133
static int do_deinterlace = 0;
135 134
static int workaround_bugs = FF_BUG_AUTODETECT;
136 135
static int packet_size = 0;
......
2336 2335
    frame_aspect_ratio = ar;
2337 2336
}
2338 2337

  
2339
static void opt_b_frames(const char *arg)
2340
{
2341
    b_frames = atoi(arg);
2342
    if (b_frames > FF_MAX_B_FRAMES) {
2343
        fprintf(stderr, "\nCannot have more than %d B frames, increase FF_MAX_B_FRAMES.\n", FF_MAX_B_FRAMES);
2344
        exit(1);
2345
    } else if (b_frames < 1) {
2346
        fprintf(stderr, "\nNumber of B frames must be higher than 0\n");
2347
        exit(1);
2348
    }
2349
}
2350

  
2351 2338
static void opt_qscale(const char *arg)
2352 2339
{
2353 2340
    video_qscale = atof(arg);
......
2968 2955
        if(inter_matrix)
2969 2956
            video_enc->inter_matrix = inter_matrix;
2970 2957

  
2971
        video_enc->max_b_frames = b_frames;
2972 2958
        video_enc->qmin = video_qmin;
2973 2959
        video_enc->qmax = video_qmax;
2974 2960
        video_enc->lmin = video_lmin;
......
3921 3907
      "method" },
3922 3908
    { "me_threshold", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_me_threshold}, "motion estimaton threshold",  "" },
3923 3909
    { "mb_threshold", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_mb_threshold}, "macroblock threshold",  "" },
3924
    { "bf", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_b_frames}, "use 'frames' B frames", "frames" },
3925 3910
    { "bug", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_workaround_bugs}, "workaround not auto detected encoder bugs", "param" },
3926 3911
    { "ps", HAS_ARG | OPT_EXPERT, {(void*)opt_packet_size}, "set packet size in bits", "size" },
3927 3912
    { "error", HAS_ARG | OPT_EXPERT, {(void*)opt_error_rate}, "error rate", "rate" },
libavcodec/utils.c
507 507
{"qmin", "min video quantiser scale (VBR)", OFFSET(qmin), FF_OPT_TYPE_INT, 2, 0, INT_MAX, V|E},
508 508
{"qmax", "max video quantiser scale (VBR)", OFFSET(qmax), FF_OPT_TYPE_INT, 31, 0, INT_MAX, V|E},
509 509
{"qdiff", "max difference between the quantiser scale (VBR)", OFFSET(max_qdiff), FF_OPT_TYPE_INT, 3, INT_MIN, INT_MAX, V|E},
510
{"bf", "use 'frames' B frames", OFFSET(max_b_frames), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|E},
510
{"bf", "use 'frames' B frames", OFFSET(max_b_frames), FF_OPT_TYPE_INT, DEFAULT, 0, FF_MAX_B_FRAMES, V|E},
511 511
{"b_qfactor", "qp factor between p and b frames", OFFSET(b_quant_factor), FF_OPT_TYPE_FLOAT, 1.25, FLT_MIN, FLT_MAX, V|E},
512 512
{"rc_strategy", NULL, OFFSET(rc_strategy), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|E},
513 513
{"b_strategy", NULL, OFFSET(b_frame_strategy), FF_OPT_TYPE_INT, 0, INT_MIN, INT_MAX, V|E},

Also available in: Unified diff