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 B18ED40DD2 for ; Tue, 8 Feb 2022 11:03:09 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0F4A268B294; Tue, 8 Feb 2022 13:03:00 +0200 (EET) Received: from mail-vs1-f51.google.com (mail-vs1-f51.google.com [209.85.217.51]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8836A68B287 for ; Tue, 8 Feb 2022 13:02:53 +0200 (EET) Received: by mail-vs1-f51.google.com with SMTP id t22so2316178vsa.4 for ; Tue, 08 Feb 2022 03:02:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=HboE9CQwsCUNTI3urdF2aJBqNv3ECR4mcEyRXvx8J0g=; b=YMTMS43+S2AV6u6g2Ytkk2BuREGTyW3N1XYIdMYAcR/RlR19naCZxzCJjtxvXuthqA FmAHMbaU/m1ucHqtDL7u38ghOnX2u+4pZPCdDpP6BHY5LT5JikEO79KAC8T3PnRbDxSu 0Fp2olZ95JUpm5AamNxTePPZ4mR47axy2wADlEK36XgYCnQ1UEQVzESTx70vXu0Vz2As 8uJcniUqE7l0mkPV/Vx/MPZwa62lklIQvhRMesCeOWi9Bg/d9/ooTTSIuO41bejoFxc3 n/JBD5UiKr7NclGjAYdUKD0sS92DX5t+MSOFZicoGFoPZmjsuQJnWvlBT26f/uDOnI21 DXoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=HboE9CQwsCUNTI3urdF2aJBqNv3ECR4mcEyRXvx8J0g=; b=TrWxQRY3VnZJcHHg7ByxBM2k6RKtkfMdqtyVcBMAAoh6YT483/xrjiN+/Nbmn4skwT eBiwNScXltcHnhxIiZmm1sCyZgeXzQkLkkSpg20Zm5DoqbBWPWbzar2xE0tusvGubwnw Y1TRxV4I11ARcnGbUOgIydBX7DqHx/cltvdIu/Ay6xqyrtLcjA/2RpiBVDaSf0ztL4Dn Amdzzfjwt2/U0YlWT3Q/16IYCVCGNiEW3lPL8B9pW9KKaTdQ+zZMaqE1YJe/YsY7U4b4 hUltBAZEfv9rV7qejxrtcE3GLxStasWG+aYpoTA/8isa/Kg1+nBoC804/q1tgV1iSCN+ YKXg== X-Gm-Message-State: AOAM532D//BDD7z42s+0tJZT0E0hlR8wLvH1hd/v86ol4/bExT8N0oje S3Ev4MMtCNf+ainF21ayr7h+k4P0dEk= X-Google-Smtp-Source: ABdhPJyZiefOzj4Yl16OCqgUV4RgDZ52j2FmWeOe2WUFiXXOTndanQDayLK/wof9PyB43OhlZH4LjQ== X-Received: by 2002:a67:e08d:: with SMTP id f13mr1263887vsl.78.1644318172284; Tue, 08 Feb 2022 03:02:52 -0800 (PST) Received: from cappuccino.. ([75.115.109.114]) by smtp.gmail.com with ESMTPSA id u9sm121675vsn.1.2022.02.08.03.02.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Feb 2022 03:02:52 -0800 (PST) From: Stephen Hutchinson To: ffmpeg-devel@ffmpeg.org Date: Tue, 8 Feb 2022 06:02:38 -0500 Message-Id: <20220208110240.4179-2-qyot27@gmail.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220208110240.4179-1-qyot27@gmail.com> References: <20220208110240.4179-1-qyot27@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/3] avisynth: corrected interlace detection 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 Cc: Stephen Hutchinson , emcodem Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: From: emcodem AviSynth works on frame-based video by default, which can be either progressive or interlaced. Some filters can break frames into half-height fields, at which point it considers the clip to be field-based (avs_is_field_based can be used to check for this situation). To properly detect the field order of a typical video clip, the frame needs to have been weaved back together already, so avs_is_field_based should actually report 'false' when checked. Signed-off-by: Stephen Hutchinson --- libavformat/avisynth.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/libavformat/avisynth.c b/libavformat/avisynth.c index 350ac6d11d..1e862a6a85 100644 --- a/libavformat/avisynth.c +++ b/libavformat/avisynth.c @@ -250,15 +250,12 @@ static int avisynth_create_stream_video(AVFormatContext *s, AVStream *st) st->nb_frames = avs->vi->num_frames; avpriv_set_pts_info(st, 32, avs->vi->fps_denominator, avs->vi->fps_numerator); - av_log(s, AV_LOG_TRACE, "avs_is_field_based: %d\n", avs_is_field_based(avs->vi)); - av_log(s, AV_LOG_TRACE, "avs_is_parity_known: %d\n", avs_is_parity_known(avs->vi)); - /* The following typically only works when assumetff (-bff) and - * assumefieldbased is used in-script. Additional - * logic using GetParity() could deliver more accurate results - * but also decodes a frame which we want to avoid. */ st->codecpar->field_order = AV_FIELD_UNKNOWN; - if (avs_is_field_based(avs->vi)) { + /* AviSynth works with frame-based video, detecting field order can + * only work when avs_is_field_based returns 'false'. */ + av_log(s, AV_LOG_TRACE, "avs_is_field_based: %d\n", avs_is_field_based(avs->vi)); + if (avs_is_field_based(avs->vi) == 0) { if (avs_is_tff(avs->vi)) { st->codecpar->field_order = AV_FIELD_TT; } -- 2.32.0 _______________________________________________ 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".