From patchwork Wed May 16 07:19:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Xiang, Haihao" X-Patchwork-Id: 8988 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:155:0:0:0:0:0 with SMTP id c82-v6csp2463344jad; Wed, 16 May 2018 00:20:12 -0700 (PDT) X-Google-Smtp-Source: AB8JxZppk0lRuUSuHyDAIjBs2vO/qFGrECrkW+H0aOlOVwrIw9oVNoB2ROj2Rsx4x3V22UvLGhVC X-Received: by 2002:adf:9607:: with SMTP id b7-v6mr12057884wra.129.1526455212447; Wed, 16 May 2018 00:20:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526455212; cv=none; d=google.com; s=arc-20160816; b=K7CfDkDnqxfzJ9XcsS9a17t0XMdZyNkShneABUhVUNGp7Kyy3ltwNicOK2DGA3QXKR 8KUGTVViXo9YFPtXtVXF5U8T4eI68xNf9FE0yDQlv+EVLGZ6UQVYUO2CE5xXi5B9x0Ph 3R1oljlqANvio59vRpgY7QKM1A0X8vKUrDV/GfT7ZZN44tcOx4IynnQJXawEXO2LuaiC a1bHIiLx8K9BxlW0EAIqRjRjkirfYjHEgki+6XQva5REc5lgo0UyaM3WJBCVU9Ju2V++ hqktcBTXVIZAgSBW7Aks2CbdPMOOGyKZJN4OPLbCHTJCR4M0hwglpKdQX1MWVNBzbtXm lY2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:delivered-to:arc-authentication-results; bh=UQy4BQBZ4kc8Zzq9Aq4ZwxOU7ZBTBSTEh45OxQ9Syzk=; b=E5Voq4Uc7TFNAogZBSS9TwmQ2kxUxHClFLouPinCe6ZpAOre7FjuK/LUkDDU6xMc/a s2nQqjEvKnlMmulGVXVqws7hKshnhW/eP4nLM+YOK25HbWSMEC//0JLZD/X67cJ6vfux yz9MtTKBT+gRo69iUMcM0hAmh916Sjg+ubs1MhKYLWJdbNVrDpF2gcdABx+AU8QV0Aow eDaE/csqcMVTCy5o9qo2EYQcI6jG1H70ypTPprYXbmM/YVMatkU/iSWKHzCmvclDUaGS AqNPIdwEUKBYuJdOEhyxHbmfcNN4F1eXgZwb0KU3bs1P9FAmlujOIvw8dm+49jfZ9h6j c/iA== ARC-Authentication-Results: i=1; mx.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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 91-v6si1730169wre.46.2018.05.16.00.20.12; Wed, 16 May 2018 00:20:12 -0700 (PDT) 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; 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=intel.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1C328689818; Wed, 16 May 2018 10:19:26 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E3FEF689C58 for ; Wed, 16 May 2018 10:19:18 +0300 (EEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 May 2018 00:19:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,404,1520924400"; d="scan'208";a="41646613" Received: from xhh-cfl64.sh.intel.com ([10.239.13.24]) by orsmga008.jf.intel.com with ESMTP; 16 May 2018 00:19:49 -0700 From: Haihao Xiang To: ffmpeg-devel@ffmpeg.org Date: Wed, 16 May 2018 15:19:45 +0800 Message-Id: <20180516071945.28983-2-haihao.xiang@intel.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180516071945.28983-1-haihao.xiang@intel.com> References: <20180516071945.28983-1-haihao.xiang@intel.com> Subject: [FFmpeg-devel] [PATCH 2/2] ffmpeg: Use the colour properties from the input stream when doing transcode 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: Haihao Xiang , Mark Thompson MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" In lavc/hevec_vaapi, colour properties in AVCodecContext are needed to write the sequence header Tested by the command below: ffmpeg -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi -i input-with-hdr.mkv -c:v hevc_vaapi -profile:v main10 output.h265 Signed-off-by: Haihao Xiang --- fftools/ffmpeg.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index 5a19a09d9a..80b5441f8f 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -3298,6 +3298,10 @@ static int init_output_stream_encode(OutputStream *ost) dec_ctx = ist->dec_ctx; enc_ctx->chroma_sample_location = dec_ctx->chroma_sample_location; + enc_ctx->color_range = dec_ctx->color_range; + enc_ctx->color_primaries = dec_ctx->color_primaries; + enc_ctx->color_trc = dec_ctx->color_trc; + enc_ctx->colorspace = dec_ctx->colorspace; } else { for (j = 0; j < oc->nb_streams; j++) { AVStream *st = oc->streams[j];