Commit 60c2cddf authored by Michael Niedermayer's avatar Michael Niedermayer

ffmpeg: use the correct variables in do_video_stats()

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent e98fab13
...@@ -958,14 +958,14 @@ static void do_video_stats(OutputStream *ost, int frame_size) ...@@ -958,14 +958,14 @@ static void do_video_stats(OutputStream *ost, int frame_size)
enc = ost->st->codec; enc = ost->st->codec;
if (enc->codec_type == AVMEDIA_TYPE_VIDEO) { if (enc->codec_type == AVMEDIA_TYPE_VIDEO) {
frame_number = ost->frame_number; frame_number = ost->st->nb_frames;
fprintf(vstats_file, "frame= %5d q= %2.1f ", frame_number, enc->coded_frame->quality / (float)FF_QP2LAMBDA); fprintf(vstats_file, "frame= %5d q= %2.1f ", frame_number, enc->coded_frame->quality / (float)FF_QP2LAMBDA);
if (enc->flags&CODEC_FLAG_PSNR) if (enc->flags&CODEC_FLAG_PSNR)
fprintf(vstats_file, "PSNR= %6.2f ", psnr(enc->coded_frame->error[0] / (enc->width * enc->height * 255.0 * 255.0))); fprintf(vstats_file, "PSNR= %6.2f ", psnr(enc->coded_frame->error[0] / (enc->width * enc->height * 255.0 * 255.0)));
fprintf(vstats_file,"f_size= %6d ", frame_size); fprintf(vstats_file,"f_size= %6d ", frame_size);
/* compute pts value */ /* compute pts value */
ti1 = ost->sync_opts * av_q2d(enc->time_base); ti1 = ost->st->pts.val * av_q2d(enc->time_base);
if (ti1 < 0.01) if (ti1 < 0.01)
ti1 = 0.01; ti1 = 0.01;
...@@ -1304,8 +1304,6 @@ static void flush_encoders(void) ...@@ -1304,8 +1304,6 @@ static void flush_encoders(void)
if (pkt.duration > 0) if (pkt.duration > 0)
pkt.duration = av_rescale_q(pkt.duration, enc->time_base, ost->st->time_base); pkt.duration = av_rescale_q(pkt.duration, enc->time_base, ost->st->time_base);
write_frame(os, &pkt, ost); write_frame(os, &pkt, ost);
ost->frame_number ++;
ost->sync_opts ++;
if (ost->st->codec->codec_type == AVMEDIA_TYPE_VIDEO && vstats_filename) { if (ost->st->codec->codec_type == AVMEDIA_TYPE_VIDEO && vstats_filename) {
do_video_stats(ost, pkt.size); do_video_stats(ost, pkt.size);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment