From patchwork Fri Jul 8 22:54:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Timo Rothenpieler X-Patchwork-Id: 36715 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:1916:b0:8b:804:ebe9 with SMTP id bv22csp323503pzb; Fri, 8 Jul 2022 15:55:37 -0700 (PDT) X-Google-Smtp-Source: AGRyM1v4YPaji3tjtOrL8Hu5DRYqKkNgj4tzvGydDxUMrUYEQEwQkHjZcYhJJOLrK3NG1DyiC4Pj X-Received: by 2002:a17:907:6818:b0:72b:1347:3566 with SMTP id qz24-20020a170907681800b0072b13473566mr6027910ejc.277.1657320937776; Fri, 08 Jul 2022 15:55:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657320937; cv=none; d=google.com; s=arc-20160816; b=PeEEbfHwI2cM9JP8XP3ES2Skllq/3uA7b/EW6F7FCDv1HLUfSUIXTbFi1U8rNCtP70 Dzpik63o8NXO29ZRU9F6+ylcnb+gDJOa/3x2tO8aa43gB+S4DWdS11h3b5PGRsIW/3qT 7jY/BEFSzfezInWHJQtyWraUCEkZ5HvpB0+zNkk2QucKCcfAnC9phA56SZOvLW7DGQU9 sfbLgJKQVxKDmAwaVHd1/DWVV5EuagXrvz1MYK5VXIZD02N/FdIpqOMSVbRdvpSKk6BP 8EjZ0l2pIFT7QEytasI8sy62z4gI1r/KTTOM/P2UMgFlA90v4jfhuMimRKOVf8FTAoXJ EzEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc: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=XRuXlhMy+1bIyYclInDSBcQPVSjzRADy0y4qdOQBbAk=; b=OmWzu4AKIGHGDGZlVQ3DYYOX57iWlzNMyEt/BklWRCjD2BsATOYadPwLkOtTo6u+GT fBcq9PucakPwluQZnL89dqPZCtZLbyV2sFzf7ESPS9c3GAMppYP6/U3/3OnImuNTwqLn HGSHPL+cgcNlZ6ivqibuoYH7rnBJLotUdbYxUYV9+iJ0wgJfXjM6iXxUXkk4M7Bwq/ik Ga6OdPZuRgT83/l7oHvZtf/UnjmzsTw2TFojC+0nc2DVF73g/ECuFZw9/uvR2x/EmXTq 9o4k5g3GbA1S/Jpciqwra2Jb7PP+ajm2XxIQsM5yngEWQ0dc8PuY4K+W6ryhw6gBLIDo nEzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@rothenpieler.org header.s=mail header.b=U51Z0+Av; 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=rothenpieler.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id d17-20020a170906545100b00711fc1fb3cfsi28398113ejp.399.2022.07.08.15.55.37; Fri, 08 Jul 2022 15:55:37 -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=@rothenpieler.org header.s=mail header.b=U51Z0+Av; 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=rothenpieler.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A8E8F68B9B7; Sat, 9 Jul 2022 01:54:36 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from btbn.de (btbn.de [136.243.74.85]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id ED03A68B90D for ; Sat, 9 Jul 2022 01:54:27 +0300 (EEST) Received: from [authenticated] by btbn.de (Postfix) with ESMTPSA id D8EF9316FBA; Sat, 9 Jul 2022 00:54:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rothenpieler.org; s=mail; t=1657320861; bh=1nQPcAKKAqvzv0Vuf5xUolsyvwAiPr6eeSf6BqUx7aQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=U51Z0+AvL7XQsOvBfmjdFxyEk7tZwC2g1WYhfm8LPNUwY9GPOpev+b22BOL7RZDVQ sD+iSmGOdMpy7Roi6FJAQEozPvRzzcUV+NFZbDrlHTgKeZzGXkVnJMKZu66rBwupvI yahJmQEwPjvxNri6CKytLNMwHhVe2zlGK+3OJ2Zj3NvRyI5ftddXepJLZSpgntdvtK AT1AXGNMB+n5OwZgpe+NWQLLlTx9JboKlebTOjG8NtoCGtHp2P6MckzsEIgvGVpS14 ETxylU402GnV9TB066JR90akIdO6lzeObHpHdNq7an30fu/3Hm7Vl/6RFdU7uLsuAN wBBFNVXnl4GKw== From: Timo Rothenpieler To: ffmpeg-devel@ffmpeg.org Date: Sat, 9 Jul 2022 00:54:03 +0200 Message-Id: <20220708225404.23748-8-timo@rothenpieler.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220708225404.23748-1-timo@rothenpieler.org> References: <20220708225404.23748-1-timo@rothenpieler.org> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 7/8] avdevice/lavfi: pass forward video framerate 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: Timo Rothenpieler Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: c5GkUZ7yub4W --- libavdevice/lavfi.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libavdevice/lavfi.c b/libavdevice/lavfi.c index 1b282a70cb..246f7dff3b 100644 --- a/libavdevice/lavfi.c +++ b/libavdevice/lavfi.c @@ -287,6 +287,7 @@ av_cold static int lavfi_read_header(AVFormatContext *avctx) for (i = 0; i < lavfi->nb_sinks; i++) { AVFilterContext *sink = lavfi->sinks[lavfi->stream_sink_map[i]]; AVRational time_base = av_buffersink_get_time_base(sink); + AVRational frame_rate = av_buffersink_get_frame_rate(sink); AVStream *st = avctx->streams[i]; AVCodecParameters *const par = st->codecpar; avpriv_set_pts_info(st, 64, time_base.num, time_base.den); @@ -299,6 +300,10 @@ av_cold static int lavfi_read_header(AVFormatContext *avctx) avctx->probesize = FFMAX(avctx->probesize, sizeof(AVFrame) * 30); st ->sample_aspect_ratio = par->sample_aspect_ratio = av_buffersink_get_sample_aspect_ratio(sink); + if (frame_rate.num > 0 && frame_rate.den > 0) { + st->avg_frame_rate = frame_rate; + st->r_frame_rate = frame_rate; + } } else if (par->codec_type == AVMEDIA_TYPE_AUDIO) { par->sample_rate = av_buffersink_get_sample_rate(sink); ret = av_buffersink_get_ch_layout(sink, &par->ch_layout);