]> git.sesse.net Git - ffmpeg/commitdiff
ffmpeg.c: Add output file index and stream index to vstats file.
authorSasi Inguva <isasi-at-google.com@ffmpeg.org>
Thu, 26 Jan 2017 00:41:44 +0000 (16:41 -0800)
committerMichael Niedermayer <michael@niedermayer.cc>
Fri, 27 Jan 2017 21:16:37 +0000 (22:16 +0100)
Signed-off-by: Sasi Inguva <isasi@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
doc/ffmpeg.texi
ffmpeg.c
ffmpeg_opt.c

index cdea1a271fd3e7f0e509f5eaee65878036f2f1ec..996d6a6cc48a816f863cd1fe9bdf598f675f6a2b 100644 (file)
@@ -637,9 +637,15 @@ Dump video coding statistics to @file{vstats_HHMMSS.log}.
 @item -vstats_file @var{file}
 Dump video coding statistics to @var{file}.
 @item -vstats_version @var{file}
-Specifies which version of the vstats format to use. If version is 1, format is
+Specifies which version of the vstats format to use. Default is 2.
+
+version = 1 :
 
 @code{frame= %5d q= %2.1f PSNR= %6.2f f_size= %6d s_size= %8.0fkB time= %0.3f br= %7.1fkbits/s avg_br= %7.1fkbits/s}
+
+version > 1:
+
+@code{out= %2d st= %2d frame= %5d q= %2.1f PSNR= %6.2f f_size= %6d s_size= %8.0fkB time= %0.3f br= %7.1fkbits/s avg_br= %7.1fkbits/s}
 @item -top[:@var{stream_specifier}] @var{n} (@emph{output,per-stream})
 top=1/bottom=0/auto=-1 field first
 @item -dc @var{precision}
index 977708c069dc716e6bc18574da990bbcfbf5ae36..0a8f448995cd651e1a09d87bb218568fece68cc4 100644 (file)
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1347,8 +1347,13 @@ static void do_video_stats(OutputStream *ost, int frame_size)
     enc = ost->enc_ctx;
     if (enc->codec_type == AVMEDIA_TYPE_VIDEO) {
         frame_number = ost->st->nb_frames;
-        fprintf(vstats_file, "frame= %5d q= %2.1f ", frame_number,
-                ost->quality / (float)FF_QP2LAMBDA);
+        if (vstats_version <= 1) {
+            fprintf(vstats_file, "frame= %5d q= %2.1f ", frame_number,
+                    ost->quality / (float)FF_QP2LAMBDA);
+        } else  {
+            fprintf(vstats_file, "out= %2d st= %2d frame= %5d q= %2.1f ", ost->file_index, ost->index, frame_number,
+                    ost->quality / (float)FF_QP2LAMBDA);
+        }
 
         if (ost->error[0]>=0 && (enc->flags & AV_CODEC_FLAG_PSNR))
             fprintf(vstats_file, "PSNR= %6.2f ", psnr(ost->error[0] / (enc->width * enc->height * 255.0 * 255.0)));
index b1a62e8620d90ffa410ff3cb27d9afbb934c0130..6a47d32b531474d355d326167625411f145f4f8f 100644 (file)
@@ -121,7 +121,7 @@ int frame_bits_per_raw_sample = 0;
 float max_error_rate  = 2.0/3;
 int filter_nbthreads = 0;
 int filter_complex_nbthreads = 0;
-int vstats_version = 1;
+int vstats_version = 2;
 
 
 static int intra_only         = 0;