fprintf(stderr, "%s    \r", buf);
if (verbose >= 0) fprintf(stderr, "%s    \r", buf);
static void print_report(AVFormatContext **output_files,			 AVOutputStream **ost_table, int nb_ostreams,			 int is_last_report){    char buf[1024];    AVOutputStream *ost;    AVFormatContext *oc, *os;    int64_t total_size;    AVCodecContext *enc;    int frame_number, vid, i;    double bitrate, ti1, pts;    static int64_t last_time = -1;        if (!is_last_report) {        int64_t cur_time;        /* display the report every 0.5 seconds */        cur_time = av_gettime();        if (last_time == -1) {            last_time = cur_time;            return;        }         if ((cur_time - last_time) < 500000)            return;        last_time = cur_time;    }    oc = output_files[0];    total_size = url_ftell(&oc->pb);        buf[0] = '\0';    ti1 = 1e10;    vid = 0;    for(i=0;i<nb_ostreams;i++) {        ost = ost_table[i];        os = output_files[ost->file_index];        enc = &ost->st->codec;        if (vid && enc->codec_type == CODEC_TYPE_VIDEO) {            sprintf(buf + strlen(buf), "q=%2.1f ",                    enc->coded_frame->quality/(float)FF_QP2LAMBDA);        }        if (!vid && enc->codec_type == CODEC_TYPE_VIDEO) {            frame_number = ost->frame_number;            sprintf(buf + strlen(buf), "frame=%5d q=%2.1f ",                    frame_number, enc->coded_frame ? enc->coded_frame->quality/(float)FF_QP2LAMBDA : 0);            if(is_last_report)                sprintf(buf + strlen(buf), "L");            if (enc->flags&CODEC_FLAG_PSNR){                int j;                double error, error_sum=0;                double scale, scale_sum=0;                char type[3]= {'Y','U','V'};                sprintf(buf + strlen(buf), "PSNR=");                for(j=0; j<3; j++){                    if(is_last_report){                        error= enc->error[j];                        scale= enc->width*enc->height*255.0*255.0*frame_number;                    }else{                        error= enc->coded_frame->error[j];                        scale= enc->width*enc->height*255.0*255.0;                    }                    if(j) scale/=4;                    error_sum += error;                    scale_sum += scale;                    sprintf(buf + strlen(buf), "%c:%2.2f ", type[j], psnr(error/scale));                }                sprintf(buf + strlen(buf), "*:%2.2f ", psnr(error_sum/scale_sum));            }            vid = 1;        }        /* compute min output value */        pts = (double)ost->st->pts.val * os->pts_num / os->pts_den;        if ((pts < ti1) && (pts > 0))            ti1 = pts;    }    if (ti1 < 0.01)        ti1 = 0.01;        if (verbose || is_last_report) {        bitrate = (double)(total_size * 8) / ti1 / 1000.0;                sprintf(buf + strlen(buf),             "size=%8.0fkB time=%0.1f bitrate=%6.1fkbits/s",            (double)total_size / 1024, ti1, bitrate);                fprintf(stderr, "%s    \r", buf);        fflush(stderr);    }            if (is_last_report)        fprintf(stderr, "\n");}