[FFmpeg-devel] [PATCH] Implement -sample_fmts

Stefano Sabatini stefano.sabatini-lala
Thu Dec 24 11:49:25 CET 2009


On date Tuesday 2009-12-22 14:53:24 +0100, Michael Niedermayer encoded:
> On Tue, Dec 22, 2009 at 12:38:35AM +0100, Stefano Sabatini wrote:
> > On date Monday 2009-12-21 23:43:05 +0100, Michael Niedermayer encoded:
> > > On Mon, Dec 21, 2009 at 11:11:30PM +0100, Stefano Sabatini wrote:
> > > > Hi,
> > > > similar to -pix_fmts.
> > > > -- 
> > > > FFmpeg = Faboulous and Friendly Mournful Puritan Eager Governor
> > > 
> > > >  cmdutils.c                   |    6 ++++++
> > > >  cmdutils.h                   |    6 ++++++
> > > >  cmdutils_common_opts.h       |    1 +
> > > >  doc/fftools-common-opts.texi |    3 +++
> > > >  4 files changed, 16 insertions(+)
> > > > bd7d7f8721f2cc7a910d52e1d40493246eae3881  implement-sample-fmts.patch
> > > 
> > > we already have -sample_fmt list, so this is not needed
> > 
> > 1) the same should be applied to -pix_fmts, on the other hand for
> > example ffplay has a -pix_fmt option but in that case -pix_fmt list is
> > not implemented.
> 
> yes, -pix_fmt list should be implemented
> 
> 
> > 
> > 2) there are already many options showing elements, -codecs, -formats,
> > -pix_fmts etc. so the user may expect to find a similar thing for
> > sample formats.
> 
> you could remove them

Are you suggesting to remove all the listing options (-formats,
-codecs, ...), then have something like -f list, -codec list?
  
> > 3) -sample_fmt list is weird syntax/beavior, -key VERB when the user
> 
> i see nothing weird on it, but duplicating each option and thus duplicating
> the number of options (and amount of time to find the right one) is weird
>
> > may expect -key VALUE (BTW this is also one of the reason for which I
> > would have preferred -list STUFF), so my suggestion is to remove
> > -sample_fmt/-pix_fmt list instead.
> 
> i rejected -list STUFF already, it seems -pix_fmts sliped through, this
> is my mistake, i had not realized conciously that -whatever list is
> implemented for some

I can see two types of options:
-VERB [ARGS]

this does something according to arguments provided

-KEY VALUE

this sets a value corresponding to VALUE.

-KEY VERB or -KEY alone look strange to me.

-KEY alone is problematic when you want to extend the options and
create an option for setting that key (e.g. -filters -> -filters
FILTERS).

-KEY (SPECIAL_OPERAND | VALUE_TO_SET)

is weird since it changes the semantics of the option according to the
argument provided, in this case we have:
-pix_fmt PIX_FMT

will set the option, while
-pix_fmt list

will make the program list and exit, which are quite two different
behaviors.

Also for example in the case:
-filters list

it is not completely unconceivable to have some filter named "list",
and we don't know how we could extend the program and include some
option for setting an element for which the "list" special value
corresponds to the name of an element.

(Well I believe I bored you enough... ;-).

Regards.
-- 
FFmpeg = Fast Fiendish Martial Powered Elastic Game



More information about the ffmpeg-devel mailing list