Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Soft Works <softworkz@hotmail.com>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH] avfilter/vf_subtitles: add an option to choose sub stream by language
Date: Wed, 8 Jun 2022 23:34:01 +0000
Message-ID: <DM8P223MB0365EE6524A713DF05C84BCEBAA49@DM8P223MB0365.NAMP223.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <4b9efd47-b79c-599-b8e-b3dd1b52371@passwd.hu>



> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of Marton
> Balint
> Sent: Thursday, June 9, 2022 12:36 AM
> To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
> 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:<si>


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".

      reply	other threads:[~2022-06-08 23:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-19  0:58 James Darnley
2022-04-20 18:25 ` Michael Niedermayer
2022-06-08 22:35 ` Marton Balint
2022-06-08 23:34   ` Soft Works [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DM8P223MB0365EE6524A713DF05C84BCEBAA49@DM8P223MB0365.NAMP223.PROD.OUTLOOK.COM \
    --to=softworkz@hotmail.com \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git