From patchwork Sun Mar 17 20:00:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Jan_Ekstr=C3=B6m?= X-Patchwork-Id: 47140 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:958e:b0:1a3:31a3:7958 with SMTP id iu14csp656797pzb; Sun, 17 Mar 2024 13:02:55 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUO41q9d5BUuUY83RlC4bqZTBxcx/eOtm6WSnRZdyIIVaSpOGsoN/LkwXrLOLoKEH93bUQj4B7OYFhxa7G983j2tdkBgY4i2uN6Sw== X-Google-Smtp-Source: AGHT+IEapIMZiL5rVo9m1b7NgYmezZ1hdHlDuJ28NLhe2uWty5HN+i00ds6Eq1bS4FW7ATg8YdFS X-Received: by 2002:a17:906:e99:b0:a46:4851:b8cb with SMTP id p25-20020a1709060e9900b00a464851b8cbmr6388506ejf.15.1710705775449; Sun, 17 Mar 2024 13:02:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710705775; cv=none; d=google.com; s=arc-20160816; b=L64YLVXMwTFVIK4fdGZDgz0G6FaGGNBnMBhQckHkWU/0kjAgUriFb/+eAJAT0w+wEe 2HChwe0JNWHZEMqdhj4vRFBVhx17u6zzl4GbcIVpKJ8rXhBQnHILxvQZZDIeI81nl46z G8KNYz8EmxINCBctf9r12nRa1hzr4RS8F+rVYGD2IXcT7DZfzGbsD97oAoM5ylfFTLyL GKI5nmo4CVGfPBjZFKt18oVxfYIGWuFUfw1DBVyMopsd73ANoDCeZwbWynRUxZ9YT0zD bjFmSUBcR7KjMs08OMIHpKyJWozCN1YPzZkClesq1Z+nVJhlRn9TgJFIHQFU0ugPLLrR bUoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=g7Qkfwz2v92wPxbacC7asiWZpFunp1Mh6G8+rgLi3SI=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=We1gMA7zkquR1bOncR7nUktJaQKjZO5FyAqToiBDSSrxdLUA21TqSMUJDAv/MnxnXN dnBWrwIU33D/yR4vv+XXFboE153n0HeCQ098csJ93+aJJS3yhYLlxu/4s9mLtMB6F2/G /WRcJdVZ7Z2LaQ7p+1qDhQIbJ2L2jrPkEHiUCjb1sMCnypwNL2yRAdqm6/UDT+2vTFFi HfefNjYDyw6FX8mnWbTrtTHEDMJfTcQ2xs4JW5A7CVYZrIl7VAu4HX8KUfjBatYrzqyT mEhz+i/KTyEV6EkjOfntFmTH1ocfAqA4qFbXlAY8assBtUh5u9tt74Bl+T2KOC+0p4oq d2Rw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=ZLGFhg5I; 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=QUARANTINE 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 gg15-20020a170906e28f00b00a44d19c4051si3716957ejb.409.2024.03.17.13.02.55; Sun, 17 Mar 2024 13:02:55 -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; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=ZLGFhg5I; 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=QUARANTINE 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 AED3068D1C4; Sun, 17 Mar 2024 22:01:28 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.44]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 60DDB68D1E6 for ; Sun, 17 Mar 2024 22:01:14 +0200 (EET) Received: by mail-lf1-f44.google.com with SMTP id 2adb3069b0e04-513dc9d6938so2427546e87.2 for ; Sun, 17 Mar 2024 13:01:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710705673; x=1711310473; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=8B2WvqEqqxrUF9sBB7PKETgQ5sM02zIaUAWvQoWq3BU=; b=ZLGFhg5IqyhDUdtaKZHnSQQLWqvfSflqVo3omrxce94kDvU+7pghUIh5HE/wdZCspw SA6/AtIp6wK42lQpj8G3YOmA3qHwmMr2/L+R1LoFQmTaaMfLwFznKisltiY9HQnVvUYg HCydcbxCQm9d/kvLilOklOP+4wbWnC+McNj9nI8omB+GupfvdTOLt/9s7Vfu6VvM6so1 ML6Q64ah7YoD5qAAzOSjfTnl4j8J1uOFymjfvhmSQ9wuknUwFCYFJda6joAsvamyhfUQ SRx3/Oqs1i1lUN59pWwXGWEaKYeraR2iomdoLn598YRNgJ4JUUW9Scjn/blXRRgafdrF ZDRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710705673; x=1711310473; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8B2WvqEqqxrUF9sBB7PKETgQ5sM02zIaUAWvQoWq3BU=; b=MK72huENfgNgmVqzvkbSsVp2Pvj+iq6a8s0954Laq+rkXAN3lzmhGtmZNBMoiC9rcd 5hvbfdnVj1S5HOtN5TwtFlSLnUjzl3H8ryN1JVtbHYeDaxlzdzdGWaLqcxH50ItUCBBg pCfdK/8ddxmXnKSolgUC2Xe0RPfv4WZ34r0sdxo10JFikh4bRntsvzE6I5QA+k3Zhj3K JgYDJvC3SJF1SLAmU+1u31BJi9nqy/iEavJgj8K8kRwnoDrG16Vi6nXsiAxqFdB9q4tV YgHIJ+JOpY9KST6UpfDSTGqgnudNu+cf3mMw+8PrjKyUOb5SjluzT6iEpObFKa+q0ACm Ko0g== X-Gm-Message-State: AOJu0YwjqQgBCKkpTyBDBNUot7vz+5gteKPhAkmyysSBryal7jaM4LAi BdNx7khFTNZFVBUf8fh6oV/ia279OGmCuQwdhaGA8jrlhP9YLPtyZNQl6kP/ X-Received: by 2002:ac2:598c:0:b0:513:a732:4878 with SMTP id w12-20020ac2598c000000b00513a7324878mr6809868lfn.41.1710705673524; Sun, 17 Mar 2024 13:01:13 -0700 (PDT) Received: from localhost.localdomain (91-153-198-187.elisa-laajakaista.fi. [91.153.198.187]) by smtp.gmail.com with ESMTPSA id y3-20020a056512044300b00513c844603fsm1340462lfk.41.2024.03.17.13.01.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Mar 2024 13:01:13 -0700 (PDT) From: =?utf-8?q?Jan_Ekstr=C3=B6m?= To: ffmpeg-devel@ffmpeg.org Date: Sun, 17 Mar 2024 22:00:48 +0200 Message-ID: <20240317200100.152097-12-jeebjp@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240317200100.152097-1-jeebjp@gmail.com> References: <20240317200100.152097-1-jeebjp@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v9 11/14] ffmpeg: pass first video AVFrame's side data to encoder X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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" X-TUID: vndMYmSWZjzk This enables further configuration of output based on the results of input decoding and filtering in a similar manner as the color information. --- fftools/ffmpeg_enc.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/fftools/ffmpeg_enc.c b/fftools/ffmpeg_enc.c index c9a12af139..c8d15fb999 100644 --- a/fftools/ffmpeg_enc.c +++ b/fftools/ffmpeg_enc.c @@ -246,6 +246,16 @@ int enc_open(void *opaque, const AVFrame *frame) enc_ctx->colorspace = frame->colorspace; enc_ctx->chroma_sample_location = frame->chroma_location; + ret = avcodec_configure_side_data( + enc_ctx, + (const AVFrameSideData **)frame->side_data, frame->nb_side_data, + AV_FRAME_SIDE_DATA_FLAG_UNIQUE); + if (ret < 0) { + av_log(NULL, AV_LOG_ERROR, "failed to configure video encoder: %s!\n", + av_err2str(ret)); + return ret; + } + if (enc_ctx->flags & (AV_CODEC_FLAG_INTERLACED_DCT | AV_CODEC_FLAG_INTERLACED_ME) || (frame->flags & AV_FRAME_FLAG_INTERLACED) #if FFMPEG_OPT_TOP