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 0764044110 for ; Mon, 29 Aug 2022 00:03:09 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1458B68B99D; Mon, 29 Aug 2022 03:03:01 +0300 (EEST) Received: from mail-vs1-f49.google.com (mail-vs1-f49.google.com [209.85.217.49]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2F66768B991 for ; Mon, 29 Aug 2022 03:02:53 +0300 (EEST) Received: by mail-vs1-f49.google.com with SMTP id i12so47811vsr.10 for ; Sun, 28 Aug 2022 17:02:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=lfgQi2Q3ObjTXVXyiT0Lv05D+I7ABe8JW12ewRgMWEE=; b=NA8uG1vwG2IJiWGt46bcFiAGHzHO9drC5x7j7CGl5Gf6DZZp8z0m0XudZmnvWA8/tK bOe3FSr7oVbkNmpktHttH3z6dk2GspBNTwjSru9JoEn/GS1jvbrk+L645xpC973q6OAu qcy9ynH5DSc3g9XbnSUaJSaXXuvORue4Qtz8W1H6DP+40PdTGsOMX+sBbhwlMvBdUxJp EenwulijFaH4fDjBx00bbXHI3BkvVr12mlw7+rILk2LsVk5xcHeSXzqD2RLEaQemOMQA 6JTCMfWFgZMwFORHrqRYkuMsKhT9K2tRkB55D51B2iX5/uffsBDb47hYwJBrP8FNO0vm nWVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=lfgQi2Q3ObjTXVXyiT0Lv05D+I7ABe8JW12ewRgMWEE=; b=8FloWMtN6NQwikoKOD4CSK6Tyh6X0TZDlT2syvJyXGJXoyEoyTDRi0wKpWGekUsZn2 xbLSWl0fwROKWSo8QIgc8xZ/WEybNNB1esTPrfwavhnGARL05fkRNIdme7Aamcs/goDV o8OfyeGaZsVKSoP10UBMA6ZK1Pc4CubP0bRAsREW+7cyShbNEvxgW+kPgPC10k4NpYlX A3vuNelV0SGWYV9gQ/IOfFSDI82he+3JfZ59zV/8r0Rn+QxkZxrgGG8HdlK8wxbc5CQp BtGaWtcv4DHFCdcSj2OPsJnX+Psd7/9AA4F4O4NaSixDfmazi9MEgqPu2qxVR0WWPCQ8 JMlg== X-Gm-Message-State: ACgBeo3IIONQR9gTHPR/u67tpjtbSC/uWoRRjHtedhHXKU01WBHTLiBJ FfYSmLoSxO/yPzWEr3m/NYX1z69Fbj83uA== X-Google-Smtp-Source: AA6agR6bguGrAwXPFwG3UbDFDpTPHb6gNWa0WVLYggaZoA2lmTQEbqCE0ux2b1Cp45YWd9SfXFQUkQ== X-Received: by 2002:a67:b706:0:b0:38a:ca3f:c609 with SMTP id h6-20020a67b706000000b0038aca3fc609mr2397642vsf.56.1661731371502; Sun, 28 Aug 2022 17:02:51 -0700 (PDT) Received: from cappuccino.. (075-115-109-114.inf.spectrum.com. [75.115.109.114]) by smtp.gmail.com with ESMTPSA id z5-20020ab05645000000b0039f07e29623sm1382804uaa.4.2022.08.28.17.02.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Aug 2022 17:02:51 -0700 (PDT) From: Stephen Hutchinson To: ffmpeg-devel@ffmpeg.org Date: Sun, 28 Aug 2022 20:02:36 -0400 Message-Id: <20220829000244.71123-2-qyot27@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220829000244.71123-1-qyot27@gmail.com> References: <20220829000244.71123-1-qyot27@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/9] avformat/avisynth: read _SARNum/_SARDen from frame properties 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 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: Initialized to 1:1, but if the script sets these properties, it will be set to those instead (0:0 disables it, apparently). Signed-off-by: Stephen Hutchinson --- libavformat/avisynth.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libavformat/avisynth.c b/libavformat/avisynth.c index 3d9fa2be50..d978e6ec40 100644 --- a/libavformat/avisynth.c +++ b/libavformat/avisynth.c @@ -251,6 +251,8 @@ static int avisynth_create_stream_video(AVFormatContext *s, AVStream *st) AVS_VideoFrame *frame; int error; int planar = 0; // 0: packed, 1: YUV, 2: Y8, 3: Planar RGB, 4: YUVA, 5: Planar RGBA + int sar_num = 1; + int sar_den = 1; st->codecpar->codec_type = AVMEDIA_TYPE_VIDEO; st->codecpar->codec_id = AV_CODEC_ID_RAWVIDEO; @@ -728,6 +730,12 @@ static int avisynth_create_stream_video(AVFormatContext *s, AVStream *st) st->codecpar->chroma_location = AVCHROMA_LOC_UNSPECIFIED; } } + + /* Sample aspect ratio */ + sar_num = avs_library.avs_prop_get_int(avs->env, avsmap, "_SARNum", 0, &error); + sar_den = avs_library.avs_prop_get_int(avs->env, avsmap, "_SARDen", 0, &error); + st->sample_aspect_ratio = (AVRational){ sar_num, sar_den }; + avs_library.avs_release_video_frame(frame); } else { st->codecpar->field_order = AV_FIELD_UNKNOWN; -- 2.34.1 _______________________________________________ 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".