if (pts < ti1)
if ((pts < ti1) && (pts > 0))
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 total_size;    AVCodecContext *enc;    int frame_number, vid, i;    double bitrate, ti1, pts;    static INT64 last_time = -1;        if (!is_last_report) {        INT64 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) {            frame_number = ost->frame_number;            sprintf(buf + strlen(buf), "frame=%5d q=%2d ",                    frame_number, enc->quality);            if (do_psnr)                sprintf(buf + strlen(buf), "PSNR=%6.2f ", enc->psnr_y);            vid = 1;        }        /* compute min output value */        pts = (double)ost->st->pts.val * os->pts_num / os->pts_den;        if (pts < ti1)            ti1 = pts;    }    if (ti1 < 0.01)        ti1 = 0.01;    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   ", buf);        if (is_last_report) {        fprintf(stderr, "\n");    } else {        fprintf(stderr, "\r");        fflush(stderr);    }}