[FFmpeg-devel] [PATCH] ffprobe: implement string validation policy setting

Timothy Gu timothygu99 at gmail.com
Thu Oct 3 00:30:06 CEST 2013


On Oct 2, 2013 10:08 AM, "Clément Bœsch" <u at pkh.me> wrote:
>
> On Wed, Oct 02, 2013 at 05:52:05PM +0200, Stefano Sabatini wrote:
> > This should fix trac tickets #1163, #2502, #2955.
> > ---
> >  doc/ffprobe.texi |  24 ++++++++++
> >  ffprobe.c        | 141
++++++++++++++++++++++++++++++++++++++++++++++++++++---
> >  2 files changed, 158 insertions(+), 7 deletions(-)
> >
> > diff --git a/doc/ffprobe.texi b/doc/ffprobe.texi
> > index 777dbe7..55c6e80 100644
> > --- a/doc/ffprobe.texi
> > +++ b/doc/ffprobe.texi
> > @@ -317,6 +317,30 @@ Show information related to program and library
versions. This is the
> >  equivalent of setting both @option{-show_program_version} and
> >  @option{-show_library_versions} options.
> >
> > + at item -string_validation_policy @var{policy}
> > +Set string validation policy. It accepts the following values.
> > +
> > + at table @samp
> > + at item fail
> > +The program will fail immediately in case an invalid string (UTF-8)
> > +sequence is found in the input. This is especially useful to validate
> > +input metadata.
> > +
> > + at item replace=REPLACEMENT
>
> replace[=@var{REPLACEMENT}]
>
> > +The program will substitute the invalid UTF-8 sequences with the
> > +string specified in @var{REPLACEMENT}, which is typically a simple
> > +character.
>
> ...such as '?'.
>
> > +
> > +In case the replacement string is not specified, the program will
> > +assume the empty string, that is it will remove the invalid sequences
> > +from the input strings.
> > +This is especially useful to create validate metadata output from
> > +invalid sources.
> > + at end table
> > +
> > +By default the program will apply the replace policy with an empty
>
> the @var{replace} policy

the @samp{replace} policy

[...]

Timothy


More information about the ffmpeg-devel mailing list