printf("Assuming %s for target.\n", norm ? "NTSC" : "PAL");
fprintf(stderr, "Assuming %s for target.\n", norm ? "NTSC" : "PAL");
static void opt_target(const char *arg){    int norm = -1;    static const char const *frame_rates[] = {"25", "30000/1001", "24000/1001"};    if(!strncmp(arg, "pal-", 4)) {        norm = 0;        arg += 4;    } else if(!strncmp(arg, "ntsc-", 5)) {        norm = 1;        arg += 5;    } else if(!strncmp(arg, "film-", 5)) {        norm = 2;        arg += 5;    } else {        int fr;        /* Calculate FR via float to avoid int overflow */        fr = (int)(frame_rate * 1000.0 / frame_rate_base);        if(fr == 25000) {            norm = 0;        } else if((fr == 29970) || (fr == 23976)) {            norm = 1;        } else {            /* Try to determine PAL/NTSC by peeking in the input files */            if(nb_input_files) {                int i, j;                for(j = 0; j < nb_input_files; j++) {                    for(i = 0; i < input_files[j]->nb_streams; i++) {                        AVCodecContext *c = &input_files[j]->streams[i]->codec;                        if(c->codec_type != CODEC_TYPE_VIDEO)                            continue;                        fr = c->frame_rate * 1000 / c->frame_rate_base;                        if(fr == 25000) {                            norm = 0;                            break;                        } else if((fr == 29970) || (fr == 23976)) {                            norm = 1;                            break;                        }                    }                    if(norm >= 0)                        break;                }            }        }        if(verbose && norm >= 0)            printf("Assuming %s for target.\n", norm ? "NTSC" : "PAL");    }    if(norm < 0) {        fprintf(stderr, "Could not determine norm (PAL/NTSC/NTSC-Film) for target.\n");        fprintf(stderr, "Please prefix target with \"pal-\", \"ntsc-\" or \"film-\",\n");        fprintf(stderr, "or set a framerate with \"-r xxx\".\n");        exit(1);    }    if(!strcmp(arg, "vcd")) {        opt_video_codec("mpeg1video");        opt_audio_codec("mp2");        opt_format("vcd");        opt_frame_size(norm ? "352x240" : "352x288");        opt_frame_rate(frame_rates[norm]);        opt_gop_size(norm ? "18" : "15");        video_bit_rate = 1150000;        video_rc_max_rate = 1150000;        video_rc_min_rate = 1150000;        video_rc_buffer_size = 40*1024*8;        audio_bit_rate = 224000;        audio_sample_rate = 44100;                mux_packet_size= 2324;        mux_rate= 2352 * 75 * 8;        /* We have to offset the PTS, so that it is consistent with the SCR.           SCR starts at 36000, but the first two packs contain only padding           and the first pack from the other stream, respectively, may also have           been written before.           So the real data starts at SCR 36000+3*1200. */        mux_preload= (36000+3*1200) / 90000.0; //0.44    } else if(!strcmp(arg, "svcd")) {        opt_video_codec("mpeg2video");        opt_audio_codec("mp2");        opt_format("svcd");        opt_frame_size(norm ? "480x480" : "480x576");        opt_frame_rate(frame_rates[norm]);        opt_gop_size(norm ? "18" : "15");        video_bit_rate = 2040000;        video_rc_max_rate = 2516000;        video_rc_min_rate = 0; //1145000;        video_rc_buffer_size = 224*1024*8;        use_scan_offset = 1;        audio_bit_rate = 224000;        audio_sample_rate = 44100;        mux_packet_size= 2324;    } else if(!strcmp(arg, "dvd")) {        opt_video_codec("mpeg2video");        opt_audio_codec("ac3");        opt_format("dvd");        opt_frame_size(norm ? "720x480" : "720x576");        opt_frame_rate(frame_rates[norm]);        opt_gop_size(norm ? "18" : "15");        video_bit_rate = 6000000;        video_rc_max_rate = 9000000;        video_rc_min_rate = 0; //1500000;        video_rc_buffer_size = 224*1024*8;        mux_packet_size= 2048;  // from www.mpucoder.com: DVD sectors contain 2048 bytes of data, this is also the size of one pack.        mux_rate = 10080000;    // from mplex project: data_rate = 1260000. mux_rate = data_rate * 8        audio_bit_rate = 448000;        audio_sample_rate = 48000;    } else if(!strcmp(arg, "dv")) {        opt_format("dv");        opt_frame_size(norm ? "720x480" : "720x576");        opt_frame_rate(frame_rates[norm]);        audio_sample_rate = 48000;        audio_channels = 2;    } else {        fprintf(stderr, "Unknown target: %s\n", arg);        exit(1);    }}