(float)enc->frame_rate / FRAME_RATE_BASE);
(float)enc->frame_rate / enc->frame_rate_base);
void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode){    const char *codec_name;    AVCodec *p;    char buf1[32];    char channels_str[100];    int bitrate;    if (encode)        p = avcodec_find_encoder(enc->codec_id);    else        p = avcodec_find_decoder(enc->codec_id);    if (p) {        codec_name = p->name;    } else if (enc->codec_name[0] != '\0') {        codec_name = enc->codec_name;    } else {        /* output avi tags */        if (enc->codec_type == CODEC_TYPE_VIDEO) {            snprintf(buf1, sizeof(buf1), "%c%c%c%c",                      enc->codec_tag & 0xff,                     (enc->codec_tag >> 8) & 0xff,                     (enc->codec_tag >> 16) & 0xff,                     (enc->codec_tag >> 24) & 0xff);        } else {            snprintf(buf1, sizeof(buf1), "0x%04x", enc->codec_tag);        }        codec_name = buf1;    }    switch(enc->codec_type) {    case CODEC_TYPE_VIDEO:        snprintf(buf, buf_size,                 "Video: %s%s",                 codec_name, enc->flags & CODEC_FLAG_HQ ? " (hq)" : "");        if (enc->codec_id == CODEC_ID_RAWVIDEO) {            snprintf(buf + strlen(buf), buf_size - strlen(buf),                     ", %s",                     avcodec_get_pix_fmt_name(enc->pix_fmt));        }        if (enc->width) {            snprintf(buf + strlen(buf), buf_size - strlen(buf),                     ", %dx%d, %0.2f fps",                     enc->width, enc->height,                      (float)enc->frame_rate / FRAME_RATE_BASE);        }        if (encode) {            snprintf(buf + strlen(buf), buf_size - strlen(buf),                     ", q=%d-%d", enc->qmin, enc->qmax);        }        bitrate = enc->bit_rate;        break;    case CODEC_TYPE_AUDIO:        snprintf(buf, buf_size,                 "Audio: %s",                 codec_name);        switch (enc->channels) {            case 1:                strcpy(channels_str, "mono");                break;            case 2:                strcpy(channels_str, "stereo");                break;            case 6:                strcpy(channels_str, "5:1");                break;            default:                sprintf(channels_str, "%d channels", enc->channels);                break;        }        if (enc->sample_rate) {            snprintf(buf + strlen(buf), buf_size - strlen(buf),                     ", %d Hz, %s",                     enc->sample_rate,                     channels_str);        }                /* for PCM codecs, compute bitrate directly */        switch(enc->codec_id) {        case CODEC_ID_PCM_S16LE:        case CODEC_ID_PCM_S16BE:        case CODEC_ID_PCM_U16LE:        case CODEC_ID_PCM_U16BE:            bitrate = enc->sample_rate * enc->channels * 16;            break;        case CODEC_ID_PCM_S8:        case CODEC_ID_PCM_U8:        case CODEC_ID_PCM_ALAW:        case CODEC_ID_PCM_MULAW:            bitrate = enc->sample_rate * enc->channels * 8;            break;        default:            bitrate = enc->bit_rate;            break;        }        break;    default:        av_abort();    }    if (encode) {        if (enc->flags & CODEC_FLAG_PASS1)            snprintf(buf + strlen(buf), buf_size - strlen(buf),                     ", pass 1");        if (enc->flags & CODEC_FLAG_PASS2)            snprintf(buf + strlen(buf), buf_size - strlen(buf),                     ", pass 2");    }    if (bitrate != 0) {        snprintf(buf + strlen(buf), buf_size - strlen(buf),                  ", %d kb/s", bitrate / 1000);    }}