Revision 315b0f97 ffmpeg.c

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" },

Also available in: Unified diff