From patchwork Thu Jan 26 00:41:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasi Inguva X-Patchwork-Id: 2318 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.89.21 with SMTP id n21csp2471064vsb; Wed, 25 Jan 2017 17:12:17 -0800 (PST) X-Received: by 10.28.153.139 with SMTP id b133mr395280wme.93.1485393137405; Wed, 25 Jan 2017 17:12:17 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 53si28985623wrb.335.2017.01.25.17.12.17; Wed, 25 Jan 2017 17:12:17 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5BF7668A69F; Thu, 26 Jan 2017 03:12:14 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pg0-f50.google.com (mail-pg0-f50.google.com [74.125.83.50]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3B86468A649 for ; Thu, 26 Jan 2017 03:12:07 +0200 (EET) Received: by mail-pg0-f50.google.com with SMTP id 194so68710327pgd.2 for ; Wed, 25 Jan 2017 17:12:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=NRBKaYjMVbnQ8U7AozpdJGNr7fIpzwlZVs4mtJ1WACY=; b=EOQ3RB4AL/qr+5nXfD4YRlmRnaPatHMR732PQo8qH61cX2abYKEivOxlpjwXTFf3LP bafxu9J3MqlzOCz4nuKFmPWNUf0zWl6Z6hFwDXWiv2aRcMxjzMz/a6n6MRDUyW0wC6al 2E2OoP8zht4ZbbBTmc/eQ17hPDox8+Qgiefnjj8urxyCeFWs6jpzERBI8DjJFu06luy7 3HPVMXviVF7sq56y+2rfE8SKB6QJiyNxMTnINt511FeSEgZU0gNxzm4pdDFOuQPu+KjJ 1GVvNpP+n1z2NRAAkW5o5yASjPzt/yiRa5V/F1pfh+Zvy3Hk7nMm2iDzkfodUY90zIoU B0sQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=NRBKaYjMVbnQ8U7AozpdJGNr7fIpzwlZVs4mtJ1WACY=; b=qoc64hwRYiMQHps23sEYSRYmyp/alSUKSG5qG6NC7DNIfPlsJ6AqEVV8UIoRHc4VFQ guYfxnkcqrthpLcy0u2viPd8rFrVdbJfT4vamwakQNp/nE7CNBvp7fGxZqHzvNNPWyLL CZBwzrAgZ45YM3Tvxidm5Zr76NtRMAdIEPzskF+kya4aRs1GRaJXttnGzMN67DIME3Bs gAiWeQbkszMpoN6jMJw0zd63f5j3DtEyKoB1vTBuwW1ZqS1YBYcs2qyXp2GZ8akUcpTr w3g0EaDfasSuKS+t8seKoo1ueid1p9L9NMNAOG6v3/K6+6PVUeQ4I4DCwNY2uyHQwv2/ Ix2A== X-Gm-Message-State: AIkVDXIntq/F/+/1PG5Frjn4awHY0o09x4YFId9AxL6CYC/itv8ni1woIe9IOwx3c5Vxg1Ui X-Received: by 10.99.228.69 with SMTP id i5mr71415pgk.63.1485391346573; Wed, 25 Jan 2017 16:42:26 -0800 (PST) Received: from isasi.mtv.corp.google.com ([172.27.82.89]) by smtp.gmail.com with ESMTPSA id g64sm3671484pfc.57.2017.01.25.16.42.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 25 Jan 2017 16:42:25 -0800 (PST) From: Sasi Inguva To: ffmpeg-devel@ffmpeg.org Date: Wed, 25 Jan 2017 16:41:44 -0800 Message-Id: <20170126004144.12803-1-isasi@google.com> X-Mailer: git-send-email 2.11.0.483.g087da7b7c-goog In-Reply-To: <20170121115230.GS4698@nb4> References: <20170121115230.GS4698@nb4> Subject: [FFmpeg-devel] [PATCH] ffmpeg.c: Add output file index and stream index to vstats file. X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Sasi Inguva MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Sasi Inguva --- doc/ffmpeg.texi | 8 +++++++- ffmpeg.c | 9 +++++++-- ffmpeg_opt.c | 2 +- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/doc/ffmpeg.texi b/doc/ffmpeg.texi index cdea1a271f..996d6a6cc4 100644 --- a/doc/ffmpeg.texi +++ b/doc/ffmpeg.texi @@ -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} diff --git a/ffmpeg.c b/ffmpeg.c index 977708c069..0a8f448995 100644 --- 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))); diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c index b1a62e8620..6a47d32b53 100644 --- a/ffmpeg_opt.c +++ b/ffmpeg_opt.c @@ -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;