[FFmpeg-devel] [PATCH v2 7/8] avfilter/sleet: Add sleet filter

Soft Works softworkz at hotmail.com
Tue Sep 7 10:31:07 EEST 2021



> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces at ffmpeg.org> On Behalf Of
> Moritz Barsnick
> Sent: Friday, 3 September 2021 10:24
> To: FFmpeg development discussions and patches <ffmpeg-
> devel at ffmpeg.org>
> Subject: Re: [FFmpeg-devel] [PATCH v2 7/8] avfilter/sleet: Add sleet
> filter
> 
> On Tue, Aug 31, 2021 at 22:49:12 +0000, Soft Works wrote:

[..]

> 
> Well, at least it demonstrates the boilerplate required for a simple
> S->S filter, which touches only text (no timings or positioning or
> so).
> A review of this boilerplate would be great.
> 
> For the sake of review:
> - You need to add documentation to doc/filters.texi.
> - You need to bump MINOR in libavfilter/version.h.
> 
> > Maybe an "sallcaps" filter makes slightly more sense than "sleet"?
> 
> For the sake of usability, I would rather have suggested something
> like
> "tr" (https://linux.die.net/man/1/tr,
> https://www.geeksforgeeks.org/perl-tr-operator/), where you can
> specify
> the replacement list. That said, tr has some funky shortcuts ("[a-z]
> [A-Z]" for uppercase, which may be harder to implement). Or actual
> regular expression support.
> 
> What I suggest is still not really useful for a user, though. Or is
> it?

Hi Moritz,

I have changed the filter to a multi-purpose text modification filter
and renamed it to 'textmod'.

It has the following options:

"mode",             "set operation mode",            
  "leet",           "convert text to 'leet speak'",  
  "to_upper",       "change to upper case",          
  "to_lower",       "change to lower case",          
  "replace_chars",  "replace characters",            
  "remove_chars",   "remove characters",             
  "replace_words",  "replace words",                 
  "remove_words",   "remove words",                  
"find",             "chars/words to find or remove", 
"replace",          "chars/words to replace",        
"separator",        "word separator (default: ',')",

I think that makes it sufficiently useful.

Some plausible use case examples:

replace_words

Some movies (like Disney's Moana) are using different character 
names depending on country (Moana aka Vaiana aka Oceania, ..).
The character naming in subtitles might not always match what you're
expecting - you can use replace_words to fix it

remove_chars

Certain characters might be visually annoying for some (like the 
flipped exclamation and question marks in Spanish). With remove_chars,
these can be removed

to_upper

For improved readability

leet

Still highly useless (except for testing) ;-)


softworkz



More information about the ffmpeg-devel mailing list