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 E359842E32 for ; Wed, 8 Jun 2022 23:34:13 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6FF6D68B6E1; Thu, 9 Jun 2022 02:34:10 +0300 (EEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12olkn2093.outbound.protection.outlook.com [40.92.21.93]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 01F3868B6A3 for ; Thu, 9 Jun 2022 02:34:03 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OSQAdQpcdA3LIjZsz/ZpF4Femhofh35HdizsR70gq+piSuauKKaW3/pSfq8BK3AnX6wKNoSmbyQfg5lFW/DdGPWIJoHSBmkiR2b7a+iHOO8899VrtgmigUElJ9QLVQBpODOTZMQ80UQpT+x0GWncZIRmyK8sUwecFStmf2jACLR11l0K5PY4LxM795730ge7K5ynSYQ7DNE1LulTAv5NSjSmSxfxLg5uyUJ0Z/xL88fbAZiMZ/gBewaY/T4IAsN6SFxpt15NGhXL9/oIdGYv2KFl2Ox5LGkz5JDgnhz8paZETTzlgTNWK2EFRD0oFiOBzd1SkbwXEZvoXBMo5my5ng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=U1SwAUXYNCeDHZfv13VOmqWZmFkGvpaUjY9vxatwTmA=; b=CG4k+q8GoLuamOoFhYD0NLApS29KYioPWdygnogz1ld8uTOI0GDLO+682hfTV8ungyCFrVdItXopmvfXsRfvuHNRYeMrEtHXqK3qsX1w83vrMY1brDt+ydoOa5+etckX42tNmjJ7oIw+oy/IVy0B2lFoH1HEFmdFqbV7ZwB6xXZX2fw5zBxf/gQfFvlDuccP+ARNBtfFEOL4O3Fo7GGUkck6D7pEUm6cbR1dY77h8/jPziqba//V+22FnsywezFnIWbvsWflTU1Szx8mP3Bw8Ar6W9pF0g9oH9QuknMNjmIAfk1HE4NKMiTX9IS33F0pjV1kmeYlYkGQXTRf1ybwSw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=U1SwAUXYNCeDHZfv13VOmqWZmFkGvpaUjY9vxatwTmA=; b=SAw14VXqEwXljTVjN8e2u+phF2BSevmplRzYVU0m9uHV6hd/XATsS5C68y8+NNGLbqRUpAhxspxvHn/nGzzaL++5Xrk6HuiTqUCTomw89/WSNOe3nqN6vGyER7So6+1hB+oBsl7sjib+/L6RqejLsMIp7DjrcMdGhspz8q+QCQpNYZS9AanIwQuOEjjYikq9WHunAItiOUjgJHw6jBInyvUixorx3wegKQW9srK5XHCEQynyqHbsDqHjaxot0AFPMO2fJBE4mtWh6Px1xQ9HY7dryYIOqC1wuWMIZQc54GcV3epY6cZs85/trCr+Dbz0GGInkRtNVn59C9lx+/a2bw== Received: from DM8P223MB0365.NAMP223.PROD.OUTLOOK.COM (2603:10b6:8:b::20) by CH0P223MB0282.NAMP223.PROD.OUTLOOK.COM (2603:10b6:610:f0::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5314.13; Wed, 8 Jun 2022 23:34:01 +0000 Received: from DM8P223MB0365.NAMP223.PROD.OUTLOOK.COM ([fe80::f144:21f9:cdb1:5c8a]) by DM8P223MB0365.NAMP223.PROD.OUTLOOK.COM ([fe80::f144:21f9:cdb1:5c8a%7]) with mapi id 15.20.5314.019; Wed, 8 Jun 2022 23:34:01 +0000 From: Soft Works To: FFmpeg development discussions and patches Thread-Topic: [FFmpeg-devel] [PATCH] avfilter/vf_subtitles: add an option to choose sub stream by language Thread-Index: AQHYU4ieBBn3+kXuIU2ypC8rVk/yVa1GaRuAgAAEtkA= Date: Wed, 8 Jun 2022 23:34:01 +0000 Message-ID: References: <20220419005829.1886458-1-james.darnley@gmail.com> <4b9efd47-b79c-599-b8e-b3dd1b52371@passwd.hu> In-Reply-To: <4b9efd47-b79c-599-b8e-b3dd1b52371@passwd.hu> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-tmn: [fbJAsgfyvq8v6OVivsvuBBhrIVaBBaNp] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 151eef85-cd52-46d5-ac91-08da49a75e0b x-ms-traffictypediagnostic: CH0P223MB0282:EE_ x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: jcHwu5SbL+Fzy2ozAhYyUtAKPLQyXoydoNsGVZWytFK4jzWbUwwOS8HlqnRSNt7kNgHrJwoGMapKGwz3UWdKuRUPLB3pL51qCaKvhPAC46V2asxZVikWgY84yYJWUU5kIvRfmcfPeS3bRHCf88lljY053XlTXZJ5mrmJlpYvhAatWX2IYruh0OCDp0m9BZQPSBZyN/mFqAk90A7iUlHfbUiNhmeKZIrxW0jjo8/cYvxhraIm6IYF6KrAIQwH4Z/ldOZoH0Bcu/LLzJsV/WgrWKd+wPoLLzuQGFND+pRWXDRH7CF4dd/DyubFTiIa0VXaHprT8AjNMFtprQZDvres6tZMR44PLyPEeTFNlut9oC34eHOQqiAdplrl3iGb6U4QUokeb5Zx5kWhUuETnHpV5nZ2o/uF338l4jk1ElthmX/I1IguI8QYhu/6Ei6+a7ycm02OXm48jNRwKNWYvrdSe0j9zenkKRkLzj1GsBgx2bp87QOgwwCnT6YzH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CemFWOUZKVllUaXJVWnhxalk4OTZmNHpIeXhMRTRVZ3Bn?= =?utf-8?B?RUd1N3Q2T1VsYmNWcUZxLzJrSkExanhnbjQxMElkV3QyMkIxeU9vaTRCdGV6?= =?utf-8?B?M1ZGdUpjcXkxSThCWFZ2bEdOWDFicXpCSmRENGo3U25ZZWhxdVNtNFQwV3ho?= =?utf-8?B?a0dORlQ1MHQ4KzJVNjlLcEFJeUtCN0JLZW9QZDNTUHpYdFRPa1RrTFp1Rk5m?= =?utf-8?B?dmFCK2NtY3RvUXo4NXJXM2VtWEc3UjVGOXZaRDJNRnJyVHhBUk0zVFFTV0c0?= =?utf-8?Q?6jDCdJxTfrs=3D?= MIME-Version: 1.0 X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-1ff67.templateTenant X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM8P223MB0365.NAMP223.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 151eef85-cd52-46d5-ac91-08da49a75e0b X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Jun 2022 23:34:01.2379 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0P223MB0282 Subject: Re: [FFmpeg-devel] [PATCH] avfilter/vf_subtitles: add an option to choose sub stream by language 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-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: > -----Original Message----- > From: ffmpeg-devel On Behalf Of Marton > Balint > Sent: Thursday, June 9, 2022 12:36 AM > To: FFmpeg development discussions and patches > Subject: Re: [FFmpeg-devel] [PATCH] avfilter/vf_subtitles: add an option to > choose sub stream by language > > > > On Tue, 19 Apr 2022, James Darnley wrote: > > > --- > > doc/filters.texi | 5 +++++ > > libavfilter/vf_subtitles.c | 23 ++++++++++++++++++++--- > > 2 files changed, 25 insertions(+), 3 deletions(-) > > > > diff --git a/doc/filters.texi b/doc/filters.texi > > index a161754233..cfbc807f16 100644 > > --- a/doc/filters.texi > > +++ b/doc/filters.texi > > @@ -21160,6 +21160,11 @@ Override default style or script info parameters > of the subtitles. It accepts a > > string containing ASS style format @code{KEY=VALUE} couples separated by > ",". > > @end table > > > > +@item language > > +Use first stream with the given language, ISO language code. > @code{subtitles} > > +filter only. Requires the language metadata to be read from the file. > > +@end table > > Using a stream specifier to select a stream would be more general. The filter has an "si" parameter (stream index) which is equivalent to -s: I understand the desire for being able to choose by language but I'm not sure whether that's a good idea in this context. The vf_subtitles filter has always been a workaround over the lack of subtitle filtering. Without that, it's not possible to move subtitles through a filter graph, so the vf_subtitles filter does something pragmatic: It opens the input file a second time and in parallel (assuming the subtitles are in the same media file as the video onto which these are meant to be overlaid). This is often leading to sub-optimal performance and even worse when the file is accessed over network (made up of cheap devices..) It's already a pretty odd case because vf_subtitles needs to link to both, avformat and avcodec to do its work. I'm not sure whether it is right to blow up the vf_subtitles implementation for parsing and decoding with some special stream selection. I think once there would be a parameter added for selecting by language, then there wouldn't be a valid reason anymore to deny the next one requesting a parameter for choosing only forced subs, another one for excluding (or preferring) hearing impaired subs, and once again a language-fallback parameter (if lang A isn't available then lang B), and also a fallback-behavior parameter (like fail or choose any). Thinking about this, we'll also realize: ffmpeg itself doesn't have such kind of stream selection capabilities. I'm not sure whether this is desirable, maybe it is useful for some, but in case, it should be implemented in ffmpeg tool to it would be useful in a wide range of cases instead. Finally, subtitle filtering obsoletes vf_subtitles. It needs to be kept for compatibility for some time, but it's an inferior option then. Best regard, softworkz _______________________________________________ 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".