From patchwork Tue Jan 24 16:23:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasi Inguva X-Patchwork-Id: 2301 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.89.21 with SMTP id n21csp1800815vsb; Tue, 24 Jan 2017 08:25:22 -0800 (PST) X-Received: by 10.223.153.144 with SMTP id y16mr28788831wrb.81.1485275122006; Tue, 24 Jan 2017 08:25:22 -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 30si23391319wrb.107.2017.01.24.08.25.21; Tue, 24 Jan 2017 08:25:21 -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 D215768A31D; Tue, 24 Jan 2017 18:25:16 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pf0-f176.google.com (mail-pf0-f176.google.com [209.85.192.176]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D515B68A117 for ; Tue, 24 Jan 2017 18:25:10 +0200 (EET) Received: by mail-pf0-f176.google.com with SMTP id 189so51250665pfu.3 for ; Tue, 24 Jan 2017 08:25:11 -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=yKHZk5JCTlZaq7Do8fV/Zhld1YO07vfjLKqDhcZYf7E=; b=F0rz7f0kV6HgJmDIGTi6Y2uG6E/BKX7NWrBKDqCwN+/xOI7sqcpIvepG4SFYUSOABG mnjUdbaKJI+VBS5elXSHEsc69LtRzSp2cD1gXtHMeBgKZfVDItyYF0uFhiuUycujfYdv mu9K++vR7niomITkodRwIXmD1eDyY4nqym4fY7NYqnaAv3sC6sLVXiIiR12+g+zNRBSc M1k5yXRbJsz7T9GcwjfUGYPIQTpXwZhl8SndwviFShxi1/Z5TbFnO3cIT3lWAIyP/by9 P+VgzRGeLsTbS3EUIuvyrCoq2i0oezAPSvaYpcfVb6hEKsNzhhHENhPW8UPuKaslYoOJ g6oQ== 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=yKHZk5JCTlZaq7Do8fV/Zhld1YO07vfjLKqDhcZYf7E=; b=RbzWgd2MHut1SqEHtpt/UI8hKBNXnIt9QCXwB5FRjVGtwFuHjh9m7x1AgGmF4hoGCS EU+OPvjFIUKUxgHhgmq4YTmyd4dSw2W0qVF9ZiH2c+gn4yN3q1w83FzbjdF8YNOTVrhE SxOZjByewaswBxXMbV57BzslVbcx4HkuY8s7+F+YlFzhq8szhXFP3S7iflpxmZH1g2Ku Xr3uQ+xXozzFv+/NHTE5dPIhaFSiIWIR7wDqRiTqgnnYw/rshNZux6+Ba1AOF0xufkm2 fOyO/vwBGJs43oCLIHGZVZl3RWdiyFnnvJ61aey8moIbqTRKn9ueu/RwAjslirAa9D+d 8VSA== X-Gm-Message-State: AIkVDXKy4rq6hX8Wr5WRj03rYoFceKZxM1xB47XuTRenyG4ust1GZQjDGk3qIckbAlnfCtcT X-Received: by 10.98.20.81 with SMTP id 78mr39847887pfu.171.1485275109303; Tue, 24 Jan 2017 08:25:09 -0800 (PST) Received: from isasi.mtv.corp.google.com ([172.27.82.89]) by smtp.gmail.com with ESMTPSA id z29sm6927386pgc.7.2017.01.24.08.25.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 24 Jan 2017 08:25:07 -0800 (PST) From: Sasi Inguva To: ffmpeg-devel@ffmpeg.org Date: Tue, 24 Jan 2017 08:23:54 -0800 Message-Id: <20170124162354.27508-1-isasi@google.com> X-Mailer: git-send-email 2.11.0.483.g087da7b7c-goog In-Reply-To: References: Subject: [FFmpeg-devel] [PATCH] ffmpeg_opt.c: Introduce a -vstats_version option and document the existing -vstats format. 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 | 4 ++++ ffmpeg.h | 1 + ffmpeg_opt.c | 3 +++ 3 files changed, 8 insertions(+) diff --git a/doc/ffmpeg.texi b/doc/ffmpeg.texi index b56bdbe261..cdea1a271f 100644 --- a/doc/ffmpeg.texi +++ b/doc/ffmpeg.texi @@ -636,6 +636,10 @@ Calculate PSNR of compressed frames. 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 + +@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} @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.h b/ffmpeg.h index 75bf50ec29..458bb8a3dc 100644 --- a/ffmpeg.h +++ b/ffmpeg.h @@ -597,6 +597,7 @@ extern char *videotoolbox_pixfmt; extern int filter_nbthreads; extern int filter_complex_nbthreads; +extern int vstats_version; extern const AVIOInterruptCB int_cb; diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c index a1c02fc29b..b1a62e8620 100644 --- a/ffmpeg_opt.c +++ b/ffmpeg_opt.c @@ -121,6 +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; static int intra_only = 0; @@ -3547,6 +3548,8 @@ const OptionDef options[] = { "dump video coding statistics to file" }, { "vstats_file", OPT_VIDEO | HAS_ARG | OPT_EXPERT , { .func_arg = opt_vstats_file }, "dump video coding statistics to file", "file" }, + { "vstats_version", OPT_VIDEO | OPT_INT | HAS_ARG | OPT_EXPERT , { &vstats_version }, + "Version of the vstats format to use."}, { "vf", OPT_VIDEO | HAS_ARG | OPT_PERFILE | OPT_OUTPUT, { .func_arg = opt_video_filters }, "set video filters", "filter_graph" }, { "intra_matrix", OPT_VIDEO | HAS_ARG | OPT_EXPERT | OPT_STRING | OPT_SPEC |