fps1 = (((float)fps / FRAME_RATE_BASE) * 1000);
fps1 = (((float)fps / st->codec.frame_rate_base) * 1000);
static int yuv4_write_header(AVFormatContext *s){    AVStream *st;    int width, height;    int raten, rated, aspectn, aspectd, fps, fps1, n;    char buf[Y4M_LINE_MAX+1];    if (s->nb_streams != 1)        return -EIO;        st = s->streams[0];    width = st->codec.width;    height = st->codec.height;        fps = st->codec.frame_rate;    fps1 = (((float)fps / FRAME_RATE_BASE) * 1000);      /* Sorry about this messy code, but mpeg2enc is very picky about    * the framerates it accepts. */    switch(fps1) {    case 23976:        raten = 24000; /* turn the framerate into a ratio */        rated = 1001;        break;    case 29970:        raten = 30000;        rated = 1001;        break;    case 25000:        raten = 25;        rated = 1;        break;    case 30000:        raten = 30;        rated = 1;        break;    case 24000:        raten = 24;        rated = 1;        break;    case 50000:        raten = 50;        rated = 1;        break;    case 59940:        raten = 60000;        rated = 1001;        break;    case 60000:        raten = 60;        rated = 1;        break;    default:        raten = fps1; /* this setting should work, but often doesn't */        rated = 1000;        break;    }        aspectn = 1;    aspectd = 1;	/* ffmpeg always uses a 1:1 aspect ratio */    /* construct stream header, if this is the first frame */    n = snprintf(buf, sizeof(buf), "%s W%d H%d F%d:%d I%s A%d:%d\n",                 Y4M_MAGIC,                 width,                 height,                 raten, rated,                 "p",			/* ffmpeg seems to only output progressive video */                 aspectn, aspectd);    if (n < 0) {        fprintf(stderr, "Error. YUV4MPEG stream header write failed.\n");        return -EIO;    } else {        put_buffer(&s->pb, buf, strlen(buf));    }    return 0;}