From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id CE5D846555 for ; Thu, 20 Jul 2023 19:25:08 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9231C68C557; Thu, 20 Jul 2023 22:25:05 +0300 (EEST) Received: from mail-oo1-f44.google.com (mail-oo1-f44.google.com [209.85.161.44]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 94F2968C4F8 for ; Thu, 20 Jul 2023 22:24:58 +0300 (EEST) Received: by mail-oo1-f44.google.com with SMTP id 006d021491bc7-5661e8f4c45so809463eaf.1 for ; Thu, 20 Jul 2023 12:24:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689881097; x=1690485897; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=VgWn0oS41UMdqPww/Ex9J90kp3PhKgm3kgeJGhKccP4=; b=I9wT4OrvB/e95s6YI7O3+g7RYiTZYm0nS8nP4zA16W20jzrEzhBjq8AiCufquxbIhO DwlufLLQFJpms1pfJPmGHx5W3eyt0EUyEh8p3De3AzloUQwtA5iAxnptZB4QDrNZ8Tjx uMFuSlxFpBCz9vf1QEGOkxI+59uQBTSCeX/88j5zsnK495I7175aLz1472iX7cxYAz2Z f01EHGA8FtD10ZNFrpxHR5I5iMvRtyaSaZdOV1qbSLQ3p3DdAXW70ZCW4TmtY/EoYPTh M+VoFv1VoVkx4ctnqoTkYJbon4Aswa7WYRv7zmUKZ2iE5hnTCk6JEdBHNmN18BpKVjte sfFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689881097; x=1690485897; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=VgWn0oS41UMdqPww/Ex9J90kp3PhKgm3kgeJGhKccP4=; b=ThxnsrcUfIH5yDgaph5mpiL//nSGNVIthmeyshxhrzWZRGso75UDmgI9kHks+m1EEQ WS4QaVDaVb5dq2o92keQBqGSqJFxLxDWKzYjXhzudY+2J/FVzKeWeYGJiyVKPRKB+iOk XefL1TUI+JlWy95MpTWd1O9lkWYRWjRjqjShCAcNgnknB40w9drEbLvsvE7r05U8KLqd +sh1sv6et3oZBli1b6DlLHMzeF6XAB0sR6PD72sKGuiT8l7ks6xW+0EznV6X7nNBHOGm +CVPf7IfH15Z6yNFpD9CeVnR0td+a3dQ8+L3MNqboMEEt1CQOWeEpavYkCTn/1uswLH7 ejrw== X-Gm-Message-State: ABy/qLYJM+lOxltBxT1DG5Y977Ap1yeyaSBispMWqZHO5tR/BwowHKFM DwTGTM/GMxvNM6ovJwqmozCOgPSW5M8= X-Google-Smtp-Source: APBJJlGonEHnlkeQ5uv+VgtZ7oaYKit2y9Zp/KeyPrrfeT3mdNpKkJ1lWIBSiS4/14nRll5hWA7/FA== X-Received: by 2002:a4a:364a:0:b0:567:8610:2897 with SMTP id p10-20020a4a364a000000b0056786102897mr119030ooe.9.1689881096577; Thu, 20 Jul 2023 12:24:56 -0700 (PDT) Received: from [192.168.0.16] (host197.190-225-105.telecom.net.ar. [190.225.105.197]) by smtp.gmail.com with ESMTPSA id u2-20020a4a9702000000b00566270e616dsm753572ooi.38.2023.07.20.12.24.55 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 20 Jul 2023 12:24:56 -0700 (PDT) Message-ID: <9b585e44-0f10-9d38-2a84-ca6f2173ad89@gmail.com> Date: Thu, 20 Jul 2023 16:25:02 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Content-Language: en-US To: ffmpeg-devel@ffmpeg.org References: <20230719222043.59743-1-jamrial@gmail.com> <20230719222043.59743-5-jamrial@gmail.com> <168988010396.27367.2360099703316632165@lain.khirnov.net> From: James Almer In-Reply-To: <168988010396.27367.2360099703316632165@lain.khirnov.net> Subject: Re: [FFmpeg-devel] [PATCH 5/5] fftools/ffmpeg: support applying container level cropping 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 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 7/20/2023 4:08 PM, Anton Khirnov wrote: > Quoting James Almer (2023-07-20 00:20:43) >> diff --git a/fftools/ffmpeg_enc.c b/fftools/ffmpeg_enc.c >> index 8b750de4e5..3cf29c8b2c 100644 >> --- a/fftools/ffmpeg_enc.c >> +++ b/fftools/ffmpeg_enc.c >> @@ -441,14 +441,16 @@ int enc_open(OutputStream *ost, AVFrame *frame) >> int i; >> for (i = 0; i < ist->st->nb_side_data; i++) { >> AVPacketSideData *sd = &ist->st->side_data[i]; >> - if (sd->type != AV_PKT_DATA_CPB_PROPERTIES) { >> + if (sd->type == AV_PKT_DATA_CPB_PROPERTIES) >> + continue; >> + if (ist->apply_cropping && sd->type == AV_PKT_DATA_FRAME_CROPPING) >> + continue; > > I'm very much not a fan of the encoder doing anything based on decoder > options. Right now, all input stream side data (save for CPB) is copied to the output stream. Without this chunk, the frame cropping side data will be copied regardless of it having been applied or not at the decoding level. I don't know how else to prevent that. Maybe removing the side data from the input stream? Although that's pretty ugly. I have a separate patchset adding packet side data to codecpar and avctx, and deprecating AVStream.side_data in favor of it. With that, i could maybe use and therefore remove the cropping side data from ist->par (which is internal to the CLI) if applied. > > I know the code below already does the same thing, but I'd like to get > rid of it rather than add to it. > _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".