From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id 4090A4E451 for ; Wed, 9 Jul 2025 23:41:21 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 9304168F828; Thu, 10 Jul 2025 02:41:18 +0300 (EEST) Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id 94E3A68F81F for ; Thu, 10 Jul 2025 02:41:12 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id D9991433B5; Wed, 9 Jul 2025 23:41:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1752104472; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=PaBPfgJN/aVYhxq2NzdDIWKq/TSvs8n5F0xJP7UFUzM=; b=U9L2hYPm54Dw1YE/j0JtGK4RRRzBQU2HM5G3IIsmnZ75m0xyInqnHlYEc+GJRxFiAg8js8 0tlebU3CL+ZoAX1oOuyTxU48RKPQfSHsBJx3dmE+dlql2Pnkj7JYePTw/xZsiQ410QSh6l g0TVPkJDg0BYOBhz2MmgjS2r6Ztp/31a3ZfFUal8/J7V/s8PWNCxnabOFlExwZ5zkdhK/I YW/alqe1Y9h6XqLk1DYUgSuZ6i0X3Z7XGV6Uaw4wbhiuUPemg7elHmlGDEMygXAyDntIMn tIEb8a8O0mN7iYfvNl1PIrvO/tYDYlJlOH6Nq98WbzYLgnpgi54MA0MjL1idyw== Date: Thu, 10 Jul 2025 01:41:10 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20250709234110.GN29660@pb2> References: <20250709072350.578693-1-vpalmisano@gmail.com> MIME-Version: 1.0 In-Reply-To: <20250709072350.578693-1-vpalmisano@gmail.com> X-GND-State: clean X-GND-Score: -70 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdefgdefkeeltdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfitefpfffkpdcuggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedtudenucesvcftvggtihhpihgvnhhtshculddquddttddmnegfrhhlucfvnfffucdlfedtmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefoihgthhgrvghlucfpihgvuggvrhhmrgihvghruceomhhitghhrggvlhesnhhivgguvghrmhgrhigvrhdrtggtqeenucggtffrrghtthgvrhhnpeeltdeihedthfeutdfhgeejtdelvefgudffuddvudffgfdthedtudegudeihfejtdenucfkphepgedurdeiiedrieehrddujeeinecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepgedurdeiiedrieehrddujeeipdhhvghloheplhhotggrlhhhohhsthdpmhgrihhlfhhrohhmpehmihgthhgrvghlsehnihgvuggvrhhmrgihvghrrdgttgdpnhgspghrtghpthhtohepvddprhgtphhtthhopehffhhmphgvghdquggvvhgvlhesfhhfmhhpvghgrdhorhhgpdhrtghpthhtohepvhhprghlmhhishgrnhhosehgmhgrihhlrdgtohhm X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [PATCH] Whisper audio filter 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: Vittorio Palmisano Content-Type: multipart/mixed; boundary="===============7417186785548938270==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============7417186785548938270== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="cWqS+ixoBB8AI9iU" Content-Disposition: inline --cWqS+ixoBB8AI9iU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi On Wed, Jul 09, 2025 at 09:23:48AM +0200, Vittorio Palmisano wrote: > It adds a new audio filter for running audio transcriptions with the whis= per model. > Documentation and examples are included into the patch. >=20 > Signed-off-by: Vittorio Palmisano > --- > configure | 5 + > doc/filters.texi | 101 ++++++++ > libavfilter/Makefile | 2 + > libavfilter/af_whisper.c | 494 +++++++++++++++++++++++++++++++++++++++ > libavfilter/allfilters.c | 2 + > 5 files changed, 604 insertions(+) > create mode 100644 libavfilter/af_whisper.c [...] > +static void run_transcription(AVFilterContext *ctx, AVDictionary **metad= ata, int end_pos) > +{ > + WhisperContext *wctx =3D ctx->priv; > + end_pos =3D FFMIN(end_pos, wctx->audio_buffer_fill_size); > + > + if (!wctx->ctx_wsp || end_pos =3D=3D 0) > + { > + return; > + } > + > + if (!wctx->ctx_wsp) > + { > + return; > + } > + > + float duration =3D (float)end_pos / WHISPER_SAMPLE_RATE; In fact float should not be used here end_pos, audio_buffer_fill_size are all integers and the timestamp is also integer exact integer / rational math can and should be used here thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Give a rich man 100$ and he will turn it into 1000$. Give a poor man 1000$ and he will spend it. --cWqS+ixoBB8AI9iU Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEKAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCaG7+FgAKCRBhHseHBAsP q2dkAJ41LUTBPKClbpdm3LEnBo/1fDu/DQCdFSdlYJxddyMXUEAcmW0j59SeGFg= =sowG -----END PGP SIGNATURE----- --cWqS+ixoBB8AI9iU-- --===============7417186785548938270== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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". --===============7417186785548938270==--