fprintf(fvstats,"type= %s\n", av_get_pict_type_char(enc->coded_frame->pict_type));
fprintf(fvstats,"type= %c\n", av_get_pict_type_char(enc->coded_frame->pict_type));
static void do_video_stats(AVFormatContext *os, AVOutputStream *ost,                            int frame_size){    static FILE *fvstats=NULL;    static int64_t total_size = 0;    char filename[40];    time_t today2;    struct tm *today;    AVCodecContext *enc;    int frame_number;    int64_t ti;    double ti1, bitrate, avg_bitrate;        if (!fvstats) {        today2 = time(NULL);        today = localtime(&today2);        sprintf(filename, "vstats_%02d%02d%02d.log", today->tm_hour,                                               today->tm_min,                                               today->tm_sec);        fvstats = fopen(filename,"w");        if (!fvstats) {            perror("fopen");            exit(1);        }    }        ti = MAXINT64;    enc = &ost->st->codec;    total_size += frame_size;    if (enc->codec_type == CODEC_TYPE_VIDEO) {        frame_number = ost->frame_number;        fprintf(fvstats, "frame= %5d q= %2.1f ", frame_number, enc->coded_frame->quality);        if (enc->flags&CODEC_FLAG_PSNR)            fprintf(fvstats, "PSNR= %6.2f ", psnr(enc->coded_frame->error[0]/(enc->width*enc->height*255.0*255.0)));                fprintf(fvstats,"f_size= %6d ", frame_size);        /* compute pts value */        ti1 = (double)ost->st->pts.val * os->pts_num / os->pts_den;        if (ti1 < 0.01)            ti1 = 0.01;            bitrate = (double)(frame_size * 8) * enc->frame_rate / enc->frame_rate_base / 1000.0;        avg_bitrate = (double)(total_size * 8) / ti1 / 1000.0;        fprintf(fvstats, "s_size= %8.0fkB time= %0.3f br= %7.1fkbits/s avg_br= %7.1fkbits/s ",            (double)total_size / 1024, ti1, bitrate, avg_bitrate);        fprintf(fvstats,"type= %s\n", av_get_pict_type_char(enc->coded_frame->pict_type));            }}