From patchwork Tue Dec 5 14:16:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gyan X-Patchwork-Id: 6557 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.161.94 with SMTP id m30csp5712921jah; Tue, 5 Dec 2017 06:16:25 -0800 (PST) X-Google-Smtp-Source: AGs4zMaXcACk/ww5fYluxjmCzGCOtPlarutA+BDEzlMI1qio5B59hZ2jICSPIjnbJEUY9g+xggi3 X-Received: by 10.223.182.73 with SMTP id i9mr10072915wre.113.1512483385033; Tue, 05 Dec 2017 06:16:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512483384; cv=none; d=google.com; s=arc-20160816; b=HIcEp/wDK3ZXZKQvCnV5aycQ7qU9tb3kDy4drDS6QuJFh1gIZ5EpOIIGPhvQGWyEtL x6W0bqNDPOAkGOXkqud88JRv7nADk7EtoM1jXYpIFDItNOOVfAYqtDr+2rp9K2bsigCR VIas+RxAf0u9dWkCmLYHXpuRCA0g8M4fOWwGqh33SKzL+3n5dtYujCKdsimV0BZEEA37 6Gj8AJhMY5q6jomte8EUlTWbYgncS5eO3vV1vaYKzm+JpNjjd17+EXu+HRNGbu2sLGIR Ug5F8QuV+sUHFiLuAy7DHq74E6k35CqVtxiMWPs79glLXy/Q1GOLPuny9J/xFyiaHTfz MTlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:dkim-signature:delivered-to :arc-authentication-results; bh=5KagpJ+o6h4/YM5YZwSh54AKrQtPXDNUgPjXBoQZm6E=; b=MsuhfZ2SvLt/bQwxvSLOvGQHHr+V/ILalvWrcEtT/hvr14RV4ITPSAniO3Z2fewQhn u8cuAG+VDUpXCFFWwHifOLFOKjv811GIwdxPNJuZC/3uG2wzXRv2G0S1kbw4ckQxFcNd P8rghmKxbMyULnIGnvk/tYO13LlGiuPOxX+zOigSJvE+fPAlNHw6mIqKNDnRqN2h33aI Mu0pTvgBhdoGMUiy+wD9n2xkaVHiJH74mS7qyPfT3Yez3CHzwcolcViDYxoR+IpBNCkh zzcfaIh4DO+0290+LtKB0JGU2kYtRYYz6/dCrGXO+yPAmw9tgeOIcn6kqVQrhDCC7FnJ fYtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=DloV7nbz; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id g62si314920wmg.258.2017.12.05.06.16.24; Tue, 05 Dec 2017 06:16:24 -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=@gmail.com header.s=20161025 header.b=DloV7nbz; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 484CA68A1DB; Tue, 5 Dec 2017 16:16:18 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pf0-f173.google.com (mail-pf0-f173.google.com [209.85.192.173]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B8A7468A118 for ; Tue, 5 Dec 2017 16:16:11 +0200 (EET) Received: by mail-pf0-f173.google.com with SMTP id d23so239644pfe.9 for ; Tue, 05 Dec 2017 06:16:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language; bh=pNJKh5dtVv6cCyxvactseSzq570a87NmMmJ43EyZrxM=; b=DloV7nbzCoq7Wo5zbmy26RnlMveWHChMinIw14BQS7AzNLlRWx6QPZhGEIkHnqpa1i mHw/4mbarlAWAzq9bICht7X/vgfV0B0X4XYxqkrI5VVbYmGpTwCTMwJUSbviwkx97g7r Si/7A8EPx5xym/lAfXgQ8E5Ud4rjG7j4cy8hulbgrEiZJGCRag90z4hsI54+mzXHghAF 8Ynxcl4HUThLHSP8zs/PYApaIN7htL7w0fPEtJNQ74e+V1bcaqZTYZ2DkAHboNKdmcmG fVcMbgI1SR81g00gVlqGo03zdiJkqpjhpG6T1r4Ukiik5wGcqphF0IvKZ+5dsIhIyFEA QdKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=pNJKh5dtVv6cCyxvactseSzq570a87NmMmJ43EyZrxM=; b=WnMF/tyi5Ti0o0qTVE4efrB3CqytCYE94fvbCHrxWqqbK/K9RHnjH7yoclBDrdJvha hG1311eJoMZx8kp9UwM5VUu42z3V7KkrraCYJfLN0AAcx7c51OtERE/fQNmqtvVQctUj PRhL/HE8rzoAPiEjemq5gt01tYqbSTS4BjjDqlkrgJomyK3O+B4upfn8nWwkzvDgn/nR Wq1d/ndHLeManoWgo2vmLCMzBRbmgwetlpJI3iVjwT275osc3h9wJOq8Lb46XHB7OM39 cV7U9dFOHIgILwQyBffwYmIVh8u8xIBq6fIqGOiM8EpVFh+sl9XQKZwuB0SWZewM39EV Tj9Q== X-Gm-Message-State: AJaThX7Apc+mAU5vhk83gBzKjJcN8E0bZ4BQboJEeJqAhXYCUK8iPjNp xD3G/admzt9dycWrOhyDUJimBWBc X-Received: by 10.98.103.93 with SMTP id b90mr23656978pfc.134.1512483374589; Tue, 05 Dec 2017 06:16:14 -0800 (PST) Received: from [192.168.1.105] ([103.206.133.250]) by smtp.gmail.com with ESMTPSA id h69sm456228pfk.166.2017.12.05.06.16.12 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Dec 2017 06:16:13 -0800 (PST) To: ffmpeg-devel@ffmpeg.org References: <398ccb48-4ded-9bfb-7508-2a305654ad80@gmail.com> <16c0476c-2741-e059-3874-4f32f20997b5@gmail.com> <4e0efb5e-4cfd-c759-4360-11e310ed928e@gmail.com> <26db60f0-441b-5dfc-90e7-bcccfa5ccadf@gmail.com> From: Gyan Doshi Message-ID: Date: Tue, 5 Dec 2017 19:46:09 +0530 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <26db60f0-441b-5dfc-90e7-bcccfa5ccadf@gmail.com> Content-Language: en-US Subject: Re: [FFmpeg-devel] [PATCH] avcodec/libx265.c - Add named option to set profile 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" On 12/5/2017 7:37 PM, Derek Buitenhuis wrote: > Patch OK with log line dropped. Revised patch v2 attached. Thanks, Gyan From 13ad80871978fe7e5837863e0e2f7b7d6b356155 Mon Sep 17 00:00:00 2001 From: Gyan Doshi Date: Tue, 5 Dec 2017 13:17:53 +0530 Subject: [PATCH] avcodec/libx265 - Add named option to set profile Adds call to x265_param_apply_profile after x265_param_parse. Added as private option since HEVC profiles other than Main, Main 10 and MSP in AVCodecContext are consolidated in a single constant. --- libavcodec/libx265.c | 9 +++++++++ libavcodec/version.h | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/libavcodec/libx265.c b/libavcodec/libx265.c index 4456e300f2..4058deac1c 100644 --- a/libavcodec/libx265.c +++ b/libavcodec/libx265.c @@ -45,6 +45,7 @@ typedef struct libx265Context { int forced_idr; char *preset; char *tune; + char *profile; char *x265_opts; } libx265Context; @@ -220,6 +221,13 @@ static av_cold int libx265_encode_init(AVCodecContext *avctx) } } + if (ctx->profile) { + if (ctx->api->param_apply_profile(ctx->params, ctx->profile) < 0) { + av_log(avctx, AV_LOG_ERROR, "Invalid or incompatible profile set : %s.\n", ctx->profile); + return AVERROR(EINVAL); + } + } + ctx->encoder = ctx->api->encoder_open(ctx->params); if (!ctx->encoder) { av_log(avctx, AV_LOG_ERROR, "Cannot open libx265 encoder.\n"); @@ -392,6 +400,7 @@ static const AVOption options[] = { { "forced-idr", "if forcing keyframes, force them as IDR frames", OFFSET(forced_idr),AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE }, { "preset", "set the x265 preset", OFFSET(preset), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VE }, { "tune", "set the x265 tune parameter", OFFSET(tune), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VE }, + { "profile", "set the x265 profile", OFFSET(profile), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VE }, { "x265-params", "set the x265 configuration using a :-separated list of key=value parameters", OFFSET(x265_opts), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VE }, { NULL } }; diff --git a/libavcodec/version.h b/libavcodec/version.h index d67b689142..3b5c3000be 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -29,7 +29,7 @@ #define LIBAVCODEC_VERSION_MAJOR 58 #define LIBAVCODEC_VERSION_MINOR 6 -#define LIBAVCODEC_VERSION_MICRO 102 +#define LIBAVCODEC_VERSION_MICRO 103 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ LIBAVCODEC_VERSION_MINOR, \